Skip to content

Commit

Permalink
Packaging: Introduce EL 9 builds for IPU 9 -> 10
Browse files Browse the repository at this point in the history
SPEC files has been updated and polished to be more friendly when
keeping suppoer for building in EL 7, 8, and 9. Also Makefile
contains some initial changes But keeping the full solution for a
separate commit.

Packit configuration has been updated to start building for
epel-9-x86_64 buildroot.
  • Loading branch information
pirat89 authored and Rezney committed Jul 18, 2024
1 parent dafa617 commit 8701243
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand All @@ -54,6 +55,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand All @@ -73,6 +75,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ source: prepare
@git archive --prefix "$(PKGNAME)-$(VERSION)/" -o "packaging/sources/$(PKGNAME)-$(VERSION).tar.gz" HEAD
@echo "--- PREPARE DEPS PKGS ---"
mkdir -p packaging/tmp/
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=$$(($(DIST_VERSION) + 1)) _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=7 _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=8 _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=9 _build_subpkg
@tar -czf packaging/sources/deps-pkgs.tar.gz -C packaging/RPMS/noarch `ls -1 packaging/RPMS/noarch | grep -o "[^/]*rpm$$"`
@rm -f packaging/RPMS/noarch/*.rpm
Expand Down Expand Up @@ -389,11 +390,14 @@ _test_container_ipu:
el8toel9) \
export REPOSITORIES="common,el8toel9"; \
;; \
el9toel10) \
export REPOSITORIES="common,el9toel10"; \
;; \
"") \
echo "TEST_CONT_IPU must be set"; exit 1; \
;; \
*) \
echo "Only supported TEST_CONT_IPUs are el7toel8, el8toel9"; exit 1; \
echo "Only supported TEST_CONT_IPUs are el7toel8, el8toel9, el9toel10"; exit 1; \
;; \
esac && \
$(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME make clean && \
Expand Down Expand Up @@ -449,6 +453,10 @@ test_container:
;; \
python3.9) \
TEST_CONT_IPU=el8toel9 $(MAKE) _test_container_ipu; \
TEST_CONT_IPU=el9toel10 $(MAKE) _test_container_ipu; \
;; \
python3.12) \
TEST_CONT_IPU=el9toel10 $(MAKE) _test_container_ipu; \
;; \
*) \
TEST_CONT_IPU=el8toel9 $(MAKE) _test_container_ipu; \
Expand Down
42 changes: 29 additions & 13 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,24 @@ Obsoletes: leapp-repository-sos-plugin <= 0.9.0
Conflicts: leapp-upgrade-el8toel9

%else
######### RHEL 8 ############
######### RHEL 8+ (and newer) ############
BuildRequires: python3-devel
Requires: python3-leapp

# 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 ############

# 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 +230,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 +251,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 8701243

Please sign in to comment.