Skip to content

Commit

Permalink
Packaging: Introduce builds for EL 9 for IPU 9 -> 10
Browse files Browse the repository at this point in the history
TODO:
  - update commit msg
  - still incomplete - update Makefile
  • Loading branch information
pirat89 committed Apr 2, 2024
1 parent a85f52f commit 8a52b26
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
38 changes: 26 additions & 12 deletions packaging/leapp-repository.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -84,14 +94,22 @@ 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

# 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
Expand Down Expand Up @@ -210,18 +228,15 @@ 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
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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion packaging/other_specs/leapp-el7toel8-deps.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 8a52b26

Please sign in to comment.