use conditionals instead

This commit is contained in:
nazunalika 2022-05-08 08:40:04 -07:00
parent f51f6a21b4
commit 7e341ec641
Signed by: label
GPG Key ID: 6735C0E1BD65D048
2 changed files with 16 additions and 12 deletions

View File

@ -8,15 +8,15 @@ This package produces multiple variants of `rocky-release`:
* LookAhead: All packages appended with `-lookahead` * LookAhead: All packages appended with `-lookahead`
* Beta: All packages appended with `-Beta` * Beta: All packages appended with `-Beta`
* If `rllh` or `rlbeta` are set to a number higher than 0, those variants are built * If `--with=rllookahead` or `--with=rlbeta` are set in mock, those variants are built
* If `rllh` and `rlbeta` are set at the same time higher than 0, build will fail. * If both are set the same time, build will fail
When `rllh` is set the minor version will typically be `y+1`. So if the current When `--with=rllookahead` is set the minor version will typically be `y+1`. So if the current
stable is `X.0`, the next would be `X.1`. stable is `X.0`, the next would be `X.1`.
For pre-releases/beta, both packages should produce `X.0` until changed in the spec. For pre-releases/beta, both packages should produce `X.Y` until changed in the spec.
The `rllh` macro may be versioned out for future use. The `rllh` macro may be versioned out for future use. It does not have to be explicitly set.
A `rllh_minor` macro may be introduced in the future. A `rllh_minor` macro may be introduced in the future.

View File

@ -1,8 +1,12 @@
# Note to packagers/builders: # Note to packagers/builders:
# #
# If you wish to build the LookAhead variant of this package, ensure that the # If you wish to build the LookAhead or Beta variant of this package, sure
# rllh macro is set either in your build or in the build system. Please see # that you are setting --with=rlbeta or --with=rllookahead on your mock
# the git repository readme for more information. # command. See the README for more information.
%bcond_with rlbeta
%bcond_with rllookahead
%bcond_with rloverride
%define debug_package %{nil} %define debug_package %{nil}
@ -29,7 +33,7 @@
# Rocky LookAhead Section # Rocky LookAhead Section
# #
# Reset defines for LookAhead variant. Default is stable if 0 or undefined. # Reset defines for LookAhead variant. Default is stable if 0 or undefined.
%if 0%{?rllh} %if %{with rllookahead}
%define minor 1 %define minor 1
%define contentdir pub/rocky-lh %define contentdir pub/rocky-lh
%define rltype lookahead %define rltype lookahead
@ -44,7 +48,7 @@
# #
# Reset defines for Beta variant. Default is stable if 0 or undefined. # Reset defines for Beta variant. Default is stable if 0 or undefined.
# We do NOT override the minor version number here. # We do NOT override the minor version number here.
%if 0%{?rlbeta} %if %{with rlbeta}
%define contentdir pub/rocky-beta %define contentdir pub/rocky-beta
%define rltype beta %define rltype beta
%define rlpkg -beta %define rlpkg -beta
@ -178,7 +182,7 @@ Provides: system-sb-certs = %{version}-%{release}
This package contains the %{distro_name} secureboot public certificates. This package contains the %{distro_name} secureboot public certificates.
%prep %prep
%if 0%{?rllh} && 0%{?rlbeta} %if %{with rllookahead} && %{with rlbeta}
echo "!! WARNING !!" echo "!! WARNING !!"
echo "Both LookAhead and Beta were enabled. This is not supported." echo "Both LookAhead and Beta were enabled. This is not supported."
echo "As a result: BUILD FAILED." echo "As a result: BUILD FAILED."
@ -353,7 +357,7 @@ install -p -m 0644 %{SOURCE102} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/
################################################################################ ################################################################################
# lookahead overrides # lookahead overrides
# TODO: Is there a cleaner way? # TODO: Is there a cleaner way?
%if 0%{?rllh} %if %{with rllookahead}
install -m 0644 %{SOURCE400} %{buildroot}/%{_prefix}/lib/systemd/system-preset/85-display-manager.preset install -m 0644 %{SOURCE400} %{buildroot}/%{_prefix}/lib/systemd/system-preset/85-display-manager.preset
install -m 0644 %{SOURCE401} %{buildroot}/%{_prefix}/lib/systemd/system-preset/90-default.preset install -m 0644 %{SOURCE401} %{buildroot}/%{_prefix}/lib/systemd/system-preset/90-default.preset
install -m 0644 %{SOURCE402} %{buildroot}/%{_prefix}/lib/systemd/system-preset/90-default-user.preset install -m 0644 %{SOURCE402} %{buildroot}/%{_prefix}/lib/systemd/system-preset/90-default-user.preset