diff --git a/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch b/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch new file mode 100644 index 0000000..6e70551 --- /dev/null +++ b/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch @@ -0,0 +1,33 @@ +From 7a80a6eec799841b828ba7f617709562d8061435 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 21 Oct 2024 11:55:53 +0100 +Subject: [PATCH] prepare: Use stable owner, group and mtime in base.tar.gz + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025 +Signed-off-by: Richard W.M. Jones +--- + src/mode_prepare.ml | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/mode_prepare.ml b/src/mode_prepare.ml +index 70f9dd4..6af47b1 100644 +--- a/src/mode_prepare.ml ++++ b/src/mode_prepare.ml +@@ -166,9 +166,12 @@ let prepare debug (copy_kernel, format, host_cpu, + let base = outputdir // "base.tar.gz" in + if debug >= 1 then printf "supermin: writing %s\n%!" base; + let cmd = +- sprintf "tar%s -C %s -zcf %s -T %s" ++ let mtime = ++ try sprintf "--mtime=@%s" (quote (Sys.getenv "SOURCE_DATE_EPOCH")) ++ with Not_found -> "" in ++ sprintf "tar%s -C %s -z --owner=0 --group=0 %s -cf %s -T %s" + (if debug >=1 then " -v" else "") +- (quote dir) (quote base) (quote files_from) in ++ (quote dir) mtime (quote base) (quote files_from) in + run_command cmd; + ) + else ( +-- +2.46.0 + diff --git a/0001-rpm-extend-the-Multiple_matches-exception.patch b/0001-rpm-extend-the-Multiple_matches-exception.patch deleted file mode 100644 index 30a69bb..0000000 --- a/0001-rpm-extend-the-Multiple_matches-exception.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 42955541dc3aa8ae3361f3bd6eb0ae338f307545 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Wed, 23 Jan 2019 12:22:19 +0100 -Subject: [PATCH 1/2] rpm: extend the Multiple_matches exception - -Add the package that raised the issue, so it can be used to provide -better diagnostic. ---- - src/librpm-c.c | 15 ++++++++++----- - src/librpm.ml | 4 ++-- - src/librpm.mli | 2 +- - 3 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/src/librpm-c.c b/src/librpm-c.c -index 3bd25a2..75ca4d7 100644 ---- a/src/librpm-c.c -+++ b/src/librpm-c.c -@@ -66,10 +66,15 @@ librpm_handle_closed (void) - } - - static void --librpm_raise_multiple_matches (int occurrences) -+librpm_raise_multiple_matches (value pkgv, int occurrences) - { -- caml_raise_with_arg (*caml_named_value ("librpm_multiple_matches"), -- Val_int (occurrences)); -+ CAMLparam1 (pkgv); -+ -+ value args[] = { pkgv, Val_int (occurrences) }; -+ caml_raise_with_args (*caml_named_value ("librpm_multiple_matches"), -+ 2, args); -+ -+ CAMLnoreturn; - } - - #define Librpm_val(v) (*((struct librpm_data *)Data_custom_val(v))) -@@ -296,7 +301,7 @@ supermin_rpm_pkg_requires (value rpmv, value pkgv) - fflush (stdout); - } - if (count != 1) -- librpm_raise_multiple_matches (count); -+ librpm_raise_multiple_matches (pkgv, count); - - h = rpmdbNextIterator (iter); - assert (h != NULL); -@@ -413,7 +418,7 @@ supermin_rpm_pkg_filelist (value rpmv, value pkgv) - fflush (stdout); - } - if (count != 1) -- librpm_raise_multiple_matches (count); -+ librpm_raise_multiple_matches (pkgv, count); - - h = rpmdbNextIterator (iter); - assert (h != NULL); -diff --git a/src/librpm.ml b/src/librpm.ml -index 4eeba77..b6f9ff8 100644 ---- a/src/librpm.ml -+++ b/src/librpm.ml -@@ -23,7 +23,7 @@ external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" - - type t - --exception Multiple_matches of int -+exception Multiple_matches of string * int - - external rpm_open : ?debug:int -> t = "supermin_rpm_open" - external rpm_close : t -> unit = "supermin_rpm_close" -@@ -49,4 +49,4 @@ external rpm_pkg_whatprovides : t -> string -> string array = "supermin_rpm_pkg_ - external rpm_pkg_filelist : t -> string -> rpmfile_t array = "supermin_rpm_pkg_filelist" - - let () = -- Callback.register_exception "librpm_multiple_matches" (Multiple_matches 0) -+ Callback.register_exception "librpm_multiple_matches" (Multiple_matches ("", 0)) -diff --git a/src/librpm.mli b/src/librpm.mli -index 5229be6..53b4b2c 100644 ---- a/src/librpm.mli -+++ b/src/librpm.mli -@@ -31,7 +31,7 @@ val rpm_vercmp : string -> string -> int - type t - (** The librpm handle. *) - --exception Multiple_matches of int -+exception Multiple_matches of string * int - - val rpm_open : ?debug:int -> t - (** Open the librpm (transaction set) handle. *) --- -2.20.1 - diff --git a/0002-Print-Librpm.Multiple_matches-exceptions.patch b/0002-Print-Librpm.Multiple_matches-exceptions.patch deleted file mode 100644 index f13620b..0000000 --- a/0002-Print-Librpm.Multiple_matches-exceptions.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 36878992ebdd08f0f9b37017f347f5eab18ce9ed Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Wed, 23 Jan 2019 12:23:02 +0100 -Subject: [PATCH 2/2] Print Librpm.Multiple_matches exceptions - -Print a better diagnostic for them, so it is more clear which package -is detected as present multiple times. ---- - src/supermin.ml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/supermin.ml b/src/supermin.ml -index f9798f9..71d8b64 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -298,6 +298,8 @@ let () = - error "error: %s: %s: %s" fname (Unix.error_message code) param - | Failure msg -> (* from failwith/failwithf *) - error "failure: %s" msg -+ | Librpm.Multiple_matches (package, count) -> (* from librpm *) -+ error "RPM error: %d occurrences for %s" count package - | Invalid_argument msg -> (* probably should never happen *) - error "internal error: invalid argument: %s" msg - | Assert_failure (file, line, char) -> (* should never happen *) --- -2.20.1 - diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..9234236 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: xen-ci.brew-build.tier1.functional} diff --git a/sources b/sources index d77c08a..cc31e54 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.1.20.tar.gz) = ccc9ada98593f91399b323f0beb027185874f82547a1df4274c1206a9b6d4465e98b7aef5618274d41fb902747f6843fd2cc6192a4ea8526811261ac5a16848e -SHA512 (supermin-5.1.20.tar.gz.sig) = e7c46fdf4105ffa3f6e02d6ed0b895a9af71470f5c650d129304187b977516343d17a861a9c53934eee559de374623f100f4736426de37ee78d5f5bc82d56096 +SHA512 (supermin-5.3.5.tar.gz) = e410bafe06805880f0f701e78d743a6e22e9d25e57bd70a020d583dba6d710ba9917d7afc37be714d9bde410c7ff35f4198300b3af0858d761b0b3e07af58dc0 +SHA512 (supermin-5.3.5.tar.gz.sig) = 88f446c3855367dd8917a6eb44d926f8a09dac9913d9098757951ccb3300f9e3544689a45d661382ae24221f8558bbfc188976f4db288829c28379b87949ed7e diff --git a/supermin.spec b/supermin.spec index 5d6a39c..ee09a0f 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,60 +1,76 @@ -%ifnarch %{ocaml_native_compiler} -%global __strip /bin/true -%global debug_package %{nil} -%endif +# OCaml packages not built on i686 since OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} -# On architectures that support it, the default is ``--with dietlibc''. +# On platforms and architectures that support it, the default is +# ‘--with dietlibc’. # -# To use glibc-static instead, do ``--without dietlibc''. This -# results in a much larger (about 40 times larger) init binary. +# To use glibc-static instead, do ‘--without dietlibc’. This results +# in a much larger (about 40 times larger) init binary. # # On other platforms, there is no dietlibc, so the default for those -# is ``--without dietlibc''. +# is ‘--without dietlibc’. # # See also: # https://github.com/libguestfs/supermin/commit/9bb57e1a8d0f3b57eb09f65dd574f702b67e1c2f +%if 0%{?rhel} +%bcond_with dietlibc +%else %ifarch aarch64 %{arm} %{ix86} %{power} s390x x86_64 %bcond_without dietlibc %else %bcond_with dietlibc %endif +%endif + +%if 0%{?fedora} > 40 || 0%{?rhel} > 10 +%bcond_without dnf5 +%else +%bcond_with dnf5 +%endif # Whether we should verify tarball signature with GPGv2. %global verify_tarball_signature 1 +# The source directory. +%global source_directory 5.3-development + Summary: Tool for creating supermin appliances Name: supermin -Version: 5.1.20 -Release: 2%{?dist} -License: GPLv2+ +Version: 5.3.5 +Release: 7%{?dist} +License: GPL-2.0-or-later -%if 0%{?rhel} >= 7 -ExclusiveArch: x86_64 +ExclusiveArch: %{kernel_arches} +%if 0%{?rhel} +# No qemu-kvm on POWER (RHBZ#1946532). +ExcludeArch: %{power64} %endif URL: http://people.redhat.com/~rjones/supermin/ -Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz -%if 0%{verify_tarball_signature} -Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz.sig -%endif - +Source0: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz +Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz.sig # Keyring used to verify tarball signature. -%if 0%{verify_tarball_signature} Source2: libguestfs.keyring -%endif -# Upstream patches to diagnose possible F29 issue: -# https://www.redhat.com/archives/libguestfs/2019-January/thread.html#00168 -Patch1: 0001-rpm-extend-the-Multiple_matches-exception.patch -Patch2: 0002-Print-Librpm.Multiple_matches-exceptions.patch +# Use stable owner, group and mtime in base.tar.gz +# Upstream in > 5.3.5 +# https://bugzilla.redhat.com/show_bug.cgi?id=2320025 +Patch1: 0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch +BuildRequires: gcc +BuildRequires: make +BuildRequires: autoconf, automake BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm BuildRequires: rpm-devel +%if %{with dnf5} +BuildRequires: dnf5 +%else BuildRequires: dnf BuildRequires: dnf-plugins-core +%endif BuildRequires: /usr/sbin/mke2fs BuildRequires: e2fsprogs-devel BuildRequires: findutils @@ -72,6 +88,14 @@ BuildRequires: gnupg2 # tests to not require these packages. BuildRequires: augeas hivex kernel tar +%if 0%{?rhel} +%ifarch s390x +# On RHEL 9 s390x, kernel incorrectly pulls in kernel-zfcpdump-core +# https://bugzilla.redhat.com/show_bug.cgi?id=2027654 +BuildRequires: kernel-core +%endif +%endif + # For complicated reasons, this is required so that # /bin/kernel-install puts the kernel directly into /boot, instead of # into a /boot/ subdirectory (in Fedora >= 23). Read the @@ -80,19 +104,19 @@ BuildRequires: grubby # https://bugzilla.redhat.com/show_bug.cgi?id=1331012 BuildRequires: systemd-udev +# This only includes the dependencies needed at runtime, ie. supermin +# --build. For supermin --prepare, dependencies like dnf are placed +# in the -devel subpackage. Requires: rpm -Requires: dnf -Requires: dnf-plugins-core Requires: util-linux-ng Requires: cpio Requires: tar Requires: /usr/sbin/mke2fs # RHBZ#771310 Requires: e2fsprogs-libs >= 1.42 -Requires: findutils # For automatic RPM dependency generation. -# See: http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator +# See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html Source3: supermin.attr Source4: supermin-find-requires @@ -103,31 +127,48 @@ appliances (similar to virtual machines), usually around 100KB in size, which get fully instantiated on-the-fly in a fraction of a second when you need to boot one of them. +Note that if you want to run 'supermin --prepare' you will need the +extra dependencies provided by %{name}-devel. + %package devel Summary: Development tools for %{name} Requires: %{name} = %{version}-%{release} Requires: rpm-build +# Dependencies needed for supermin --prepare +%if %{with dnf5} +Requires: dnf5 +%else +Requires: dnf +Requires: dnf-plugins-core +%endif +Requires: findutils + %description devel %{name}-devel contains development tools for %{name}. -It just contains tools for automatic RPM dependency generation -from supermin appliances. +It contains extra dependencies needed for 'supermin --prepare' to +work, as well as tools for automatic RPM dependency generation from +supermin appliances. %prep %if 0%{verify_tarball_signature} -tmphome="$(mktemp -d)" -gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0} +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %endif %setup -q %autopatch -p1 %build -%configure --disable-network-tests +autoreconf -fi +# Setting DNF is temporarily required for Rawhide. We should be able +# to remove this later. See: +# https://bugzilla.redhat.com/show_bug.cgi?id=2209412 +# https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5 +%configure %{?with_dnf5:DNF=%{_bindir}/dnf5} --disable-network-tests %if %{with dietlibc} make -C init CC="diet gcc" @@ -170,6 +211,191 @@ make check || { %changelog +* Mon Oct 13 2025 Richard W.M. Jones - 5.3.5-7 +- OCaml 5.4.0 rebuild + +* Fri Jul 25 2025 Fedora Release Engineering - 5.3.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jul 11 2025 Jerry James - 5.3.5-5 +- Rebuild to fix OCaml dependencies + +* Sun Jan 19 2025 Fedora Release Engineering - 5.3.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jan 9 2025 Jerry James - 5.3.5-3 +- OCaml 5.3.0 rebuild for Fedora 42 + +* Mon Oct 21 2024 Richard W.M. Jones - 5.3.5-2 +- Use stable owner, group and mtime in base.tar.gz (RHBZ#2320025) + +* Sat Aug 31 2024 Richard W.M. Jones - 5.3.5-1 +- New upstream version 5.3.5 + +* Sat Jul 20 2024 Fedora Release Engineering - 5.3.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jun 19 2024 Richard W.M. Jones - 5.3.4-4 +- OCaml 5.2.0 ppc64le fix + +* Wed May 29 2024 Richard W.M. Jones - 5.3.4-3 +- OCaml 5.2.0 for Fedora 41 + +* Sat Jan 27 2024 Fedora Release Engineering - 5.3.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 11 2024 Richard W.M. Jones - 5.3.4-1 +- New upstream version 5.3.4 +- Remove patches which are now all upstream. + +* Mon Dec 18 2023 Richard W.M. Jones - 5.3.3-19 +- OCaml 5.1.1 + s390x code gen fix for Fedora 40 + +* Tue Dec 12 2023 Richard W.M. Jones - 5.3.3-18 +- OCaml 5.1.1 rebuild for Fedora 40 + +* Fri Nov 10 2023 Richard W.M. Jones - 5.3.3-17 +- Fix RISC-V gzip compressed kernels + +* Thu Oct 05 2023 Richard W.M. Jones - 5.3.3-16 +- OCaml 5.1 rebuild for Fedora 40 + +* Wed Aug 02 2023 Yaakov Selkowitz - 5.3.3-15 +- Defer dnf5 until Fedora 41 + +* Sat Jul 22 2023 Fedora Release Engineering - 5.3.3-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jul 12 2023 Richard W.M. Jones - 5.3.3-13 +- OCaml 5.0 rebuild for Fedora 39 + +* Mon Jul 10 2023 Jerry James - 5.3.3-10 +- OCaml 5.0.0 rebuild + +* Mon Jun 12 2023 Richard W.M. Jones - 5.3.3-9 +- Fix --if-newer + +* Mon Jun 05 2023 Richard W.M. Jones - 5.3.3-8 +- Migrated to SPDX license + +* Wed May 31 2023 Richard W.M. Jones - 5.3.3-7 +- Further fix for dnf5 (RHBZ#2211386) + +* Tue May 30 2023 Richard W.M. Jones - 5.3.3-6 +- Add support for dnf5 (RHBZ#2209412) + +* Fri May 19 2023 Richard W.M. Jones - 5.3.3-5 +- Rebuild against librpm 10 + +* Tue Jan 24 2023 Richard W.M. Jones - 5.3.3-4 +- Rebuild OCaml packages for F38 + +* Sat Jan 21 2023 Richard W.M. Jones - 5.3.3-3 +- Deal with new RPM database location +- https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr + +* Sat Jan 21 2023 Fedora Release Engineering - 5.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Oct 18 2022 Richard W.M. Jones - 5.3.3-1 +- New upstream development version 5.3.3 + +* Wed Sep 07 2022 Richard W.M. Jones - 5.3.2-5 +- Include all upstream patches since 5.3.2 +- Add debugging and accurate exception backtraces (RHBZ#2124571). + +* Sat Jul 23 2022 Fedora Release Engineering - 5.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jun 18 2022 Richard W.M. Jones - 5.3.2-3 +- OCaml 4.14.0 rebuild + +* Sun May 15 2022 Richard W.M. Jones - 5.3.2-2 +- Move dependency on dnf to -devel subpackage (RHBZ#2086302) + +* Fri Mar 04 2022 Richard W.M. Jones - 5.3.2-1 +- New upstream development version 5.3.2 + +* Fri Feb 04 2022 Richard W.M. Jones - 5.3.1-5 +- OCaml 4.13.1 rebuild to remove package notes + +* Sat Jan 22 2022 Fedora Release Engineering - 5.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Dec 01 2021 Richard W.M. Jones - 5.3.1-3 +- Further fix to ignore zfcpdump kernel on s390x + +* Tue Nov 30 2021 Richard W.M. Jones - 5.3.1-2 +- Ignore zfcpdump kernel on s390x + +* Thu Aug 26 2021 Richard W.M. Jones - 5.3.1-1 +- New upstream development version 5.3.1. + +* Fri Jul 23 2021 Fedora Release Engineering - 5.2.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 2 2021 Richard W.M. Jones - 5.2.1-3 +- Add gating tests (for RHEL 9) + +* Fri May 07 2021 Richard W.M. Jones - 5.2.1-2 +- Do not include the package on POWER on RHEL 9 + resolves: rhbz#1956934 + +* Mon Feb 01 2021 Richard W.M. Jones - 5.2.1-1 +- New upstream version 5.2.1. + +* Wed Jan 27 2021 Fedora Release Engineering - 5.2.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Jan 14 2021 Richard W.M. Jones - 5.2.0-6 +- Remove inactive strip override (see RHBZ#1915570). + +* Mon Nov 23 2020 Richard W.M. Jones - 5.2.0-5 +- Disable dietlibc on RHEL 9. + +* Fri Aug 07 2020 Troy Dawson - 5.2.0-4 +- Use ExclusiveArch: %{kernel_arches} + +* Wed Jul 29 2020 Fedora Release Engineering - 5.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Apr 03 2020 Richard W.M. Jones - 5.2.0-2 +- ppc64le: ibmvscsi driver missing from supermin appliance (RHBZ#1819019). + +* Tue Mar 10 2020 Richard W.M. Jones - 5.2.0-1 +- New upstream stable version 5.2.0. + +* Fri Jan 31 2020 Fedora Release Engineering - 5.1.20-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Dec 10 2019 Richard W.M. Jones - 5.1.20-11 +- Add further patch to fix symlinks (RHBZ#1770304). +- Add all patches since 5.1.20 was released. + +* Thu Nov 28 2019 Richard W.M. Jones - 5.1.20-10 +- Add upstream patch to fix symlinks on recent kernels (RHBZ#1770304). + +* Wed Nov 27 2019 Richard W.M. Jones - 5.1.20-9 +- Use gpgverify macro instead of explicit gpgv2 command. + +* Wed Jul 31 2019 Richard W.M. Jones - 5.1.20-8 +- OCaml 4.08.1 (rc2) rebuild. + +* Sat Jul 27 2019 Richard W.M. Jones - 5.1.20-7 +- Disable package on i686 because no kernel. + +* Sat Jul 27 2019 Fedora Release Engineering - 5.1.20-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko - 5.1.20-5 +- Rebuild for RPM 4.15 + +* Mon Jun 10 15:42:06 CET 2019 Igor Gnatenko - 5.1.20-4 +- Rebuild for RPM 4.15 + +* Sun Feb 03 2019 Fedora Release Engineering - 5.1.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Thu Jan 24 2019 Richard W.M. Jones - 5.1.20-2 - Add upstream patches to diagnose possible F29 issue.