lintian cleanups
[debian/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" ./configure \
15                 --prefix=/usr \
16                 --libexecdir=/usr/sbin \
17                 --with-lzma=xz \
18                 $(CONFARGS) 
19         touch configure-stamp
20
21 build: build-arch build-indep
22 build-arch: build-stamp
23 build-indep: build-stamp
24 build-stamp: configure-stamp
25         dh_testdir
26         RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall -fno-gnu89-inline" $(MAKE)
27
28 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
29 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
30         @runas=`whoami` ; \
31         if test $$runas = "root" ; \
32         then \
33           echo "Sorry, but the test suite is not designed to be run as root."; \
34           exit 1 ;\
35         fi
36         (cd tests ; $(MAKE) clean)
37         $(MAKE) check
38 endif
39 endif
40
41         perl debian/tarman > debian/tar.1
42         touch build-stamp
43
44 clean:
45         dh_testdir
46         dh_testroot
47         rm -f build-stamp configure-stamp debian/tar.1
48         [ ! -f Makefile ] || $(MAKE) distclean
49         dh_clean
50
51 install: build
52         dh_testdir
53         dh_testroot
54         dh_clean -k
55         dh_installdirs
56
57         make install bindir=`pwd`/debian/tar/bin prefix=`pwd`/debian/tar/usr \
58                 libexecdir=`pwd`/debian/tar/usr/sbin 
59         install -m 755 debian/rmt.sh debian/tar/etc/rmt
60         mv debian/tar/usr/sbin/rmt debian/tar/usr/sbin/rmt-tar
61
62 # Build architecture-independent files here.
63 binary-indep: build install
64
65 # Build architecture-dependent files here.
66 binary-arch: build install
67         dh_testdir
68         dh_testroot
69         dh_installdocs
70         mv -f debian/tar/usr/share/doc/tar/ChangeLog \
71                 debian/tar/usr/share/doc/tar/changelog
72         mv -f debian/tar/usr/share/doc/tar/ChangeLog.1 \
73                 debian/tar/usr/share/doc/tar/changelog.1
74         dh_installexamples
75         dh_installmenu
76         dh_installcron
77         dh_installman debian/tar.1 debian/rmt.8
78         mv debian/tar/usr/share/man/man8/rmt.8 \
79            debian/tar/usr/share/man/man8/rmt-tar.8
80         dh_installinfo
81         rm -f debian/tar/usr/share/info/dir*
82         dh_installmime
83         dh_installchangelogs #CHANGELOGS#
84         dh_link
85         dh_strip
86         dh_compress
87         dh_fixperms
88         dh_installdeb
89         dh_shlibdeps
90         dh_gencontrol
91         dh_md5sums
92         dh_builddeb
93
94 binary: binary-indep binary-arch
95 .PHONY: build clean binary-indep binary-arch binary install configure