[packages/iptables] - set proper OUTPUT_FORMAT and libdir in libiptc.so

qboosh qboosh at pld-linux.org
Thu Jan 30 21:06:37 CET 2020


commit 7cf640e12dc83e4cecb540b7cfbdff8110aff843
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jan 30 21:06:50 2020 +0100

    - set proper OUTPUT_FORMAT and libdir in libiptc.so

 iptables.spec    | 9 ++++++++-
 no-libiptc.patch | 8 ++++----
 2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/iptables.spec b/iptables.spec
index 2ed1c7c..5dc4b49 100644
--- a/iptables.spec
+++ b/iptables.spec
@@ -294,7 +294,14 @@ install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
 # upstream solution with empty library with two DT_NEEDED entries doesn't work
 # with PLD's default LDFLAGS (--as-needed --no-copy-dt-needed-entries);
 # use ld script instead (see no-libiptc.patch for source)
-cp -p libiptc/libiptc.ld $RPM_BUILD_ROOT%{_libdir}/libiptc.so
+%{__sed} \
+%ifarch %{x8664} alpha aarch64 hppa64 mips64 ppc64 s390x sparc64
+	-e 's, at BITS@,64,' \
+%else
+	-e 's, at BITS@,32,' \
+%endif
+	-e 's, at LIBDIR@,%{_libdir},' \
+	-e "s, at ARCH@,$(echo "%{_build_arch}" | tr _ -)," libiptc/libiptc.ld.in >$RPM_BUILD_ROOT%{_libdir}/libiptc.so
 
 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/iptables
 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ip6tables
diff --git a/no-libiptc.patch b/no-libiptc.patch
index bc6c838..7a2bfcf 100644
--- a/no-libiptc.patch
+++ b/no-libiptc.patch
@@ -13,10 +13,10 @@
  libip4tc_la_LDFLAGS = -version-info 0:0:0
  libip6tc_la_SOURCES = libip6tc.c
 
---- iptables-1.4.16.2/libiptc/libiptc.ld.orig	1970-01-01 01:00:00.000000000 +0100
-+++ iptables-1.4.16.2/libiptc/libiptc.ld	2012-10-09 17:47:42.606342693 +0200
+--- iptables-1.4.16.2/libiptc/libiptc.ld.in.orig	1970-01-01 01:00:00.000000000 +0100
++++ iptables-1.4.16.2/libiptc/libiptc.ld.in	2012-10-09 17:47:42.606342693 +0200
 @@ -0,0 +1,4 @@
 +/* GNU ld script
 +   Gather both libipt4c and libipt6c, using them only as needed */
-+OUTPUT_FORMAT(elf32-i386)
-+GROUP ( AS_NEEDED ( /usr/lib/libip4tc.so /usr/lib/libip6tc.so ) )
++OUTPUT_FORMAT(elf at BITS@- at ARCH@)
++GROUP ( AS_NEEDED ( @LIBDIR@/libip4tc.so @LIBDIR@/libip6tc.so ) )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/iptables.git/commitdiff/7cf640e12dc83e4cecb540b7cfbdff8110aff843



More information about the pld-cvs-commit mailing list