chiark / gitweb /
finalise 2.1.2
[authbind.git] / debian / rules
index c9091ed8231d1f72cedb0f7091687a1153febb70..b4f4dc5f367397359ebfcd279106f9e4d2003515 100755 (executable)
@@ -20,7 +20,6 @@
 #
 # $Id$
 
-CC= gcc
 SHELL=/bin/bash
 
 package=authbind
@@ -29,6 +28,11 @@ minor=0
 
 arch = $(shell dpkg --print-architecture)
 
+TOOL_PREFIX = $(shell set -x; a=`dpkg-architecture -q DEB_HOST_GNU_TYPE`; echo $$a$${a+-})
+ifeq ($(origin CC),default)
+CC=$(TOOL_PREFIX)gcc
+endif
+
 export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
 
 INSTALL = install
@@ -45,8 +49,8 @@ CFLAGS += -g
 LDFLAGS += -g 
 
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-STRIP=strip
+STRIP=$(TOOL_PREFIX)strip
+INSTALL_PROGRAM += -s --strip-program=$(STRIP)
 else
 STRIP=:
 endif
@@ -62,7 +66,7 @@ export STRIP
 
 
 build: 
-       $(MAKE) prefix=/usr
+       $(MAKE) prefix=/usr CC='$(CC)' LD='$(TOOL_PREFIX)ld'
 
 clean: 
        $(MAKE) distclean
@@ -85,7 +89,7 @@ binary-arch:  checkroot build
        $(MAKE) prefix=debian/tmp/usr etc_dir=debian/tmp/etc/authbind \
                man_dir=debian/tmp/usr/share/man  install install_man
        $(INSTALL_FILE) debian/changelog $(udp)/changelog
-       gzip -9 debian/tmp/usr/share/man/man*/* $(udp)/*
+       gzip -9n debian/tmp/usr/share/man/man*/* $(udp)/*
        $(INSTALL_FILE) debian/copyright $(udp)/.
        $(INSTALL_SCRIPT) debian/{postrm,prerm,postinst} debian/tmp/DEBIAN
        dpkg-shlibdeps ./authbind