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