[packages/abrt] - add rpm5 bcond to be able to build for different rpm than running one - drop outdated rpm 4.5 patc

baggins baggins at pld-linux.org
Mon Feb 22 12:40:36 CET 2021


commit 202dbab63cb34929c16fad83d993b3cb886f17ac
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Feb 22 12:38:47 2021 +0100

    - add rpm5 bcond to be able to build for different rpm than running one
    - drop outdated rpm 4.5 patch
    - rel 2

 abrt-rpm45.patch | 110 -------------------------------------------------------
 abrt.spec        |  14 +++----
 2 files changed, 5 insertions(+), 119 deletions(-)
---
diff --git a/abrt.spec b/abrt.spec
index 44b8ce7..c3648ce 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -4,13 +4,14 @@
 #
 # Conditional build:
 %bcond_without	tests	# disable pythontests
+%bcond_with	rpm5	# build with rpm5
 
 %define		libreport_ver	2.13.0
 Summary:	Automatic bug detection and reporting tool
 Summary(pl.UTF-8):	Narzędzie do automatycznego wykrywania i zgłaszania błędów
 Name:		abrt
 Version:	2.14.4
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		Applications/System
 #Source0Download: https://github.com/abrt/abrt/releases
@@ -18,7 +19,6 @@ Source0:	https://github.com/abrt/abrt/archive/%{version}/%{name}-%{version}.tar.
 # Source0-md5:	c7583c001464cb2ec0067afb08cdc6cb
 Source1:	%{name}.init
 Patch0:		%{name}-rpm5.patch
-Patch1:		%{name}-rpm45.patch
 Patch2:		%{name}-link.patch
 Patch3:		%{name}-split-usr.patch
 URL:		https://abrt.readthedocs.org/
@@ -192,8 +192,8 @@ Summary(pl.UTF-8):	Dodatek ABRT do przechwytywania i analizy wyjątków Pythona
 Group:		Libraries
 Requires:	%{name} = %{version}-%{release}
 Requires:	%{name}-python3 = %{version}-%{release}
-# for detecting package name containing offending file (TODO: python3-rpm package)
-#Suggests:	python3-rpm
+# for detecting package name containing offending file
+%{!?with_rpm5:Suggests:	python3-rpm}
 # for logging to journal
 Suggests:	python3-systemd
 
@@ -405,11 +405,7 @@ się do powłoki.
 
 %prep
 %setup -q
-%if "%{_rpmversion}" >= "5.0"
-%patch0 -p1
-%else
-%patch1 -p1
-%endif
+%{?with_rpm5:%patch0 -p1}
 %patch2 -p1
 %patch3 -p1
 
diff --git a/abrt-rpm45.patch b/abrt-rpm45.patch
deleted file mode 100644
index ec894e8..0000000
--- a/abrt-rpm45.patch
+++ /dev/null
@@ -1,110 +0,0 @@
---- abrt-2.0.8/src/daemon/Makefile.am.0011~	2011-12-15 13:39:13.000000000 +0100
-+++ abrt-2.0.8/src/daemon/Makefile.am	2012-03-11 21:28:24.900043460 +0100
-@@ -84,6 +84,7 @@ abrt_action_save_package_data_CPPFLAGS =
-     -I$(srcdir)/../include \
-     -I$(srcdir)/../lib \
-     -DCONF_DIR=\"$(CONF_DIR)\" \
-+    $(RPM_CFLAGS) \
-     $(GLIB_CFLAGS) \
-     $(LIBREPORT_CFLAGS) \
-     -D_GNU_SOURCE \
---- abrt-2.1.3/src/daemon/rpm.h.orig	2013-03-13 10:00:17.000000000 +0100
-+++ abrt-2.1.3/src/daemon/rpm.h	2013-04-02 18:02:06.019396313 +0200
-@@ -22,6 +22,7 @@
- #ifndef RPM_H_
- #define RPM_H_
- 
-+#include "rpmlib.h"
- #include <rpm/rpmts.h>
- #include <rpm/rpmcli.h>
- #include <rpm/rpmdb.h>
---- abrt-2.1.6/src/daemon/rpm.c.orig	2013-07-23 10:10:03.000000000 +0200
-+++ abrt-2.1.6/src/daemon/rpm.c	2013-09-04 20:54:27.219767437 +0200
-@@ -62,7 +62,6 @@ void rpm_init()
- void rpm_destroy()
- {
-     /* Mirroring the order of deinit calls in rpm-4.11.1/lib/poptALL.c::rpmcliFini() */
--    rpmFreeCrypto();
-     rpmFreeMacros(NULL);
-     rpmFreeRpmrc();
- 
-@@ -110,7 +109,14 @@ int rpm_chk_fingerprint(const char* pkg)
-     if (!header)
-         goto error;
- 
--    pgpsig = headerFormat(header, "%|SIGGPG?{%{SIGGPG:pgpsig}}:{%{SIGPGP:pgpsig}}|", &errmsg);
-+    pgpsig = headerSprintf(
-+		header,
-+		"%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:"
-+		"{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|",
-+		NULL,
-+		NULL,
-+		&errmsg);
-+
-     if (!pgpsig && errmsg)
-     {
-         VERB1 log("cannot get siggpg:pgpsig. reason: %s", errmsg);
-@@ -202,14 +208,13 @@ char* rpm_get_component(const char *file
-         rpmdbFreeIterator(iter);
-         rpmtsFree(ts);
-         ts = rpmtsCreate();
--        if (rpmtsSetRootDir(ts, rootdir_or_NULL) != 0)
--            goto error1;
-+        rpmtsSetRootDir(ts, rootdir_or_NULL);
-         filename += len;
-         rootdir_or_NULL = NULL;
-     }
- 
-     const char *errmsg = NULL;
--    srpm = headerFormat(header, "%{SOURCERPM}", &errmsg);
-+    srpm = headerSprintf(header, "%{SOURCERPM}", NULL, NULL, &errmsg);
-     if (!srpm && errmsg)
-     {
-         error_msg("cannot get srpm. reason: %s", errmsg);
-@@ -230,7 +235,7 @@ char* rpm_get_component(const char *file
-     static inline int pkg_add_##name(Header header, struct pkg_envra *p) \
-     {                                                                   \
-         const char *errmsg = NULL;                                      \
--        p->p_##name = headerFormat(header, "%{"#name"}", &errmsg);      \
-+        p->p_##name = headerSprintf(header, "%{"#name"}", NULL, NULL, &errmsg);      \
-         if (p->p_##name || !errmsg)                                     \
-             return 0;                                                   \
-                                                                         \
-@@ -275,8 +280,7 @@ struct pkg_envra *rpm_get_package_nvr(co
-         rpmdbFreeIterator(iter);
-         rpmtsFree(ts);
-         ts = rpmtsCreate();
--        if (rpmtsSetRootDir(ts, rootdir_or_NULL) != 0)
--            goto error1;
-+        rpmtsSetRootDir(ts, rootdir_or_NULL);
-         filename += len;
-         rootdir_or_NULL = NULL;
-     }
---- abrt-2.1.3/src/plugins/bodhi.c.orig	2013-03-13 10:00:17.000000000 +0100
-+++ abrt-2.1.3/src/plugins/bodhi.c	2013-04-02 18:15:58.076045639 +0200
-@@ -18,6 +18,8 @@
- */
- 
- #include <json/json.h>
-+#include <stdint.h>
-+#include <rpmlib.h>
- #include <rpm/rpmts.h>
- #include <rpm/rpmcli.h>
- #include <rpm/rpmdb.h>
-@@ -338,7 +340,7 @@ static char *rpm_get_nvr_by_pkg_name(con
-         goto error;
- 
-     const char *errmsg = NULL;
--    nvr = headerFormat(header, "%{name}-%{version}-%{release}", &errmsg);
-+    nvr = headerSprintf(header, "%{name}-%{version}-%{release}", NULL, NULL, &errmsg);
- 
-     if (!nvr && errmsg)
-         error_msg("cannot get nvr. reason: %s", errmsg);
-@@ -348,7 +350,6 @@ error:
-     rpmtsFree(ts);
- 
-     rpmFreeRpmrc();
--    rpmFreeCrypto();
-     rpmFreeMacros(NULL);
- 
-     return nvr;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/abrt.git/commitdiff/202dbab63cb34929c16fad83d993b3cb886f17ac



More information about the pld-cvs-commit mailing list