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