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