Skip to content

Implement build for SuSE#121

Merged
Totktonada merged 1 commit intopackpack:masterfrom
avtikhon:avtikhon/gh-4562-add-suse-zipper-spec
Aug 14, 2020
Merged

Implement build for SuSE#121
Totktonada merged 1 commit intopackpack:masterfrom
avtikhon:avtikhon/gh-4562-add-suse-zipper-spec

Conversation

@avtikhon
Copy link
Contributor

@avtikhon avtikhon commented Apr 20, 2020

Implemented ability to build openSuSE using pack/rpm.mk makefile.
openSuSE detects by checking of ID field equal to 'opensuse-leap'
within "/etc/os-release" file.

Usual 'Release' RPM spec directive:

RPMRELEASE := $(RELEASE)%{dist}

where $(RELEASE) is '1' value and %{dist} is like '.el8' or '.fc31'.

Open Build Service (openSUSE) does not follow the usual approach - its
'Release' is like 'lp152.1.1', where:

  • 'lp152' value is the SuSE OS name: 'lp' - opensuse-leap w/ version;
  • the first '1' is $(RELEASE) value;
  • the second '1' is the number of rebuilds.

We follow OBS way for openSUSE, because there is no %{dist} macro
defined and there are no recommendations for packaging w/o OBS:

RPMRELEASE := $(RPMDIST).$(RELEASE).1

where $(RPMDIST) sets according to "%{sle_version}" macro, like when
%{sle_version} equal to '150200' then RPMDIST is 'lp152', check:
https://en.opensuse.org/openSUSE:Packaging_for_Leap#RPM_Distro_Version_Macros

Added prebuild cleanup target rule to fix the issue with
broken repositories in zypper cache:
Media source 'http://download.opensuse.org/distribution/leap/15.2/repo/oss/' does not contain the desired medium
It refreshes zypper cache.

Also SuSE uses build tool:
"zypper source-install --build-deps-only --force-resolution --recommends"

Part of tarantool/tarantool#4562

Co-authored-by: Alexander Turenko alexander.turenko@tarantool.org

@ligurio
Copy link

ligurio commented Apr 23, 2020

current status:

  • remove unsupported oses in CI matrix
  • restart travis and move to review in case pass

@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 4 times, most recently from 8d8f7e1 to 8803ab4 Compare April 23, 2020 09:45
@avtikhon
Copy link
Contributor Author

Blocked by
#122

@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 3 times, most recently from 901feb1 to 2cd1c0f Compare April 24, 2020 04:25
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 2 times, most recently from 8ba23b5 to fb28ee3 Compare April 28, 2020 10:56
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch from fb28ee3 to 3f2870f Compare April 28, 2020 16:13
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 2 times, most recently from 310d675 to d1775d0 Compare May 12, 2020 12:08
@avtikhon avtikhon requested a review from Totktonada June 22, 2020 21:38
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 4 times, most recently from 802ceb3 to 46c5728 Compare June 29, 2020 06:51
@avtikhon avtikhon requested a review from Totktonada June 29, 2020 07:07
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 2 times, most recently from 3f6d0e2 to 611a240 Compare June 30, 2020 19:15
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch 2 times, most recently from 2d0706d to 6a732b5 Compare June 30, 2020 21:14
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I more or less understood what is going on with the package naming, thanks!

I pushed the fixup commit in order to clarify why extra care is needed for SuSE. I didn't verify it, so, please, test it thoroughly.

I tried to keep Release: 1%{dist} for usual distros, because this way RPM specs within source RPM packages are the same. This fact is not used anywhere, but maybe we'll deploy one source package and many per-distro built packages for one tarantool version to safe some disk space and network traffic. Have practically same source packages looks as the good property.

The only thing that I don't understand is how the Release: xxx spec: yyy syntax works. I simplified it to Release: yyy in the comment, because the observable behaviour (a package name that rpmbuild produces) looks the same if Release: yyy would be set. I decided to don't try to explain this part in the comment, because it is not clear for me and the description would be not clear so.

Please, also double-read each sentence of the commit message: whether they are actual. I see that even header 'Add zypper makefile for SuSE' is not actual anymore: we don't add any makefile here, right? Update commit message and PR header / description.

@avtikhon avtikhon requested a review from Totktonada July 4, 2020 08:43
@avtikhon avtikhon changed the title Add zypper makefile for SuSE Implement build for SuSE Jul 5, 2020
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch from 8b9e587 to 566d641 Compare July 5, 2020 05:41
@Totktonada
Copy link
Member

SuSE OS detects by existance of "/etc/os-release" afterwards.

It is not accurate. In fact, it checks ID field within this file.

@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch from 566d641 to a1c3111 Compare July 7, 2020 09:03
@avtikhon
Copy link
Contributor Author

avtikhon commented Jul 7, 2020

t checks ID field within this file

Right, I've corrected the commit message.

@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch from 3edda3e to 4bad436 Compare July 7, 2020 12:52
Implemented ability to build openSuSE using pack/rpm.mk makefile.
openSuSE detects by checking of ID field equal to 'opensuse-leap'
within "/etc/os-release" file.

Usual 'Release' RPM spec directive:

  RPMRELEASE := $(RELEASE)%{dist}

where $(RELEASE) is '1' value and %{dist} is like '.el8' or '.fc31'.

Open Build Service (openSUSE) does not follow the usual approach - its
'Release' is like 'lp152.1.1', where:
  - 'lp152' value is the SuSE OS name: 'lp' - opensuse-leap w/ version;
  - the first '1' is $(RELEASE) value;
  - the second '1' is the number of rebuilds.

We follow OBS way for openSUSE, because there is no %{dist} macro
defined and there are no recommendations for packaging w/o OBS:

  RPMRELEASE := $(RPMDIST).$(RELEASE).1

where $(RPMDIST) sets according to "%{sle_version}" macro, like when
%{sle_version} equal to '150200' then RPMDIST is 'lp152', check:
https://en.opensuse.org/openSUSE:Packaging_for_Leap#RPM_Distro_Version_Macros

Added prebuild cleanup target rule to fix the issue with
broken repositories in zypper cache:
  Media source 'http://download.opensuse.org/distribution/leap/15.2/repo/oss/' does not contain the desired medium
It refreshes zypper cache.

Also SuSE uses build tool:
  "zypper source-install --build-deps-only --force-resolution --recommends"

Part of tarantool/tarantool#4562

Co-authored-by: Alexander Turenko <alexander.turenko@tarantool.org>
@avtikhon avtikhon force-pushed the avtikhon/gh-4562-add-suse-zipper-spec branch from 4bad436 to 4827a49 Compare August 13, 2020 16:44
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Totktonada Totktonada merged commit 4ef4fd7 into packpack:master Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants