Imported Debian patch 1.0.7-5
[nfs-utils.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
3
4 export DH_VERBOSE=1
5
6 # Temporary root
7 DEBTMP  := $(shell pwd)/debian/tmp
8
9 build: build-stamp
10 build-stamp:
11         # Debian source diffs don't reflect removals.
12         # This kludge will suffice until the next upstream version. *sigh*
13         rm -f debian/nfs-common.conffiles       \
14               debian/nfs-common.config          \
15               debian/nfs-common.files           \
16               debian/nfs-common.templates       \
17               debian/nfs-kernel-server.conffiles\
18               debian/nfs-kernel-server.config   \
19               debian/nfs-kernel-server.templates\
20               debian/nhfsstone.files
21
22         dh_testdir
23         -test -r /usr/share/misc/config.sub && cp -f /usr/share/misc/config.sub config.sub
24         -test -r /usr/share/misc/config.guess && cp -f /usr/share/misc/config.guess config.guess
25         autoconf
26         ./configure \
27                 --mandir='$${prefix}/share/man' \
28                 --enable-secure-statd
29         $(MAKE)
30         touch build-stamp
31
32 clean:
33         dh_testdir
34         dh_testroot
35         rm -f build-stamp
36         rm -rf $(DEBTMP)
37         # Add here commands to clean up after the build process.
38         -test -r /usr/share/misc/config.sub && rm -f config.sub
39         -test -r /usr/share/misc/config.guess && rm -f config.guess
40         -$(MAKE) distclean
41         rm -f config.log configure
42         dh_clean
43
44 binary-indep: build
45 binary-arch: build
46         dh_testdir
47         dh_testroot
48         dh_clean -k
49         dh_installdirs
50         mkdir $(DEBTMP)
51         # Add here commands to install the files into debian/tmp
52         $(MAKE) install_prefix='$(DEBTMP)' install
53         dh_install --sourcedir=debian/tmp/
54         # Fixups Start Here #
55         cd debian && \
56           for f in lockd statd showmount; do \
57             perl -pi -e "s#/usr(/sbin/(rpc\\.)?$$f)#\$$1#g" \
58                 nfs-common/usr/share/man/man8/$$f.8; \
59           done; \
60           cp --preserve=timestamps etc.exports nfs-kernel-server/etc/exports; \
61           cp --preserve=timestamps idmapd.conf nfs-common/etc/; \
62           cp --preserve=timestamps gssapi_mech.conf nfs-common/etc/; \
63         # Fixups End Here #
64         dh_installdocs -A
65         dh_installexamples
66         dh_installinit -n
67         dh_installman
68         dh_link
69         dh_installchangelogs ChangeLog
70         dh_strip
71         dh_compress
72         dh_fixperms
73         dh_installdeb
74         dh_shlibdeps
75         dh_gencontrol
76         dh_md5sums
77         dh_builddeb
78
79 binary: binary-indep binary-arch
80 .PHONY: build clean binary-indep binary-arch binary