[SCM] mpg123/master: Use dpkg-buildflags to get hardening well done.

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Wed Mar 28 07:51:09 UTC 2012


The following commit has been merged in the master branch:
commit 4c825e23c1a09d96f4cfad11b1ea2390ed37fa54
Author: Alessio Treglia <alessio at debian.org>
Date:   Wed Mar 28 09:40:52 2012 +0200

    Use dpkg-buildflags to get hardening well done.

diff --git a/debian/rules b/debian/rules
index 79a3dbf..c450059 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,38 +25,10 @@ LIB_PKGSTR:=-p$(LIB_PKG) -p$(DEV_PKG)
 ARCH_PKGSTR=-pmpg123
 ALL_PKGSTR=$(LIB_PKGSTR) $(ARCH_PKGSTR)
 
-CFLAGS = 
-LDFLAGS =
-
-# Add hardening options. OS and architecture restrictions are stolen from
-# package hardening-wrapper.
-ifeq (,$(findstring noharden,$(DEB_BUILD_OPTIONS)))
-# configure script currently chokes on -Werror
-#       CFLAGS += -Wformat -Werror=format-security
-        CFLAGS += -Wformat
-        LDFLAGS += -Wl,-z,relro
-ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -D_FORTIFY_SOURCE=2
-endif
-ifeq (,$(findstring :$(CPU):,:ia64:alpha:mips:mipsel:hppa:arm:))
-        CFLAGS += -fstack-protector
-endif
-ifneq (,$(findstring :$(OS):,:linux:knetbsd:))
-ifeq (,$(findstring :$(CPU):,:hppa:m68k:arm:mips:mipsel:))
-        CFLAGS += -fPIE
-        LDFLAGS += -pie
-endif
-endif
-endif
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -O0
-else
-        CFLAGS += -O2
-endif
-
-export CFLAGS
-export LDFLAGS
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
 #export DH_VERBOSE=1
 

-- 
mpg123 packaging



More information about the pkg-multimedia-commits mailing list