summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-08-22 12:48:48 +0200
committerRemi Collet <remi@php.net>2023-08-22 12:48:48 +0200
commit376aaac49c32861178bffba63854799a0172255a (patch)
tree68f11738cdec5851f8157c6fd29bd8ab78c400ba
parent8dc7f007168c1e4580115dd94c8dcb36d215fed5 (diff)
add patch for RPM 4.19
to workaround https://bugzilla.redhat.com/2233454
-rw-r--r--.gitignore9
-rw-r--r--0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch31
-rw-r--r--BZ-2056462-do-not-error-out-on-SIGINT.patch61
-rw-r--r--BZ-2091000-remove-tmp-file.patch21
-rw-r--r--rpm419.patch22
-rw-r--r--scl-utils.spec67
6 files changed, 189 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch b/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
new file mode 100644
index 0000000..68f0615
--- /dev/null
+++ b/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
@@ -0,0 +1,31 @@
+From c0315dd54bc94c2acf4e4dcf0a72ca42a1cfde60 Mon Sep 17 00:00:00 2001
+From: Lubos Kardos <lkardos@redhat.com>
+Date: Wed, 9 Mar 2016 16:11:56 +0100
+Subject: [PATCH] Scl utils layout patch from fedora@famillecollet.com
+ (#1198693)
+
+---
+ rpm/macros.scl | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rpm/macros.scl b/rpm/macros.scl
+index 1246fde..41c6be4 100644
+--- a/rpm/macros.scl
++++ b/rpm/macros.scl
+@@ -69,10 +69,13 @@ package or when debugging this package.
+ %global _datadir %{_prefix}/share
+ %global _sysconfdir %{_scl_root}/etc
+ %{?nfsmountable: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}}
++%{?rh_layout: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/%{scl}}
+ %global _sharedstatedir %{_scl_root}/var/lib
+ %{?nfsmountable: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib}
++%{?rh_layout: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}/lib}
+ %global _localstatedir %{_scl_root}/var
+ %{?nfsmountable: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}}
++%{?rh_layout: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}}
+ %global _libdir %{_exec_prefix}/%{_lib}
+ %global _includedir %{_prefix}/include
+ %global _infodir %{_datadir}/info
+--
+1.9.3
+
diff --git a/BZ-2056462-do-not-error-out-on-SIGINT.patch b/BZ-2056462-do-not-error-out-on-SIGINT.patch
new file mode 100644
index 0000000..3a076eb
--- /dev/null
+++ b/BZ-2056462-do-not-error-out-on-SIGINT.patch
@@ -0,0 +1,61 @@
+From 9147d3b66e0a263c2eb427b7892b34c925363854 Mon Sep 17 00:00:00 2001
+From: Michal Domonkos <mdomonko@redhat.com>
+Date: Thu, 17 Feb 2022 17:36:00 +0100
+Subject: [PATCH] Don't error out when command receives SIGINT
+
+Interrupting a running command isn't really an execution problem so
+don't print an error or return a non-zero exit status.
+
+This is also how it worked in versions older than 2.0.
+
+Resolves: rhbz#1967686
+---
+ src/fallback.c | 3 +++
+ src/scllib.c | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/fallback.c b/src/fallback.c
+index 4b9c8fd..c907a34 100644
+--- a/src/fallback.c
++++ b/src/fallback.c
+@@ -6,6 +6,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <dirent.h>
++#include <signal.h>
+
+ #include "scllib.h"
+ #include "sclmalloc.h"
+@@ -229,6 +230,8 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec)
+ xasprintf(&bash_cmd, "/bin/bash %s", tmp);
+ status = system(bash_cmd);
+ if (status == -1 || !WIFEXITED(status)) {
++ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
++ goto exit;
+ debug("Problem with executing command \"%s\"\n", bash_cmd);
+ ret = ERUN;
+ goto exit;
+diff --git a/src/scllib.c b/src/scllib.c
+index a182194..2ba8df8 100644
+--- a/src/scllib.c
++++ b/src/scllib.c
+@@ -11,6 +11,7 @@
+ #include <rpm/rpmcli.h>
+ #include <errno.h>
+ #include <wordexp.h>
++#include <signal.h>
+
+ #include "config.h"
+ #include "errors.h"
+@@ -341,6 +342,8 @@ scl_rc run_command(char * const colnames[], const char *cmd, bool exec)
+
+ status = system(cmd);
+ if (status == -1 || !WIFEXITED(status)) {
++ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
++ goto exit;
+ debug("Problem with executing program \"%s\"\n", cmd);
+ ret = ERUN;
+ goto exit;
+--
+2.35.1
+
diff --git a/BZ-2091000-remove-tmp-file.patch b/BZ-2091000-remove-tmp-file.patch
new file mode 100644
index 0000000..3c4436c
--- /dev/null
+++ b/BZ-2091000-remove-tmp-file.patch
@@ -0,0 +1,21 @@
+From 864844ecc11f8cf65cd97bcffdb803211f7edaa4 Mon Sep 17 00:00:00 2001
+From: Piotr Wilkosz <piotr.wilkosz@gmail.com>
+Date: Mon, 23 May 2022 16:14:13 +0200
+Subject: [PATCH] remove tmp file at exit
+
+---
+ src/fallback.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/fallback.c b/src/fallback.c
+index c907a34..e67654a 100644
+--- a/src/fallback.c
++++ b/src/fallback.c
+@@ -246,6 +246,7 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec)
+ enable_path = _free(enable_path);
+ colpath = _free(colpath);
+ bash_cmd = _free(bash_cmd);
++ unlink(tmp);
+
+ return ret;
+ }
diff --git a/rpm419.patch b/rpm419.patch
new file mode 100644
index 0000000..ffea185
--- /dev/null
+++ b/rpm419.patch
@@ -0,0 +1,22 @@
+From eda4bcb75c3064d10b412a77e479f627e14a9a50 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 22 Aug 2023 12:37:23 +0200
+Subject: [PATCH] fix for RPM 4.19 which defines _root_prefix
+
+---
+ rpm/macros.scl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpm/macros.scl b/rpm/macros.scl
+index 0d27a6b..a03172a 100644
+--- a/rpm/macros.scl
++++ b/rpm/macros.scl
+@@ -39,7 +39,7 @@ package or when debugging this package.
+
+ %scl_prefix() %{?scl:%(if [ "%1" = "%%1" ]; then echo "%{scl}-"; else echo "%1-"; fi)}%{!?scl:%{nil}}
+
+-%scl_package() %{expand:%{!?_root_prefix:
++%scl_package() %{expand:%{!?scl_name:
+ %global pkg_name %1
+ %global scl_name %{scl}
+ %global scl_runtime %{scl}-runtime
diff --git a/scl-utils.spec b/scl-utils.spec
index 535b859..c5019dd 100644
--- a/scl-utils.spec
+++ b/scl-utils.spec
@@ -3,8 +3,8 @@
Name: scl-utils
Epoch: 1
-Version: 2.0.2
-Release: 21%{dist}
+Version: 2.0.3
+Release: 5%{?dist}
Summary: Utilities for alternative packaging
License: GPLv2+
@@ -12,14 +12,15 @@ URL: https://github.com/sclorg/scl-utils
Source0: https://github.com/sclorg/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: macros.scl-filesystem
BuildRequires: gcc make
-Buildrequires: cmake
-Buildrequires: rpm-devel
+BuildRequires: cmake
+BuildRequires: rpm-devel
+BuildRequires: libcmocka libcmocka-devel environment-modules
Requires: %{_bindir}/modulecmd
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
-
-# https://github.com/sclorg/scl-utils/pull/25
-Patch100: scl-utils-2.0.2-rhbz-1728450.patch
+Patch2: BZ-2056462-do-not-error-out-on-SIGINT.patch
+Patch3: BZ-2091000-remove-tmp-file.patch
+Patch4: rpm419.patch
%description
Run-time utility for alternative packaging.
@@ -40,12 +41,10 @@ Essential RPM build macros for alternative packaging.
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
%if 0%{?fedora} >= 33
-sed -e 's/__python}/__python3}/' \
- -e '/brp-python-hardlink/d' \
+sed -e '/brp-python-hardlink/d' \
-i rpm/macros.scl
%endif
-
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
@@ -61,7 +60,11 @@ mkdir modulefiles
mkdir prefixes
ln -s prefixes conf
+%check
+make check
+
%files
+%dir %{_sysconfdir}/scl
%dir %{_sysconfdir}/scl/modulefiles
%dir %{_sysconfdir}/scl/prefixes
%{_sysconfdir}/scl/conf
@@ -84,20 +87,40 @@ ln -s prefixes conf
%{_rpmconfigdir}/brp-scl-python-bytecompile
%changelog
-* Thu Feb 16 2023 Remi Collet <remi@remirepo.net> - 1:2.0.2-21
-- F38 build
+* Tue Aug 22 2023 Remi Collet <remi@remirepo.net> - 1:2.0.3-5
+- add patch for RPM 4.19
+ to workaround https://bugzilla.redhat.com/2233454
+
+* Tue Aug 22 2023 Remi Collet <remi@remirepo.net> - 1:2.0.3-4
+- F39 rebuild from CentOS 9 Stream package
+
+* Tue Dec 13 2022 Florian Festi <ffesti@redhat.com> - 1:2.0.3-4
+- Remove tmp file (#2151261)
+
+* Mon Feb 21 2022 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.3-3
+- Don't error out when command receives SIGINT (#2056462)
+
+* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:2.0.3-2
+- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
+ Related: rhbz#1991688
+
+* Mon Jul 26 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.3-1
+- Rebase to 2.0.3 (#1986085)
+
+* Mon Jul 26 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-21
+- Own directory /etc/scl (#1986040)
-* Wed Aug 17 2022 Remi Collet <remi@remirepo.net> - 1:2.0.2-20
-- F37 build
+* Fri Jul 23 2021 Honza Horak <hhorak@redhat.com> - 1:2.0.2-20
+- Fix problem with python version in the byte compilation script (#1984598)
-* Sun Sep 5 2021 Remi Collet <remi@remirepo.net> - 1:2.0.2-19
-- drop brp-python-hardlink call
+* Wed May 12 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-19
+- Fix dist tag syntax (#1958982)
-* Sat Sep 4 2021 Remi Collet <remi@remirepo.net> - 1:2.0.2-18
-- F35 rebuild
+* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:2.0.2-18
+- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
-* Tue Aug 18 2020 Remi Collet <remi@remirepo.net> - 1:2.0.2-17
-- use python3 by default
+* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-17
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1:2.0.2-16
- Backported upstream patches to resolve RHBZ#1728450.
@@ -117,10 +140,10 @@ ln -s prefixes conf
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
-* Mon Jun 10 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:2.0.2-10
+* Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:2.0.2-10
- Rebuild for RPM 4.15
-* Mon Jun 10 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:2.0.2-9
+* Mon Jun 10 15:42:05 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:2.0.2-9
- Rebuild for RPM 4.15
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-8