diff from NMU by Thorsten Glaser that fixes FTBFS issues in the -1 upload debian/1.5-1.1
authorBdale Garbee <bdale@gag.com>
Wed, 20 Jun 2012 18:50:00 +0000 (12:50 -0600)
committerBdale Garbee <bdale@gag.com>
Wed, 20 Jun 2012 18:50:00 +0000 (12:50 -0600)
debian/changelog
debian/rules

index f23e50edc3db66b992e56a83c24ec5ec1664c80d..7228b080e8623951133ad92ad6999054e8ade4d3 100644 (file)
@@ -1,3 +1,11 @@
+gzip (1.5-1.1) unstable; urgency=low
+
+  * Non-maintainer upload with permission of maintainer.
+  * Clean up the debian/rules file to fix FTBFS caused by
+    inclusion of build-indep on binary-arch target.
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Wed, 20 Jun 2012 16:10:12 +0200
+
 gzip (1.5-1) unstable; urgency=low
 
   * new upstream version, with updated gnulib that closes: #669434
index 83be2e58fa31bb77c72140a1f4b5e641883b90be..be2d169a32721ec8cd1257818ab03e386f18b620 100755 (executable)
 #!/usr/bin/make -f
 #      Debian rules file for gzip, requires the debhelper package.
 #      Crafted by Bdale Garbee, bdale@gag.com, 5 November 2000
+#      Cleanup by Thorsten Glaser, tg@debian.org, 20 June 2012
+#      based on the rules file of the jupp package
 
 # Comment this to turn off debhelper verbose mode.
 export DH_VERBOSE=1
 
-DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
+shellescape='$(subst ','\'',$(1))'
+shellexport=$(1)=$(call shellescape,${$(1)})
+
+DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+# Automatic ${CC} selection for cross-compiles
+
+# is ${CC} defined anywhere (other than implicit rules?)
+ifneq (,$(findstring $(origin CC),default undefined))
+# no - then default to gcc (or cross-gcc)
+ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+CC=                    ${DEB_HOST_GNU_TYPE}-gcc
+else
+CC=                    gcc
 endif
+endif
+
+EXTRA_CFLAGS=          -Wall
+EXTRA_CPPFLAGS=
 
-CFLAGS = `dpkg-buildflags --get CFLAGS`
-CFLAGS += -Wall
-LDFLAGS = `dpkg-buildflags --get LDFLAGS`
-CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
+ifeq (${DEB_HOST_ARCH},amd64)
+EXTRA_CPPFLAGS+=       -DUNALIGNED_OK
+endif
 
-ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),amd64)
-CFLAGS += -DUNALIGNED_OK
+# Automatic dpkg-buildflags selection, backport-friendly
+
+ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk))
+# dpkg-dev (>= 1.16.1~)
+DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS}
+DEB_CPPFLAGS_MAINT_APPEND=${EXTRA_CPPFLAGS}
+# maybe turn this on later
+#DEB_BUILD_MAINT_OPTIONS=hardening=+all
+include /usr/share/dpkg/buildflags.mk
+else
+# old-fashioned way to determine build flags
+CFLAGS=                        -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
+CFLAGS+=               ${EXTRA_CFLAGS}
+LDFLAGS+=              ${EXTRA_LDFLAGS}
+endif
+
+# maybe turn this on later
+#ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+#NUMJOBS=              $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+#MAKEFLAGS+=           -j${NUMJOBS}
+#endif
+
+# whitespace-safe path to source directory
+_topdir=$(call shellescape,$(shell pwd))
+
+CONFIGURE_ARGS=                --prefix=/usr \
+                       --bindir=/bin \
+                       --infodir=${_topdir}/debian/gzip/usr/share/info \
+                       --mandir=${_topdir}/debian/gzip/usr/share/man
+
+ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+CONFIGURE_ARGS+=       --host=${DEB_HOST_GNU_TYPE}
 endif
 
 reconf-stamp:
        cp -f /usr/share/misc/config.sub build-aux/config.sub
        cp -f /usr/share/misc/config.guess build-aux/config.guess
        autoreconf -v
-       touch $@
+       :>$@
 
 configure: configure-stamp
 configure-stamp: reconf-stamp
        dh_testdir
-       mkdir -p build
-       cd build && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure \
-               --prefix=/usr --bindir=/bin \
-               --infodir=`pwd`/debian/gzip/usr/share/info \
-               --mandir=`pwd`/debian/gzip/usr/share/man $(CONFARGS)
-       touch $@
+       mkdir -p builddir
+       cd builddir && env \
+           $(foreach i,CC CFLAGS CPPFLAGS LDFLAGS,$(call shellexport,$i)) \
+           ../configure ${CONFIGURE_ARGS}
+       :>$@
 
 configure-indep: configure-indep-stamp
 configure-indep-stamp: reconf-stamp
        dh_testdir
-       mkdir -p build-indep
-       cd build-indep && ../configure --host=i686-w64-mingw32
-       touch $@
+       mkdir -p builddir-indep
+       cd builddir-indep && ../configure --host=i686-w64-mingw32
+       :>$@
 
-build: build-arch build-indep
+build: build-stamp build-indep-stamp
 
-build-arch: build-stamp 
+build-arch: build-stamp
 build-stamp: configure-stamp
        dh_testdir
-       $(MAKE) -C build
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-       $(MAKE) -C build check
+       ${MAKE} -C builddir
+ifeq (,$(filter nocheck,${DEB_BUILD_OPTIONS}))
+ifeq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
+       ${MAKE} -C builddir check
 endif
 endif
-       touch $@
+       :>$@
 
 build-indep: build-indep-stamp
 build-indep-stamp: configure-indep-stamp
        dh_testdir
-       $(MAKE) -C build-indep
-       touch $@
+       ${MAKE} -C builddir-indep
+       :>$@
 
 clean:
        dh_testdir
        dh_testroot
        -rm -f build-stamp build-indep-stamp configure-stamp configure-indep-stamp reconf-stamp
-       -rm -rf build build-indep
+       -rm -rf builddir builddir-indep
        dh_clean
 
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k
-       dh_installdirs
-       $(MAKE) -C build install prefix=`pwd`/debian/gzip/usr bindir=`pwd`/debian/gzip/bin 
+binary: binary-arch binary-indep
 
-install-indep: build-indep
+binary-indep: build-indep-stamp
        dh_testdir
        dh_testroot
-       dh_clean -k
+       if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi
        dh_installdirs
-       i686-w64-mingw32-strip build-indep/gzip.exe
-       install -m 0755 build-indep/gzip.exe debian/gzip-win32/usr/share/win32/
-
-binary-indep:  build-indep install-indep
-       dh_testdir -i
-       dh_testroot -i
+       i686-w64-mingw32-strip builddir-indep/gzip.exe
+       install -m 0755 builddir-indep/gzip.exe \
+           debian/gzip-win32/usr/share/win32/
        dh_installdocs -i README* TODO
        dh_installchangelogs -i ChangeLog
        dh_lintian -i
@@ -97,7 +135,14 @@ binary-indep:       build-indep install-indep
        dh_md5sums -i
        dh_builddeb -i
 
-binary-arch:   build install
+binary-arch: build-stamp
+       dh_testdir
+       dh_testroot
+       if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi
+       dh_installdirs
+       ${MAKE} -C builddir install \
+           prefix=${_topdir}/debian/gzip/usr \
+           bindir=${_topdir}/debian/gzip/bin
        dh_testdir -s
        dh_testroot -s
        dh_installdocs -s README* TODO
@@ -112,7 +157,6 @@ binary-arch:        build install
        ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zegrep.1.gz
        ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz
        dh_fixperms -s
-       # You may want to make some executables suid here.
        dh_makeshlibs -s
        dh_installdeb -s
        dh_shlibdeps -s
@@ -120,7 +164,5 @@ binary-arch:        build install
        dh_md5sums -s
        dh_builddeb -s
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
-.PHONY: build-indep install-indep configure-indep
-
+.PHONY: binary binary-arch binary-indep build build-arch build-indep clean
+.PHONY: configure configure-indep