update standards version, move to dh_prep instead of dh_clean -k
[debian/tar] / debian / rules
index 5ab1d39a84da58d0ab4e8e756b425635cfa0f41b..6ed8fe2060cf0ee32c0e48594079e16f33de9433 100755 (executable)
@@ -11,16 +11,25 @@ CFLAGS += -Wall
 LDFLAGS += `dpkg-buildflags --get LDFLAGS`
 CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
 
+export BUILD_DATE = $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  MAKEFLAGS += -j$(NUMJOBS)
+endif
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
        cp -f /usr/share/misc/config.sub build-aux/config.sub
        cp -f /usr/share/misc/config.guess build-aux/config.guess
+       autoreconf --force -v --install
        RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
                --prefix=/usr \
                --libexecdir=/usr/lib/tar \
                --enable-backup-scripts \
                --with-lzma=xz \
+               --disable-silent-rules \
                $(CONFARGS) 
        touch configure-stamp
 
@@ -29,7 +38,8 @@ build-arch: build-stamp
 build-indep: build-stamp
 build-stamp: configure-stamp
        dh_testdir
-       RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall -fno-gnu89-inline" $(MAKE)
+       RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
+               LDFLAGS="$(LDFLAGS)" $(MAKE) $(MAKEFLAGS)
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
@@ -43,20 +53,19 @@ ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 endif
 endif
 
-       perl debian/tarman > debian/tar.1
        touch build-stamp
 
 clean:
        dh_testdir
        dh_testroot
-       rm -f build-stamp configure-stamp debian/tar.1
+       rm -f build-stamp configure-stamp
        [ ! -f Makefile ] || $(MAKE) distclean
        dh_clean
 
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
        dh_installdirs
 
        make install bindir=`pwd`/debian/tar/bin prefix=`pwd`/debian/tar/usr \
@@ -85,7 +94,7 @@ binary-arch: build install
        dh_installexamples
        dh_installmenu
        dh_installcron
-       dh_installman debian/tar.1 debian/rmt.8 debian/tarcat.1
+       dh_installman doc/tar.1 doc/rmt.8 debian/tarcat.1
        mv debian/tar/usr/share/man/man8/rmt.8 \
           debian/tar/usr/share/man/man8/rmt-tar.8
        dh_installinfo