Code

rules: Enabled harding build flags (use dpkg-buildflags).
[pkg-tig.git] / debian / rules
index bf6e7a269ec5a6ee3a15f43eda27f1a92e3db939..9c4aa1482e2c345c124bd32620fae187478a3af5 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
-# debian/ruls for tig
+# debian/rules for tig
 #
-# Written by Sebastian Harl <sh@tokkee.org>
+# Written by Sebastian Harl <tokkee@debian.org>
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 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 -I/usr/include/ncursesw
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+CFLAGS   = $(shell dpkg-buildflags --get CFLAGS)
+CFLAGS  += -Wall -g -I/usr/include/ncursesw
+
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+
+LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
@@ -23,9 +30,12 @@ config.status: configure
        dh_testdir
        ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \
-               CFLAGS="$(CFLAGS)" LIBS="-lncursesw"
+               CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+build: build-arch build-indep
 
-build: build-stamp
+build-arch: build-stamp
+build-indep: build-stamp
 
 build-stamp: config.status
        dh_testdir
@@ -45,6 +55,7 @@ clean:
        rm -rf manual.html-chunked/
        rm -f manual.pdf manual.html manual.toc
        rm -f tig.1 tig.1.html tigrc.5 tigrc.5.html
+       rm -f NEWS.html README.html
        
        dh_clean 
 
@@ -66,8 +77,8 @@ binary-indep:
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs
-       dh_installdocs BUGS TODO manual.pdf
+       dh_installchangelogs NEWS
+       dh_installdocs BUGS manual.pdf
        dh_installexamples contrib/tigrc
        dh_link
        dh_strip
@@ -80,5 +91,5 @@ binary-arch: build install
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install patch unpatch
+.PHONY: build clean binary-indep binary-arch binary install