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