Browse Source

Make hardening build work, use dh-autoreconf

Christoph Biedl 6 years ago
parent
commit
3b3b98b680
3 changed files with 7 additions and 10 deletions
  1. 1 0
      debian/control
  2. 5 8
      debian/patches/build_hardening-flags.patch
  3. 1 2
      debian/rules

+ 1 - 0
debian/control

@@ -4,6 +4,7 @@ Homepage: http://poptop.sourceforge.net/dox/
 Standards-Version: 3.9.6
 Build-Depends: debhelper (>= 9),
     automake,
+    dh-autoreconf,
     dh-systemd,
     libwrap0-dev,
     ppp-dev (>= 2.4.6-2~),

+ 5 - 8
debian/patches/build_hardening-flags.patch

@@ -2,21 +2,18 @@ Subject: Enable hardened build flags
 Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Bug-Debian: http://bugs.debian.org/656650
 Forwarded: not-needed
-Last-Update: 2015-08-24
+Last-Update: 2015-12-04
 
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -11,9 +11,10 @@
+@@ -11,7 +11,7 @@
  ##  warning with -Wmissing-prototypes).
  ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
  ##  aren't up to it).
 -CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
-+#CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
++CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
  #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
  #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
-+CPPFLAGS = -DSBINDIR='"$(sbindir)"'
- 
- man_MANS = pptpctrl.8 pptpd.8 pptpd.conf.5 bcrelay.8
  
 --- a/plugins/Makefile
 +++ b/plugins/Makefile
@@ -25,8 +22,8 @@ Last-Update: 2015-08-24
  COPTS	= -O2 -g
 -CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
 -LDFLAGS	= -shared
-+CFLAGS  += $(COPTS) -I.. -I../../include -fPIC
-+LDFLAGS	+= -shared
++CFLAGS  = $(shell dpkg-buildflags --get CFLAGS) $(COPTS) -I.. -I../../include -fPIC
++LDFLAGS	= $(shell dpkg-buildflags --get LDFLAGS) -shared
  LDADD   = -lutil
  INSTALL	= install -o root
  prefix  = /usr/local

+ 1 - 2
debian/rules

@@ -1,10 +1,9 @@
 #!/usr/bin/make -f
 
 %:
-	dh $@ --with systemd
+	dh $@ --with systemd --with autoreconf
 
 override_dh_auto_configure:
-	autoreconf --force --install
 	dh_auto_configure -- \
 		--prefix=/usr \
 		--mandir=/usr/share/man \