From c8e8bffd99e6baf5c7dcf4612e1990fc444eefe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Fri, 31 May 2024 11:07:30 +0200 Subject: [PATCH] SPEC: take c10s and el10 into consideration for repo installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the SPEC file was written in the way that c9s and el9 were the latest major releases of the respective distributions and as such, they could build images for all previous major versions of the same distro. With c10s and el10, this is no longer true. Amend the section which installs repository definitions. The idea is that: - c10s / el10 are the latest major version and can build any previous major version of the same distro. - Any cs and el distro version can build images for the same major version. - c9s can build also c8s / el9 can build also el8 images. Signed-off-by: Tomáš Hozza --- osbuild-composer.spec | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/osbuild-composer.spec b/osbuild-composer.spec index e3a968dce..6055bad77 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -147,28 +147,43 @@ install -m 0755 -vp _bin/osbuild-jobsite-builder %{buildroot}% # Only include repositories for the distribution and release install -m 0755 -vd %{buildroot}%{_datadir}/osbuild-composer/repositories + # CentOS also defines rhel so we check for centos first %if 0%{?centos} -# CentOS 9 supports building for CentOS 8 and later -%if 0%{?centos} >= 9 +# Latest CentOS supports building all CentOS versions +%if 0%{?centos} >= 10 install -m 0644 -vp repositories/centos-* %{buildroot}%{_datadir}/osbuild-composer/repositories/ + %else -# CentOS 8 only supports building for CentOS 8 +# All other CentOS versions support building for the same version install -m 0644 -vp repositories/centos-%{centos}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ install -m 0644 -vp repositories/centos-stream-%{centos}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +# CentOS 9 supports building also for CentOS 8 +%if 0%{?centos} == 9 +install -m 0644 -vp repositories/centos-8* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +install -m 0644 -vp repositories/centos-stream-8* %{buildroot}%{_datadir}/osbuild-composer/repositories/ %endif + +%endif + %else + %if 0%{?rhel} -# RHEL 9 supports building for RHEL 8 and later -%if 0%{?rhel} >= 9 +# RHEL 10 supports building all RHEL versions +%if 0%{?rhel} >= 10 install -m 0644 -vp repositories/rhel-* %{buildroot}%{_datadir}/osbuild-composer/repositories/ %else -# RHEL 8 only supports building for 8 +# All other RHEL versions support building for the same version install -m 0644 -vp repositories/rhel-%{rhel}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +# RHEL 9 supports building also for RHEL 8 +%if 0%{?rhel} == 9 +install -m 0644 -vp repositories/rhel-8* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +%endif + %endif %endif %endif