f3532ed877ad86f8d1dad63f78af42d50a10e308
[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 DEB_BUILD_GNU_TYPE      := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
7 DEB_HOST_GNU_TYPE       := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_HOST_ARCH           := $(shell dpkg-architecture -qDEB_HOST_ARCH)
9 DEB_HOST_ARCH_OS        := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
10
11 # Temporary root
12 DEBTMP  := $(shell pwd)/debian/tmp
13
14 build: build-stamp
15 build-stamp:
16         dh_testdir
17 ifeq ($(DEB_HOST_ARCH),ia64)
18         patch -p1 < debian/bzero.patch
19 endif
20         CFLAGS="-g -Wall" ./configure \
21                 --mandir='$${prefix}/share/man' \
22                 --enable-secure-statd 
23         $(MAKE)
24         touch build-stamp
25
26 clean:
27         dh_testdir
28         dh_testroot
29         rm -f build-stamp
30         rm -rf $(DEBTMP)
31         -$(MAKE) distclean
32         dh_clean
33
34 binary-indep: build
35 binary-arch: build
36         dh_testdir
37         dh_testroot
38         dh_clean -k
39         dh_installdirs
40         mkdir $(DEBTMP)
41         $(MAKE) DESTDIR='$(DEBTMP)' install
42         dh_install
43         
44         # Fix up the manpages
45         for f in lockd statd showmount; do \
46           perl -pi -e "s#/usr(/sbin/(rpc\\.)?$$f)#\$$1#g" \
47             debian/tmp/usr/share/man/man8/$$f.8; \
48         done;
49         
50         dh_installdocs -A
51         dh_installdocs -pnfs-common debian/README.Debian.nfsv4
52         install -m 0755 debian/nfs-common.init debian/nfs-common/etc/init.d/nfs-common
53         install -m 0755 debian/nfs-kernel-server.init debian/nfs-kernel-server/etc/init.d/nfs-kernel-server
54         dh_installman
55         dh_link
56         dh_installchangelogs ChangeLog
57         dh_strip
58         dh_compress
59         dh_fixperms
60         dh_installdeb
61         dh_shlibdeps
62         dh_gencontrol
63         dh_md5sums
64         dh_builddeb
65
66 binary: binary-indep binary-arch
67 .PHONY: build clean binary-indep binary-arch binary