From 5da2a6a5b0bcfa8e65759f28246cbdd3ffea28aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Wed, 4 Apr 2018 11:33:41 +0200 Subject: [PATCH] Build with distro's LDFLAGS Resolves: rhbz#1563157 --- ppp-2.4.7-honor-ldflags.patch | 118 ++++++++++++++++++++++++++++++++++ ppp.spec | 13 +++- 2 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 ppp-2.4.7-honor-ldflags.patch diff --git a/ppp-2.4.7-honor-ldflags.patch b/ppp-2.4.7-honor-ldflags.patch new file mode 100644 index 0000000..39339bb --- /dev/null +++ b/ppp-2.4.7-honor-ldflags.patch @@ -0,0 +1,118 @@ +diff --git a/chat/Makefile.linux b/chat/Makefile.linux +index 2445637..83114f1 100644 +--- a/chat/Makefile.linux ++++ b/chat/Makefile.linux +@@ -18,7 +18,7 @@ INSTALL= install + all: chat + + chat: chat.o +- $(CC) -o chat chat.o ++ $(CC) $(LDFLAGS) -o chat chat.o + + chat.o: chat.c + $(CC) -c $(CFLAGS) -o chat.o chat.c +diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux +index 303833a..04fe876 100644 +--- a/pppd/plugins/Makefile.linux ++++ b/pppd/plugins/Makefile.linux +@@ -1,7 +1,7 @@ + #CC = gcc + COPTS = $(RPM_OPT_FLAGS) + CFLAGS = $(COPTS) -I.. -I../../include -fPIC +-LDFLAGS = -shared ++LDFLAGS_SHARED = -shared + INSTALL = install + + # EAP-TLS +@@ -33,7 +33,7 @@ all: $(PLUGINS) + for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done + + %.so: %.c +- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ ++ $(CC) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) $(CFLAGS) $^ + + VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h) + +diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux +index 4c5826f..1961e0e 100644 +--- a/pppd/plugins/pppoatm/Makefile.linux ++++ b/pppd/plugins/pppoatm/Makefile.linux +@@ -1,7 +1,7 @@ + #CC = gcc + COPTS = $(RPM_OPT_FLAGS) + CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC +-LDFLAGS = -shared ++LDFLAGS_SHARED = -shared + INSTALL = install + + #*********************************************************************** +@@ -33,7 +33,7 @@ endif + all: $(PLUGIN) + + $(PLUGIN): $(PLUGIN_OBJS) +- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS) + + install: all + $(INSTALL) -d -m 755 $(LIBDIR) +diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux +index 9cb316d..7b23b25 100644 +--- a/pppd/plugins/pppol2tp/Makefile.linux ++++ b/pppd/plugins/pppol2tp/Makefile.linux +@@ -1,7 +1,7 @@ + #CC = gcc + COPTS = $(RPM_OPT_FLAGS) -DHAVE_MULTILINK + CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC +-LDFLAGS = -shared ++LDFLAGS_SHARED = -shared + INSTALL = install + + #*********************************************************************** +@@ -16,7 +16,7 @@ PLUGINS := pppol2tp.so openl2tp.so + all: $(PLUGINS) + + %.so: %.o +- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS) + + install: all + $(INSTALL) -d -m 755 $(LIBDIR) +diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux +index fa49efb..d735c51 100644 +--- a/pppd/plugins/rp-pppoe/Makefile.linux ++++ b/pppd/plugins/rp-pppoe/Makefile.linux +@@ -31,7 +31,7 @@ CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"' + all: rp-pppoe.so pppoe-discovery + + pppoe-discovery: pppoe-discovery.o debug.o common.o +- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o -ludev ++ $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o -ludev + + pppoe-discovery.o: pppoe-discovery.c + $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c +diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux +index 95c6805..33e5107 100644 +--- a/pppdump/Makefile.linux ++++ b/pppdump/Makefile.linux +@@ -10,7 +10,7 @@ INSTALL= install + all: pppdump + + pppdump: $(OBJS) +- $(CC) -o pppdump $(OBJS) ++ $(CC) $(LDFLAGS) -o pppdump $(OBJS) + + clean: + rm -f pppdump $(OBJS) *~ +diff --git a/pppstats/Makefile.linux b/pppstats/Makefile.linux +index c5ba3b1..eeccf83 100644 +--- a/pppstats/Makefile.linux ++++ b/pppstats/Makefile.linux +@@ -26,7 +26,7 @@ install: pppstats + $(INSTALL) -c -m 444 pppstats.8 $(MANDIR) + + pppstats: $(PPPSTATSRCS) +- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o pppstats pppstats.c $(LIBS) + + clean: + rm -f pppstats *~ #* core diff --git a/ppp.spec b/ppp.spec index fba6300..902c996 100644 --- a/ppp.spec +++ b/ppp.spec @@ -3,7 +3,7 @@ Summary: The Point-to-Point Protocol daemon Name: ppp Version: 2.4.7 -Release: 18%{?dist} +Release: 19%{?dist} License: BSD and LGPLv2+ and GPLv2+ and Public Domain Group: System Environment/Daemons URL: http://www.samba.org/ppp @@ -53,6 +53,8 @@ Patch0028: 0028-pppoe-include-netinet-in.h-before-linux-in.h.patch # rhbz#1556132 Patch0029: ppp-2.4.7-DES-openssl.patch +# https://github.com/paulusmack/ppp/pull/95 +Patch0030: ppp-2.4.7-honor-ldflags.patch BuildRequires: pam-devel, libpcap-devel, systemd, systemd-devel, glib2-devel BuildRequires: openssl-devel @@ -83,9 +85,10 @@ tar -xJf %{SOURCE12} %build export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC -Wall -fno-strict-aliasing" +export RPM_LD_FLAGS="$LDFLAGS" %configure -make %{?_smp_mflags} -make -C ppp-watch %{?_smp_mflags} +make %{?_smp_mflags} LDFLAGS="%{?build_ldflags}" +make -C ppp-watch %{?_smp_mflags} LDFLAGS="%{?build_ldflags}" %install make INSTROOT=%{buildroot} install install-etcppp @@ -172,6 +175,10 @@ install -p %{SOURCE11} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifdo %doc PLUGINS %changelog +* Wed Apr 4 2018 Jaroslav Škarvada - 2.4.7-19 +- Build with distro's LDFLAGS + Resolves: rhbz#1563157 + * Tue Mar 27 2018 Jaroslav Škarvada - 2.4.7-18 - Used openssl for the DES instead of the libcrypt / glibc Resolves: rhbz#1556132