Package: links2
Version: 2.5-1
Severity: important
Tags: patch

Please enabled hardened build flags through dpkg-buildflags.

Patch attached. (dpkg-buildflags abides "noopt" from DEB_BUILD_OPTIONS)

Cheers,
        Moritz
--- links2-2.5.orig/debian/rules	2011-12-06 22:05:21.000000000 +0100
+++ links2-2.5/debian/rules	2012-01-05 22:35:21.000000000 +0100
@@ -7,18 +7,15 @@
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += -Wall
+LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
 
 config.status: configure
 	dh_testdir
 	dh_autotools-dev_updateconfig
-	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
+	CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
         --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
         --enable-graphics --with-x --with-fb
@@ -60,7 +57,7 @@
 	cp debian/links2.desktop debian/links2/usr/share/applications/
 
 #	build the textmode only version
-	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
+	CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
 	--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
 	--mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
 	--without-svgalib --without-x --without-fb --without-directfb --without-libjpeg --without-libtiff

Reply via email to