From 8a52b2613fae834f7cdacddd55750feeecc04bdb Mon Sep 17 00:00:00 2001 From: Petr Stodulka Date: Tue, 2 Apr 2024 19:33:04 +0200 Subject: [PATCH] Packaging: Introduce builds for EL 9 for IPU 9 -> 10 TODO: - update commit msg - still incomplete - update Makefile --- packaging/leapp-repository.spec | 38 +++++++++++++------ .../other_specs/leapp-el7toel8-deps.spec | 6 ++- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/packaging/leapp-repository.spec b/packaging/leapp-repository.spec index 7c3fe5c6f4..236cbdee0a 100644 --- a/packaging/leapp-repository.spec +++ b/packaging/leapp-repository.spec @@ -7,9 +7,19 @@ %if 0%{?rhel} == 7 %define leapp_python_sitelib %{python2_sitelib} %define lpr_name leapp-upgrade-el7toel8 + %define repo_shortname el7toel8 + %define next_major_ver 8 %else %define leapp_python_sitelib %{python3_sitelib} - %define lpr_name leapp-upgrade-el8toel9 + %if 0%{?rhel} == 8 + %define lpr_name leapp-upgrade-el8toel9 + %define repo_shortname el8toel9 + %define next_major_ver 9 + %else + %define lpr_name leapp-upgrade-el9toel10 + %define repo_shortname el9toel10 + %define next_major_ver 10 + %endif # This drops autogenerated deps on # - /usr/libexec/platform-python (rhel-8 buildroot) @@ -84,6 +94,10 @@ Obsoletes: leapp-repository-sos-plugin <= 0.9.0 Conflicts: leapp-upgrade-el8toel9 %else +# NOTE(pstodulk): else if / elif has been implemented quite late. as we still +# want to build on RHEL 7 too, go in the old way. Ref: +# https://github.com/rpm-software-management/rpm/issues/311 +%if 0%{?rhel} == 8 ######### RHEL 8 ############ BuildRequires: python3-devel Requires: python3-leapp @@ -91,7 +105,11 @@ Requires: python3-leapp # Same as the conflict above - we want to be sure our packages are untouched # during the whole IPU process Conflicts: leapp-upgrade-el7toel8 - +Conflicts: leapp-upgrade-el9toel10 +%else +######### RHEL 9 ############ +Conflicts: leapp-upgrade-el8toel9 +%endif %endif # IMPORTANT: every time the requirements are changed, increment number by one @@ -210,11 +228,7 @@ Requires: python3-gobject-base %build -%if 0%{?rhel} == 7 -cp -a leapp*deps*el8.noarch.rpm repos/system_upgrade/el7toel8/files/bundled-rpms/ -%else -cp -a leapp*deps*el9.noarch.rpm repos/system_upgrade/el8toel9/files/bundled-rpms/ -%endif +cp -a leapp*deps*el%{next_major_ver}.noarch.rpm repos/system_upgrade/%{repo_shortname}/files/bundled-rpms/ %install @@ -222,6 +236,7 @@ install -m 0755 -d %{buildroot}%{custom_repositorydir} install -m 0755 -d %{buildroot}%{repositorydir} cp -r repos/* %{buildroot}%{repositorydir}/ install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/repos.d/ +# NOTE(pstodulk): drop transaction dir and its content if replaced by config files before RHEL 10 install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/transaction/ install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/files/ install -m 0644 etc/leapp/transaction/* %{buildroot}%{_sysconfdir}/leapp/transaction @@ -234,11 +249,10 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests # Remove irrelevant repositories - We don't want to ship them for the particular # RHEL version -%if 0%{?rhel} == 7 -rm -rf %{buildroot}%{repositorydir}/system_upgrade/el8toel9 -%else -rm -rf %{buildroot}%{repositorydir}/system_upgrade/el7toel8 -%endif +for i in el7toel8 el8toel9 el9toel10; +do + [ "$i" != "%{repo_shortname}" ] && rm -rf %{buildroot}%{repositorydir}/system_upgrade/$i +done # remove component/unit tests, Makefiles, ... stuff that related to testing only rm -rf %{buildroot}%{repositorydir}/common/actors/testactor diff --git a/packaging/other_specs/leapp-el7toel8-deps.spec b/packaging/other_specs/leapp-el7toel8-deps.spec index c4e0dd90b8..d9e94faa55 100644 --- a/packaging/other_specs/leapp-el7toel8-deps.spec +++ b/packaging/other_specs/leapp-el7toel8-deps.spec @@ -5,7 +5,11 @@ %if 0%{?rhel} == 8 %define lpr_name_src leapp-upgrade-el7toel8-deps %else - %define lpr_name_src leapp-upgrade-el8toel9-deps + %if 0%{?rhel} == 9 + %define lpr_name_src leapp-upgrade-el8toel9-deps + %else + %define lpr_name_src leapp-upgrade-el9toel10-deps + %endif %endif