2022-05-18 11:41:20 +00:00
%global leapp_datadir %{_datadir} /leapp-repository
%global repositorydir %{leapp_datadir} /repositories
%global custom_repositorydir %{leapp_datadir} /custom-repositories
2024-05-22 10:44:17 +00:00
%define leapp_repo_deps 10
2022-05-18 11:41:20 +00:00
%if 0%{?rhel} == 7
%define leapp_python_sitelib %{python2_sitelib}
%define lpr_name leapp-upgrade-el7toel8
2024-11-25 09:10:29 +00:00
%define repo_shortname el7toel8
%define next_major_ver 8
2022-05-18 11:41:20 +00:00
%else
%define leapp_python_sitelib %{python3_sitelib}
2024-11-25 09:10:29 +00:00
%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
2022-05-18 11:41:20 +00:00
# This drops autogenerated deps on
# - /usr/libexec/platform-python (rhel-8 buildroot)
# - /usr/bin/python3.x (epel-8 buildroot)
# - python(abi) = 3.x
# Each of these lead into the removal of leapp rpms as python is changed between
# major versions of RHEL
%global __requires_exclude ^python\\(abi\\) = 3\\..+|/usr/libexec/platform-python|/usr/bin/python.*
%endif
# TODO: not sure whether it's required nowadays. Let's check it and drop
# the whole block if not.
%if 0%{?rhel} == 7
# Defining py_byte_compile macro because it is not defined in old rpm (el7)
# Only defined to python2 since python3 is not used in RHEL7
%{!?py_byte_compile: %global py_byte_compile py2_byte_compile() {\
python_binary=" % 1 " \
bytecode_compilation_path=" % 2 " \
find $bytecode_compilation_path -type f -a -name " * . p y " -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\
find $bytecode_compilation_path -type f -a -name " * . p y " -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\
}\
py2_byte_compile " % 1 " " % 2 " }
%endif
# We keeps the leapp-repository name for the component, however we do not plan
# to create such an rpm. Instead, we are going to introduce new naming for
# RHEL 8+ packages to be consistent with other leapp projects in future.
Name : leapp-repository
2024-11-25 09:10:29 +00:00
Version : 0.21.0
Release : 4%{?dist}
2022-05-18 11:41:20 +00:00
Summary : Repositories for leapp
License : ASL 2.0
URL : https://oamg.github.io/leapp/
2022-11-08 06:44:12 +00:00
Source0 : https://github.com/oamg/%{name} /archive/v%{version} .tar.gz#/%{name}-%{version}.tar.gz
2024-11-25 09:13:55 +00:00
Source1 : deps-pkgs-12.tar.gz
2022-11-08 06:44:12 +00:00
# NOTE: Our packages must be noarch. Do no drop this in any way.
2022-05-18 11:41:20 +00:00
BuildArch : noarch
### PATCHES HERE
# Patch0001: filename.patch
2024-11-25 09:10:29 +00:00
Patch0001 : 0001-rhui-alibaba-add-ARM-RHEL8-and-RHEL9-setup-entries-1.patch
Patch0002 : 0002-don-t-require-all-versions-to-be-defined-for-obsolet.patch
Patch0003 : 0003-Add-RHEL-10.0-prod-certs.patch
Patch0004 : 0004-properly-scope-try-except-when-loading-obsoleted-key.patch
Patch0005 : 0005-Update-references-from-master-branch-to-main.patch
Patch0006 : 0006-ReadOfKernelArgsError-fix-the-error.patch
Patch0007 : 0007-pylint-exclude-rule-too-many-positional-arguments-co.patch
Patch0008 : 0008-pam_userdb-migrate-backend-database.patch
Patch0009 : 0009-Replace-mirror.centos.org-with-vault.centos.org-Cent.patch
Patch0010 : 0010-kernelcmdlineconfig-Add-Report-to-produces-tuple.patch
Patch0011 : 0011-kernelcmdlineconfig-Use-args-from-first-entry-when-m.patch
Patch0012 : 0012-check_microarch-refactor-to-handle-possible-future-r.patch
Patch0013 : 0013-check_microarch-add-rhel10-requirements.patch
Patch0014 : 0014-Skip-checking-files-under-.-directory-hash-dir.patch
Patch0015 : 0015-lib-overlay-cap-the-max-size-of-disk-images.patch
Patch0016 : 0016-Raise-proper-error-when-ModelViolationError-occurs.patch
Patch0017 : 0017-InhibitWhenLuks-simplify-the-logic.patch
Patch0018 : 0018-StorageScanner-Add-parent-device-name-to-lsblk.patch
Patch0019 : 0019-LuksScanner-Add-LUKS-dump-scanner-and-models.patch
Patch0020 : 0020-InhibitWhenLuks-allow-upgrades-for-LUKS2-bound-to-Cl.patch
Patch0021 : 0021-Rename-inhibitwhenluks-actor-to-checkluks.patch
Patch0022 : 0022-Fix-IPU-being-blocked-by-resource-limitations.patch
Patch0023 : 0023-feature-add-possibility-to-use-net.naming-scheme.patch
Patch0024 : 0024-prevent-the-feature-for-being-used-outside-8-9.patch
Patch0025 : 0025-fix-condition-on-when-net-naming-is-emitted.patch
Patch0026 : 0026-scangrubdevpartitionlayout-Skip-warning-msgs.patch
Patch0027 : 0027-Workaround-for-ARM-Upgrades-from-RHEL8-to-RHEL9.5.patch
Patch0028 : 0028-Add-el9toel10-actor-to-handle-symlink-directory-with.patch
Patch0029 : 0029-Expand-on-the-actor-docstring-for-the-el8-el9-rubyge.patch
Patch0030 : 0030-data-update-data-files.patch
Patch0031 : 0031-Packaging-Require-leapp-framework-6.x-update-leapp-d.patch
Patch0032 : 0032-spec-create-etc-leapp-actor_conf.d.patch
Patch0033 : 0033-spec-drop-.gitkeep-files-from-the-RPM.patch
Patch0034 : 0034-cli-load-actor-configuration.patch
Patch0035 : 0035-configs-common-introduce-RHUI-configuration.patch
Patch0036 : 0036-check_rhui-read-RHUI-configuration.patch
Patch0037 : 0037-testutils-add-support-for-configs.patch
Patch0038 : 0038-userspacegen-rhui-remove-repofiles-only-if-now-owned.patch
Patch0039 : 0039-Enable-IPU-for-EL-9.6-and-drop-EL-8.8-9.2.patch
Patch0040 : 0040-spec-drop-the-etc-leapp-actor_confid.d-dir.patch
2022-11-08 06:44:12 +00:00
2022-05-18 11:41:20 +00:00
%description
%{summary}
# This is the real RPM with the leapp repositories content
%package -n %{lpr_name}
Summary : Leapp repositories for the in-place upgrade
%if 0%{?rhel} == 7
######### RHEL 7 ############
BuildRequires : python-devel
Requires : python2-leapp
# We should not drop this on RHEL 7 because of the compatibility reasons
Obsoletes : leapp-repository-data <= 0.6.1
Provides : leapp-repository-data <= 0.6.1
2022-11-08 06:44:12 +00:00
# Former leapp subpackage that is part of the sos package since RHEL 7.8
2022-05-18 11:41:20 +00:00
Obsoletes : leapp-repository-sos-plugin <= 0.10.0
# Set the conflict to be sure this RPM is not upgraded automatically to
# the one from the target (upgraded) RHEL. The RPM has to stay untouched
# during the whole IPU process.
# The manual removal of the RPM is required after the IPU
Conflicts : leapp-upgrade-el8toel9
%else
2024-11-25 09:10:29 +00:00
######### RHEL 8+ (and newer) ############
2022-05-18 11:41:20 +00:00
BuildRequires : python3-devel
Requires : python3-leapp
2024-11-25 09:10:29 +00:00
# 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 ############
2022-05-18 11:41:20 +00:00
# Same as the conflict above - we want to be sure our packages are untouched
# during the whole IPU process
Conflicts : leapp-upgrade-el7toel8
2024-11-25 09:10:29 +00:00
Conflicts : leapp-upgrade-el9toel10
%else
######### RHEL 9 ############
Conflicts : leapp-upgrade-el8toel9
%endif
2022-05-18 11:41:20 +00:00
%endif
2023-05-16 06:08:34 +00:00
# IMPORTANT: every time the requirements are changed, increment number by one
2022-05-18 11:41:20 +00:00
# - same for Provides in deps subpackage
Requires : leapp-repository-dependencies = %{leapp_repo_deps}
# IMPORTANT: this is capability provided by the leapp framework rpm.
# Check that 'version' instead of the real framework rpm version.
2024-11-25 09:10:29 +00:00
Requires : leapp-framework >= 6.0
2022-05-18 11:41:20 +00:00
# Since we provide sub-commands for the leapp utility, we expect the leapp
# tool to be installed as well.
Requires : leapp
2023-05-16 06:08:34 +00:00
# Used to determine RHEL version of a given target RHEL installation image -
# uncompressing redhat-release package from the ISO.
Requires : cpio
2022-05-18 11:41:20 +00:00
# The leapp-repository rpm is renamed to %%{lpr_name}
Obsoletes : leapp-repository < 0.14.0-5
Provides : leapp-repository = %{version} -%{release}
# Provide "leapp-upgrade" for the user convenience. Users will be pointed
# to install "leapp-upgrade" in the official docs.
Provides : leapp-upgrade = %{version} -%{release}
2022-11-08 06:44:12 +00:00
# Provide leapp-commands so the framework could refer to them when customers
# do not have installed particular leapp-repositories
Provides : leapp-command(answer)
Provides : leapp-command(preupgrade)
Provides : leapp-command(upgrade)
Provides : leapp-command(rerun)
Provides : leapp-command(list-runs)
2022-05-18 11:41:20 +00:00
%description -n %{lpr_name}
Leapp repositories for the in-place upgrade to the next major version
of the Red Hat Enterprise Linux system.
2023-05-16 06:08:34 +00:00
# This metapackage should contain all RPM dependencies excluding deps on *leapp*
2022-05-18 11:41:20 +00:00
# RPMs. This metapackage will be automatically replaced during the upgrade
# to satisfy dependencies with RPMs from target system.
%package -n %{lpr_name}-deps
Summary : Meta-package with system dependencies of %{lpr_name} package
# The package has been renamed, so let's obsoletes the old one
Obsoletes : leapp-repository-deps < 0.14.0-5
2023-05-16 06:08:34 +00:00
# IMPORTANT: every time the requirements are changed, increment number by one
2022-05-18 11:41:20 +00:00
# - same for Requires in main package
Provides : leapp-repository-dependencies = %{leapp_repo_deps}
##################################################
# Real requirements for the leapp-repository HERE
##################################################
Requires : dnf >= 4
Requires : pciutils
2024-05-22 10:44:17 +00:00
# required to be able to format disk images with XFS file systems (default)
Requires : xfsprogs
# required to be able to format disk images with Ext4 file systems
# NOTE: this is not happening by default, but we can expact that many customers
# will want to / need to do this - especially on RHEL 7 now. Adding this deps
# as the best trade-off to resolve this problem.
Requires : e2fsprogs
2022-05-18 11:41:20 +00:00
%if 0%{?rhel} && 0%{?rhel} == 7
# Required to gather system facts about SELinux
Requires : libselinux-python
Requires : python-pyudev
# required by SELinux actors
Requires : policycoreutils-python
# Required to fetch leapp data
Requires : python-requests
%else
############# RHEL 8 dependencies (when the source system is RHEL 8) ##########
# systemd-nspawn utility
Requires : systemd-container
Requires : python3-pyudev
# Required to fetch leapp data
Requires : python3-requests
# Required because the code is kept Py2 & Py3 compatible
Requires : python3-six
# required by SELinux actors
Requires : policycoreutils-python-utils
2022-11-08 06:44:12 +00:00
# required by systemfacts, and several other actors
Requires : procps-ng
Requires : kmod
# since RHEL 8+ dracut does not have to be present on the system all the time
# and missing dracut could be killing situation for us :)
Requires : dracut
2023-05-16 06:08:34 +00:00
# Required to scan NetworkManagerConnection (e.g. to recognize secrets)
# NM is requested to be used on RHEL 8+ systems
Requires : NetworkManager-libnm
Requires : python3-gobject-base
2024-11-25 09:10:29 +00:00
%endif
%if 0%{?rhel} && 0%{?rhel} == 9
############# RHEL 9 dependencies (when the source system is RHEL 9) ##########
# Required to convert pam_userdb database from BerkeleyDB to GDBM
Requires : libdb-utils
2022-05-18 11:41:20 +00:00
%endif
##################################################
# end requirement
##################################################
%description -n %{lpr_name}-deps
%{summary}
%prep
%setup -n %{name} -%{version}
%setup -q -n %{name} -%{version} -D -T -a 1
# APPLY PATCHES HERE
2024-11-25 09:10:29 +00:00
# %%patch -P 0001 -p1
%patch -P 0001 -p1
%patch -P 0002 -p1
%patch -P 0003 -p1
%patch -P 0004 -p1
%patch -P 0005 -p1
%patch -P 0006 -p1
%patch -P 0007 -p1
%patch -P 0008 -p1
%patch -P 0009 -p1
%patch -P 0010 -p1
%patch -P 0011 -p1
%patch -P 0012 -p1
%patch -P 0013 -p1
%patch -P 0014 -p1
%patch -P 0015 -p1
%patch -P 0016 -p1
%patch -P 0017 -p1
%patch -P 0018 -p1
%patch -P 0019 -p1
%patch -P 0020 -p1
%patch -P 0021 -p1
%patch -P 0022 -p1
%patch -P 0023 -p1
%patch -P 0024 -p1
%patch -P 0025 -p1
%patch -P 0026 -p1
%patch -P 0027 -p1
%patch -P 0028 -p1
%patch -P 0029 -p1
%patch -P 0030 -p1
%patch -P 0031 -p1
%patch -P 0032 -p1
%patch -P 0033 -p1
%patch -P 0034 -p1
%patch -P 0035 -p1
%patch -P 0036 -p1
%patch -P 0037 -p1
%patch -P 0038 -p1
%patch -P 0039 -p1
%patch -P 0040 -p1
2022-05-18 11:41:20 +00:00
%build
2024-11-25 09:10:29 +00:00
cp -a leapp*deps*el%{next_major_ver} .noarch.rpm repos/system_upgrade/%{repo_shortname} /files/bundled-rpms/
2022-05-18 11:41:20 +00:00
%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/
2024-11-25 09:10:29 +00:00
# NOTE(pstodulk): drop transaction dir and its content if replaced by config files before RHEL 10
2022-05-18 11:41:20 +00:00
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
2024-01-10 17:19:25 +00:00
install -m 0644 etc/leapp/files/* %{buildroot} %{_sysconfdir} /leapp/files
2022-05-18 11:41:20 +00:00
2024-11-25 09:10:29 +00:00
# uncomment to install existing configs if any exists
#install -m 0644 etc/leapp/actor_conf.d/* %%{buildroot}%%{_sysconfdir}/leapp/actor_conf.d
2022-05-18 11:41:20 +00:00
# install CLI commands for the leapp utility on the expected path
install -m 0755 -d %{buildroot} %{leapp_python_sitelib} /leapp/cli/
cp -r commands %{buildroot} %{leapp_python_sitelib} /leapp/cli/
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
2024-11-25 09:10:29 +00:00
for i in el7toel8 el8toel9 el9toel10;
do
[ " $ i " != " %{repo_shortname} " ] && rm -rf %{buildroot} %{repositorydir} /system_upgrade/$i
done
2022-05-18 11:41:20 +00:00
# remove component/unit tests, Makefiles, ... stuff that related to testing only
rm -rf %{buildroot} %{repositorydir} /common/actors/testactor
find %{buildroot} %{repositorydir} /common -name " t e s t . p y " -delete
rm -rf `find %{buildroot} %{repositorydir} -name " t e s t s " -type d`
find %{buildroot} %{repositorydir} -name " M a k e f i l e " -delete
2023-05-16 06:08:34 +00:00
find %{buildroot} -name " * . p y . o r i g " -delete
2024-11-25 09:10:29 +00:00
# .gitkeep file is used to have a directory in the repo. but we do not want these
# files in the resulting RPM
find %{buildroot} -name .gitkeep -delete
2022-05-18 11:41:20 +00:00
for DIRECTORY in $(find %{buildroot} %{repositorydir} / -mindepth 1 -maxdepth 1 -type d);
do
REPOSITORY=$(basename $DIRECTORY)
echo " E n a b l i n g r e p o s i t o r y $ R E P O S I T O R Y "
ln -s %{repositorydir} /$REPOSITORY %{buildroot} %{_sysconfdir} /leapp/repos.d/$REPOSITORY
done;
# __python2 could be problematic on systems with Python3 only, but we have
# no choice as __python became error on F33+:
# https://fedoraproject.org/wiki/Changes/PythonMacroError
%if 0%{?rhel} == 7
%py_byte_compile %{__python 2} %{buildroot} %{repositorydir} /*
%else
%py_byte_compile %{__python 3} %{buildroot} %{repositorydir} /*
%endif
%files -n %{lpr_name}
%doc README.md
%license LICENSE
%dir %{_sysconfdir} /leapp/transaction
%dir %{_sysconfdir} /leapp/files
%dir %{leapp_datadir}
%dir %{repositorydir}
%dir %{custom_repositorydir}
%dir %{leapp_python_sitelib} /leapp/cli/commands
2024-01-10 17:19:25 +00:00
%config %{_sysconfdir} /leapp/files/*
2024-11-25 09:10:29 +00:00
# uncomment to package installed configs
#%%config %%{_sysconfdir}/leapp/actor_conf.d/*
2022-05-18 11:41:20 +00:00
%{_sysconfdir} /leapp/repos.d/*
%{_sysconfdir} /leapp/transaction/*
%{repositorydir} /*
%{leapp_python_sitelib} /leapp/cli/commands/*
%files -n %{lpr_name}-deps
# no files here
%changelog
2024-11-25 09:13:55 +00:00
* Mon Nov 18 2024 Matej Matuska <mmatuska@redhat.com> - 0.21.0-4
2024-11-25 09:10:29 +00:00
- Require leapp-framework 6.0+
- Update leapp-deps package to satisfy leapp-framework-dependencies 6
2024-11-25 09:13:55 +00:00
- Add dependency on libdb-utils
2024-11-25 09:10:29 +00:00
- Enable upgrade for systems with LUKS bound to Clevis with TPM 2.0 token
- Adjust resource limitations for leapp to be able to perform the upgrade
2024-11-25 09:13:55 +00:00
- Cap max size of the sparse files to 1TiB for storage with large amount of free space
- Check that detected Intel CPU microarchitecture is supported on target system
2024-11-25 09:10:29 +00:00
- Fix the report when handling broken parsing of kernel cmdline
- Generate proper error message instead of ModelViolationError when parsing invalid repository definition
- Handle default kernel cmdline when multiple boot entries for the default kernel are defined
2024-11-25 09:13:55 +00:00
- Migrate Ruby IRB during the upgrade
- Migrate pam_userdb backend during the upgrade
2024-11-25 09:10:29 +00:00
- Skip checking of (PKI) `directory-hash` dir to speedup the upgrade process and clean logs
- Update leapp upgrade data files
2024-11-25 09:13:55 +00:00
- Resolves: RHEL-57043
2024-11-25 09:10:29 +00:00
2024-11-25 09:13:55 +00:00
* Thu Sep 19 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-3
- Rebuild to apply changes for gating
- Resolves: RHEL-57043
2022-05-18 11:41:20 +00:00
2024-11-25 09:13:55 +00:00
* Mon Aug 19 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-2
- Initial build for EL 9
- Resolves: RHEL-57043