]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/rules
Imported Debian patch 1.2.0-3
[nfs-utils.git] / debian / rules
index 663e711c7bd42246de209fecd83df7ea64eee610..2bd4939551392df9945d1dec60e51c3e91200aa4 100755 (executable)
@@ -2,16 +2,29 @@
 
 include /usr/share/quilt/quilt.make
 
+# Parsing of DEB_BUILD_OPTIONS flags.
+# Note that nostrip is handled automatically by debhelper.
+CFLAGS := -g -Wall
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+    CFLAGS += -O0
+else
+    CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+    MAKEFLAGS += -j$(NUMJOBS)
+endif
+
 # Temporary root
 DEBTMP := $(CURDIR)/debian/tmp
 
 build: patch build-stamp
 build-stamp:
        dh_testdir
-       CFLAGS="-g -O2 -Wall" ./configure \
+       CFLAGS="$(CFLAGS)" ./configure \
                --mandir='$${prefix}/share/man' \
-               --enable-secure-statd 
-       $(MAKE)
+               --with-tcp-wrappers
+       $(MAKE) $(MAKEFLAGS)
        touch build-stamp
 
 clean: unpatch
@@ -19,8 +32,7 @@ clean: unpatch
        dh_testroot
        rm -f build-stamp
        rm -rf $(DEBTMP)
-       -$(MAKE) distclean
-       $(RM) utils/rquotad/rquota.h utils/rquotad/rquota_xdr.c
+       [ ! -f Makefile ] || $(MAKE) distclean
        dh_clean
 
 binary-indep: build
@@ -42,6 +54,7 @@ binary-arch: build
        dh_strip
        dh_compress
        dh_fixperms
+       chmod u+s debian/nfs-common/sbin/mount.nfs
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol