Imported Debian patch 1.0.7-18
[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                 tmp/usr/share/man/man8/$$f.8; \
59           done;
60         # Fixups End Here #
61         
62         # Move all files that will be managed by ucf
63         install -m 0644 debian/idmapd.conf debian/nfs-common/usr/share/nfs-common/conffiles/
64         install -m 0644 debian/gssapi_mech.conf debian/nfs-common/usr/share/nfs-common/conffiles/
65         install -m 0644 debian/nfs-common.default debian/nfs-common/usr/share/nfs-common/conffiles/
66         install -m 0644 debian/nfs-kernel-server.default debian/nfs-kernel-server/usr/share/nfs-kernel-server/conffiles/
67         install -m 0644 debian/etc.exports debian/nfs-kernel-server/usr/share/nfs-kernel-server/conffiles/
68         
69         install -m 0644 debian/idmapd.conf.md5sum debian/nfs-common/usr/share/nfs-common/conffiles/
70         install -m 0644 debian/gssapi_mech.conf.md5sum debian/nfs-common/usr/share/nfs-common/conffiles/
71         install -m 0644 debian/nfs-common.default.md5sum debian/nfs-common/usr/share/nfs-common/conffiles/
72         install -m 0644 debian/nfs-kernel-server.default.md5sum debian/nfs-kernel-server/usr/share/nfs-kernel-server/conffiles/
73         install -m 0644 debian/etc.exports.md5sum debian/nfs-kernel-server/usr/share/nfs-kernel-server/conffiles/
74         
75         dh_installdocs -A
76         dh_installdocs -pnfs-common debian/README.Debian.nfsv4
77         install -m 0755 debian/nfs-common.init debian/nfs-common/etc/init.d/nfs-common
78         install -m 0755 debian/nfs-kernel-server.init debian/nfs-kernel-server/etc/init.d/nfs-kernel-server
79         dh_installman
80         dh_link
81         dh_installchangelogs ChangeLog
82         dh_strip
83         dh_compress
84         dh_fixperms
85         dh_installdeb
86         dh_shlibdeps
87         dh_gencontrol
88         dh_md5sums
89         dh_builddeb
90
91 binary: binary-indep binary-arch
92 .PHONY: build clean binary-indep binary-arch binary