[packages/poldek] add patches from pull requests

atler atler at pld-linux.org
Mon Nov 23 12:56:36 CET 2020


commit c905c5f8c5c4396b15704059cc74a9d57139fa4a
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Nov 23 12:18:21 2020 +0100

    add patches from pull requests
    
    - rpmvercmp implementation for rpm.org
    - dynamic linking against libtrurl instead of static in dynamic
      libraries: libtndb and libvfile

 poldek.spec          |  6 +++++
 rpm4-rpmvercmp.patch | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 trurlib-shared.patch | 35 +++++++++++++++++++++++++
 3 files changed, 114 insertions(+)
---
diff --git a/poldek.spec b/poldek.spec
index ee81108..9e0ab23 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -63,6 +63,8 @@ Patch8:		rpm4-uname-deps.patch
 Patch9:		sqlite-rpmdb.patch
 Patch10:	rpm4-cpuinfo-deps.patch
 Patch11:	rpm4-no-dir-deps.patch
+Patch12:	rpm4-rpmvercmp.patch
+Patch13:	trurlib-shared.patch
 URL:		http://poldek.pld-linux.org/
 BuildRequires:	%{db_pkg}-devel >= %{ver_db}
 BuildRequires:	autoconf >= 2.63
@@ -248,6 +250,10 @@ Moduły języka Python dla poldka.
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
+%patch12 -p1
+cd trurlib
+%patch13 -p1
+cd ..
 
 %{__rm} doc/poldek.info
 %{__rm} m4/libtool.m4 m4/lt*.m4
diff --git a/rpm4-rpmvercmp.patch b/rpm4-rpmvercmp.patch
new file mode 100644
index 0000000..a2cbf18
--- /dev/null
+++ b/rpm4-rpmvercmp.patch
@@ -0,0 +1,73 @@
+From 70940292e321f1b7f4af217425810ed4110f6333 Mon Sep 17 00:00:00 2001
+From: Jan Palus <atler at pld-linux.org>
+Date: Sat, 31 Oct 2020 00:32:04 +0100
+Subject: [PATCH] implement rpmvercmp for rpm.org
+
+---
+ pm/rpmorg/rpmvercmp.c | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/pm/rpmorg/rpmvercmp.c b/pm/rpmorg/rpmvercmp.c
+index 7e40e15..36bf9e5 100644
+--- a/pm/rpmorg/rpmvercmp.c
++++ b/pm/rpmorg/rpmvercmp.c
+@@ -49,18 +49,15 @@ static void parse(const char *evrstr, EVR_t evr)
+ #endif
+ #endif
+ 
+-#ifdef HAVE_RPMORG
+-int main(void)
+-{
+-    printf("not implemented");
+-    exit(EXIT_SUCCESS);
+-}
+-#else
+ int main(int argc, char *argv[])
+ {
+     int cmprc;
+     const char *v1, *v2;
++#ifdef HAVE_RPMORG
++    rpmver evr1, evr2;
++#else
+     EVR_t evr1, evr2;
++#endif
+ 
+     if (argc < 3) {
+         printf("Usage: rpmvercmp VERSION1 VERSION2\n");
+@@ -81,6 +78,12 @@ int main(int argc, char *argv[])
+ 	exit(2);
+     }
+ 
++#ifdef HAVE_RPMORG
++    evr1 = rpmverParse(v1);
++    evr2 = rpmverParse(v2);
++
++    cmprc = rpmverCmp(evr1, evr2);
++#else
+     evr1 = malloc(sizeof(struct EVR_s));
+     evr2 = malloc(sizeof(struct EVR_s));
+ 
+@@ -93,17 +96,22 @@ int main(int argc, char *argv[])
+ #endif
+ 
+     cmprc = rpmEVRcompare(evr1, evr2);
++#endif
+ 
+     printf("%s %s %s\n", v1, cmprc == 0 ?  "==" : cmprc > 0 ? ">" : "<", v2);
+ 
+     if (cmprc < 0)
+         cmprc = 2;
+ 
++#ifdef HAVE_RPMORG
++    rpmverFree(evr1);
++    rpmverFree(evr2);
++#else
+     free((char *)evr1->str);
+     free((char *)evr2->str);
+     free(evr1);
+     free(evr2);
++#endif
+ 
+     exit(cmprc);
+ }
+-#endif
diff --git a/trurlib-shared.patch b/trurlib-shared.patch
new file mode 100644
index 0000000..7764486
--- /dev/null
+++ b/trurlib-shared.patch
@@ -0,0 +1,35 @@
+From 67817281c4346832356febca89373742a0cde8b1 Mon Sep 17 00:00:00 2001
+From: Jan Palus <atler at pld-linux.org>
+Date: Sat, 31 Oct 2020 00:04:11 +0100
+Subject: [PATCH] create symbolic link for dynamic lib as well
+
+both tndb and vfile in poldek link against libtrurl and due to the way
+linking is configured it is always linked with static libtrurl (only
+libtrurl.a link provided). this causes two issues:
+
+- mixes dynamically linked libraries with statically linked libtrurl
+  and since nothing enforces -fPIC in the latter it results in error:
+
+libtool: warning: relinking 'libtndb.la'
+libtool: install: ... -o .libs/libtndb.so.0.2.0
+/usr/bin/ld: ./../trurlib/libtrurl.a(ndie.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `__stack_chk_guard@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC
+/usr/bin/ld: ./../trurlib/libtrurl.a(ndie.o)(.text+0x8): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
+/usr/bin/ld: final link failed: bad value
+
+- includes copy of libtrurl in dynamic libraries even though poldek
+  provides dynamic libtrurl
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 7c41374..0d13380 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -146,5 +146,6 @@ tests:  $(EXTRA_PROGRAMS)
+ 
+ all-local:
+ 	@ln -sf .libs/libtrurl.a libtrurl.a
++	@ln -sf .libs/libtrurl.so libtrurl.so
+ 
+ include Makefile.extra
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/poldek.git/commitdiff/c905c5f8c5c4396b15704059cc74a9d57139fa4a



More information about the pld-cvs-commit mailing list