From 518575240fd3741427a66060171d71b03c768fdd Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 2 Jul 2024 13:32:18 +0300 Subject: [PATCH 1/5] - Add bootstrap var to not build almalinux-sb-certs package - Add macros.arch_fp and macros.arch_v2 files to %files --- SPECS/almalinux-release.spec | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/SPECS/almalinux-release.spec b/SPECS/almalinux-release.spec index 803ec93..3e0b769 100644 --- a/SPECS/almalinux-release.spec +++ b/SPECS/almalinux-release.spec @@ -2,6 +2,7 @@ # Also baseurl for regular repos should be changed to repo.almalinux.org # and mirrorlist should be set as default %bcond_without beta +%bcond_with bootstrap # Needs only for first build, because we should have right arch names %if 0%{?x86_64_v2} == 1 @@ -92,6 +93,7 @@ Source512: almalinux-beta.repo Source600: RPM-GPG-KEY-AlmaLinux-10 +%if %{without bootstrap} %package -n almalinux-sb-certs Summary: %{distro} public secureboot certificates Group: System Environment/Base @@ -106,11 +108,12 @@ Requires: almalinux-gpg-keys = %{version}-%{release} %package -n almalinux-gpg-keys Summary: %{distro} RPM keys - +%endif %description %{distro} release files. +%if %{without bootstrap} %description -n almalinux-sb-certs %{distro} secureboot certificates @@ -119,7 +122,7 @@ This package provides the package repository files for %{distro}. %description -n almalinux-gpg-keys This package provides the RPM signature keys for %{distro}. - +%endif %install # copy license and contributors doc here for %%license and %%doc macros @@ -239,6 +242,7 @@ install -m 0644 %{SOURCE304} %{buildroot}/%{_prefix}/lib/sysctl.d/ mkdir %{buildroot}%{_sysconfdir}/yum.repos.d touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo +%if %{without bootstrap} # Copy secureboot certificates install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/sb-certs/ install -d -m 0755 %{buildroot}%{_datadir}/pki/sb-certs/ @@ -319,6 +323,11 @@ install -p -m 0644 %{SOURCE512} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -d -m 0755 %{buildroot}%{_sysconfdir}/dnf/vars echo "%{major}-stream" > %{buildroot}%{_sysconfdir}/dnf/vars/stream +# copy GPG keys +install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg +install -p -m 0644 %{SOURCE600} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ +%endif + # These variables should be set in the build environment to change rpm names %if 0%{?x86_64_v2} == 1 echo '%%_build_name_fmt %%{ARCH}_v2/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}_v2.rpm' > %{buildroot}%{_sysconfdir}/rpm/macros.arch_v2 @@ -329,11 +338,6 @@ echo '%%_build_name_fmt %%{ARCH}_fp/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}_fp echo '%x86_64_fp 1' >> %{buildroot}%{_sysconfdir}/rpm/macros.arch_fp %endif -# copy GPG keys -install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg -install -p -m 0644 %{SOURCE600} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ - - %files %license docs/LICENSE @@ -354,7 +358,14 @@ install -p -m 0644 %{SOURCE600} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ %{_prefix}/lib/systemd/system-preset/* %{_prefix}/lib/systemd/user-preset/* %{_prefix}/lib/sysctl.d/50-redhat.conf +%if 0%{?x86_64_fp} == 1 +%config(noreplace) %{_sysconfdir}/rpm/macros.arch_fp +%endif +%if 0%{?x86_64_v2} == 1 +%config(noreplace) %{_sysconfdir}/rpm/macros.arch_v2 +%endif +%if %{without bootstrap} %files -n almalinux-sb-certs # Note to future packagers: # resetting the symlinks in /etc/pki/sb-certs on upgrade is the intended behavior here @@ -385,7 +396,7 @@ install -p -m 0644 %{SOURCE600} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ %files -n almalinux-gpg-keys %{_sysconfdir}/pki/rpm-gpg - +%endif %changelog * Tue Jul 02 2024 Eduard Abdullin - 10.0-0.14 -- 2.43.5 From 7c772d5bbfb194505ec5d0e5a65c22d76e0b503b Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 2 Jul 2024 13:39:36 +0300 Subject: [PATCH 2/5] Remove bootstreap var --- SPECS/almalinux-release.spec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/SPECS/almalinux-release.spec b/SPECS/almalinux-release.spec index 3e0b769..8120579 100644 --- a/SPECS/almalinux-release.spec +++ b/SPECS/almalinux-release.spec @@ -2,7 +2,6 @@ # Also baseurl for regular repos should be changed to repo.almalinux.org # and mirrorlist should be set as default %bcond_without beta -%bcond_with bootstrap # Needs only for first build, because we should have right arch names %if 0%{?x86_64_v2} == 1 @@ -93,7 +92,6 @@ Source512: almalinux-beta.repo Source600: RPM-GPG-KEY-AlmaLinux-10 -%if %{without bootstrap} %package -n almalinux-sb-certs Summary: %{distro} public secureboot certificates Group: System Environment/Base @@ -108,12 +106,10 @@ Requires: almalinux-gpg-keys = %{version}-%{release} %package -n almalinux-gpg-keys Summary: %{distro} RPM keys -%endif %description %{distro} release files. -%if %{without bootstrap} %description -n almalinux-sb-certs %{distro} secureboot certificates @@ -122,7 +118,6 @@ This package provides the package repository files for %{distro}. %description -n almalinux-gpg-keys This package provides the RPM signature keys for %{distro}. -%endif %install # copy license and contributors doc here for %%license and %%doc macros @@ -242,7 +237,6 @@ install -m 0644 %{SOURCE304} %{buildroot}/%{_prefix}/lib/sysctl.d/ mkdir %{buildroot}%{_sysconfdir}/yum.repos.d touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo -%if %{without bootstrap} # Copy secureboot certificates install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/sb-certs/ install -d -m 0755 %{buildroot}%{_datadir}/pki/sb-certs/ @@ -326,7 +320,6 @@ echo "%{major}-stream" > %{buildroot}%{_sysconfdir}/dnf/vars/stream # copy GPG keys install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg install -p -m 0644 %{SOURCE600} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ -%endif # These variables should be set in the build environment to change rpm names %if 0%{?x86_64_v2} == 1 @@ -365,7 +358,6 @@ echo '%x86_64_fp 1' >> %{buildroot}%{_sysconfdir}/rpm/macros.arch_fp %config(noreplace) %{_sysconfdir}/rpm/macros.arch_v2 %endif -%if %{without bootstrap} %files -n almalinux-sb-certs # Note to future packagers: # resetting the symlinks in /etc/pki/sb-certs on upgrade is the intended behavior here @@ -396,7 +388,6 @@ echo '%x86_64_fp 1' >> %{buildroot}%{_sysconfdir}/rpm/macros.arch_fp %files -n almalinux-gpg-keys %{_sysconfdir}/pki/rpm-gpg -%endif %changelog * Tue Jul 02 2024 Eduard Abdullin - 10.0-0.14 -- 2.43.5 From ebeb6cbaacda4bd70abbae2f8f7486aeda81cde2 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 2 Jul 2024 14:10:34 +0300 Subject: [PATCH 3/5] Remove Source202 --- SPECS/almalinux-release.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/almalinux-release.spec b/SPECS/almalinux-release.spec index 8120579..e43d96c 100644 --- a/SPECS/almalinux-release.spec +++ b/SPECS/almalinux-release.spec @@ -122,7 +122,7 @@ This package provides the RPM signature keys for %{distro}. %install # copy license and contributors doc here for %%license and %%doc macros mkdir -p ./docs -cp %{SOURCE201} %{SOURCE202} ./docs +cp %{SOURCE201} ./docs # create /etc/system-release and /etc/redhat-release install -d -m 0755 %{buildroot}%{_sysconfdir} -- 2.43.5 From a5121d10bf665a76a41def845002eb774de4c01c Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 2 Jul 2024 14:29:55 +0300 Subject: [PATCH 4/5] add %{_sysconfdir}/almalinux-release --- SPECS/almalinux-release.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SPECS/almalinux-release.spec b/SPECS/almalinux-release.spec index e43d96c..c53045b 100644 --- a/SPECS/almalinux-release.spec +++ b/SPECS/almalinux-release.spec @@ -126,9 +126,9 @@ cp %{SOURCE201} ./docs # create /etc/system-release and /etc/redhat-release install -d -m 0755 %{buildroot}%{_sysconfdir} -echo "%{distro} release %{major}" > %{buildroot}%{_sysconfdir}/centos-release -ln -s centos-release %{buildroot}%{_sysconfdir}/system-release -ln -s centos-release %{buildroot}%{_sysconfdir}/redhat-release +echo "%{distro} release %{major}.%{minor}%{?beta: %{beta}} (%{release_name})" > %{buildroot}%{_sysconfdir}/almalinux-release +ln -s almalinux-release %{buildroot}%{_sysconfdir}/system-release +ln -s almalinux-release %{buildroot}%{_sysconfdir}/redhat-release # ------------------------------------------------------------------------- # Definitions for /etc/os-release and for macros in macros.dist. These -- 2.43.5 From 1f0fa03229a18588a2348d18931532806245a0cb Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 2 Jul 2024 14:49:28 +0300 Subject: [PATCH 5/5] Change arch from noarch --- SPECS/almalinux-release.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/SPECS/almalinux-release.spec b/SPECS/almalinux-release.spec index c53045b..e0afe50 100644 --- a/SPECS/almalinux-release.spec +++ b/SPECS/almalinux-release.spec @@ -24,7 +24,6 @@ Release: 0.14%{?dist} Summary: %{distro} release files License: GPLv2 URL: https://almalinux.org -BuildArch: noarch Provides: centos-release = %{version}-%{release} -- 2.43.5