X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=debian%2Frules;h=7c2f21c0ca2b40c85364f7ca9332ebba08fea9c1;hb=3b3e11a0be384ef9fe2f7e08c6fe1b6f125d0543;hp=54246aecdd2afdbe506079dd2f76cae1a49d8951;hpb=fce80dc672b097f56efe25cf2b4ad5ac018ea70e;p=debian%2Ftar diff --git a/debian/rules b/debian/rules index 54246aec..7c2f21c0 100755 --- a/debian/rules +++ b/debian/rules @@ -6,47 +6,78 @@ ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) CONFARGS = --host=$(DEB_HOST_GNU_TYPE) endif +CFLAGS = `dpkg-buildflags --get CFLAGS` +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 - RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall" \ - ./configure --prefix=/usr --libexecdir=/usr/sbin $(CONFARGS) + 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 -build: build-stamp +build: build-arch build-indep +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)) - (cd tests ; $(MAKE) clean) - $(MAKE) check + @runas=`whoami` ; \ + if test $$runas = "root" ; \ + then \ + echo "Sorry, but the test suite is not designed to be run as root."; \ + exit 1 ;\ + fi + $(MAKE) check || { cat tests/testsuite.log; false; } 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 \ - libexecdir=`pwd`/debian/tar/usr/sbin + libexecdir=`pwd`/debian/tar/usr/lib/tar install -m 755 debian/rmt.sh debian/tar/etc/rmt - mv debian/tar/usr/sbin/rmt debian/tar/usr/sbin/rmt-tar + mv debian/tar/usr/lib/tar/rmt debian/tar/usr/sbin/rmt-tar + install -m 755 debian/tarcat debian/tar/usr/sbin/tarcat + + mv debian/tar/usr/sbin/backup debian/tar-scripts/usr/sbin/tar-backup + mv debian/tar/usr/sbin/restore debian/tar-scripts/usr/sbin/tar-restore + mv debian/tar/usr/lib/tar/backup.sh debian/tar-scripts/usr/lib/tar/ + mv debian/tar/usr/lib/tar/dump-remind debian/tar-scripts/usr/lib/tar/ # Build architecture-independent files here. binary-indep: build install @@ -63,7 +94,7 @@ binary-arch: build install dh_installexamples dh_installmenu dh_installcron - dh_installman debian/tar.1 debian/rmt.8 + 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