[packages/satyr] - 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 13:30:38 CET 2021
commit c6c187207902aa90d06987b8e951a5ec6bac7f94
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Feb 22 13:29:16 2021 +0100
- add rpm5 bcond to be able to build for different rpm than running one
- drop outdated rpm 4.5 patch
- rel 3
satyr-rpm45.patch | 65 -------------------------------------------------------
satyr.spec | 12 +++-------
2 files changed, 3 insertions(+), 74 deletions(-)
---
diff --git a/satyr.spec b/satyr.spec
index 5f4ef70..1fd77c1 100644
--- a/satyr.spec
+++ b/satyr.spec
@@ -1,19 +1,19 @@
#
# Conditional build:
%bcond_without apidocs # Doxygen API documentation
+%bcond_with rpm5 # build with rpm5
#
Summary: Tools to create anonymous, machine-friendly problem reports
Summary(pl.UTF-8): Analizator śladów wywołań tworzonych przez GDB
Name: satyr
Version: 0.31
-Release: 2
+Release: 3
License: GPL v2+
Group: Development/Tools
#Source0Download: https://github.com/abrt/satyr/releases
Source0: https://github.com/abrt/satyr/archive/%{version}/%{name}-%{version}.tar.gz
# Source0-md5: b8d144be731da681b6ff2701422a2f96
Patch0: %{name}-rpm5.patch
-Patch1: %{name}-rpm45.patch
URL: https://github.com/abrt/satyr
BuildRequires: autoconf >= 2.50
BuildRequires: automake
@@ -112,13 +112,7 @@ Wiązania Pythona 3 do biblioteki Satyr.
%prep
%setup -q
-%if "%{_rpmversion}" >= "5.0"
-%patch0 -p1
-%else
-%if "%{_rpmversion}" >= "4.5" && "%{_rpmversion}" < "4.6"
-%patch1 -p1
-%endif
-%endif
+%{?with_rpm5:%patch0 -p1}
printf '%s' '%{version}' > satyr-version
diff --git a/satyr-rpm45.patch b/satyr-rpm45.patch
deleted file mode 100644
index 65c2789..0000000
--- a/satyr-rpm45.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- satyr-0.3/lib/rpm.c.orig 2013-03-25 15:07:04.000000000 +0100
-+++ satyr-0.3/lib/rpm.c 2013-04-06 10:59:35.792721546 +0200
-@@ -27,7 +27,6 @@
- #include <rpm/rpmlib.h>
- #include <rpm/rpmdb.h>
- #include <rpm/rpmts.h>
--#include <rpm/rpmtd.h>
- #include <rpm/header.h>
- #endif
- #include <fcntl.h>
-@@ -249,18 +248,20 @@
- rpmTag tag,
- char **result)
- {
-- rpmtd tag_data = rpmtdNew();
-- int success = headerGet(header,
-- tag,
-- tag_data,
-- HEADERGET_DEFAULT);
-+
-+ int_32 type, cnt;
-+ void *p;
-+ const char **strp;
-+ int success = headerGetEntry(header, tag, &type, &p, &cnt);
-
- if (success != 1)
- return false;
-
-- const char *str = rpmtdGetString(tag_data);
-+ const char *str = (type == RPM_STRING_TYPE) ? p :
-+ (((type == RPM_STRING_ARRAY_TYPE) || (type == RPM_I18NSTRING_TYPE)) ? *(strp = p) : NULL);
- *result = (str ? sr_strdup(str) : NULL);
-- rpmtdFree(tag_data);
-+ if(type == RPM_STRING_ARRAY_TYPE)
-+ free(p);
- return str;
- }
-
-@@ -269,20 +270,19 @@
- rpmTag tag,
- uint32_t *result)
- {
-- rpmtd tag_data = rpmtdNew();
-- int success = headerGet(header,
-- tag,
-- tag_data,
-- HEADERGET_DEFAULT);
-+ int_32 type, cnt;
-+ void *p;
-+ int success = headerGetEntry(header, tag, &type, &p, &cnt);
-
- if (success != 1)
- return false;
-
-- uint32_t *num = rpmtdGetUint32(tag_data);
-+ if (type != RPM_UINT32_TYPE)
-+ return false;
-+ uint32_t *num = p;
- if (num)
- *result = *num;
-
-- rpmtdFree(tag_data);
- return num;
- }
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/satyr.git/commitdiff/c6c187207902aa90d06987b8e951a5ec6bac7f94
More information about the pld-cvs-commit
mailing list