3 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
4 DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
5 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
6 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
9 CFLAGS = `dpkg-buildflags --get CFLAGS`
11 LDFLAGS += `dpkg-buildflags --get LDFLAGS`
12 CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
14 export BUILD_DATE = $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18 MAKEFLAGS += -j$(NUMJOBS)
21 configure: configure-stamp
24 cp -f /usr/share/misc/config.sub build-aux/config.sub
25 cp -f /usr/share/misc/config.guess build-aux/config.guess
26 autoreconf --force -v --install
27 RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
29 --libexecdir=/usr/lib/tar \
30 --enable-backup-scripts \
32 --disable-silent-rules \
36 build: build-arch build-indep
37 build-arch: build-stamp
38 build-indep: build-stamp
39 build-stamp: configure-stamp
41 RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
42 LDFLAGS="$(LDFLAGS)" $(MAKE) $(MAKEFLAGS)
44 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
45 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
47 if test $$runas = "root" ; \
49 echo "Sorry, but the test suite is not designed to be run as root."; \
52 $(MAKE) check || { cat tests/testsuite.log; false; }
61 rm -f build-stamp configure-stamp
62 [ ! -f Makefile ] || $(MAKE) distclean
71 make install bindir=`pwd`/debian/tar/bin prefix=`pwd`/debian/tar/usr \
72 libexecdir=`pwd`/debian/tar/usr/lib/tar
73 install -m 755 debian/rmt.sh debian/tar/etc/rmt
74 mv debian/tar/usr/lib/tar/rmt debian/tar/usr/sbin/rmt-tar
75 install -m 755 debian/tarcat debian/tar/usr/sbin/tarcat
77 mv debian/tar/usr/sbin/backup debian/tar-scripts/usr/sbin/tar-backup
78 mv debian/tar/usr/sbin/restore debian/tar-scripts/usr/sbin/tar-restore
79 mv debian/tar/usr/lib/tar/backup.sh debian/tar-scripts/usr/lib/tar/
80 mv debian/tar/usr/lib/tar/dump-remind debian/tar-scripts/usr/lib/tar/
82 # Build architecture-independent files here.
83 binary-indep: build install
85 # Build architecture-dependent files here.
86 binary-arch: build install
90 mv -f debian/tar/usr/share/doc/tar/ChangeLog \
91 debian/tar/usr/share/doc/tar/changelog
92 mv -f debian/tar/usr/share/doc/tar/ChangeLog.1 \
93 debian/tar/usr/share/doc/tar/changelog.1
97 dh_installman doc/tar.1 doc/rmt.8 debian/tarcat.1
98 mv debian/tar/usr/share/man/man8/rmt.8 \
99 debian/tar/usr/share/man/man8/rmt-tar.8
101 rm -f debian/tar/usr/share/info/dir*
103 dh_installchangelogs #CHANGELOGS#
114 binary: binary-indep binary-arch
115 .PHONY: build clean binary-indep binary-arch binary install configure