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