]> git.cworth.org Git - tar/blob - debian/rules
Respect DEB_BUILD_OPTIONS=nocheck to conform with Debian Policy 3.8.2
[tar] / debian / rules
1 #!/usr/bin/make -f
2
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)
7 endif
8
9 configure: configure-stamp
10 configure-stamp:
11         dh_testdir
12         cp -f /usr/share/misc/config.sub build-aux/config.sub
13         cp -f /usr/share/misc/config.guess build-aux/config.guess
14         RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall" \
15                 ./configure --prefix=/usr --libexecdir=/usr/sbin $(CONFARGS)
16         touch configure-stamp
17
18 build: build-stamp
19 build-stamp: configure-stamp
20         dh_testdir
21         RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall -fno-gnu89-inline" $(MAKE)
22
23 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
24 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
25         (cd tests ; $(MAKE) clean)
26         $(MAKE) check
27 endif
28 endif
29
30         perl debian/tarman > debian/tar.1
31         touch build-stamp
32
33 clean:
34         dh_testdir
35         dh_testroot
36         rm -f build-stamp configure-stamp debian/tar.1
37         [ ! -f Makefile ] || $(MAKE) distclean
38         dh_clean
39
40 install: build
41         dh_testdir
42         dh_testroot
43         dh_clean -k
44         dh_installdirs
45
46         make install bindir=`pwd`/debian/tar/bin prefix=`pwd`/debian/tar/usr \
47                 libexecdir=`pwd`/debian/tar/usr/sbin 
48         install -m 755 debian/rmt.sh debian/tar/etc/rmt
49         mv debian/tar/usr/sbin/rmt debian/tar/usr/sbin/rmt-tar
50
51 # Build architecture-independent files here.
52 binary-indep: build install
53
54 # Build architecture-dependent files here.
55 binary-arch: build install
56         dh_testdir
57         dh_testroot
58         dh_installdocs
59         mv -f debian/tar/usr/share/doc/tar/ChangeLog \
60                 debian/tar/usr/share/doc/tar/changelog
61         mv -f debian/tar/usr/share/doc/tar/ChangeLog.1 \
62                 debian/tar/usr/share/doc/tar/changelog.1
63         dh_installexamples
64         dh_installmenu
65         dh_installcron
66         dh_installman debian/tar.1 debian/rmt.8
67         mv debian/tar/usr/share/man/man8/rmt.8 \
68            debian/tar/usr/share/man/man8/rmt-tar.8
69         dh_installinfo
70         rm -f debian/tar/usr/share/info/dir*
71         dh_installmime
72         dh_installchangelogs #CHANGELOGS#
73         dh_link
74         dh_strip
75         dh_compress
76         dh_fixperms
77         dh_installdeb
78         dh_shlibdeps
79         dh_gencontrol
80         dh_md5sums
81         dh_builddeb
82
83 binary: binary-indep binary-arch
84 .PHONY: build clean binary-indep binary-arch binary install configure