Code

Added ne_lfs.dpatch.
[pkg-fusedav.git] / debian / rules
index fa2988fdaeff49df44c7f44e259f07b4dacdfdcd..01227dca4d6617e1133765f7700f201d9f5e00d3 100755 (executable)
@@ -13,43 +13,48 @@ DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 CFLAGS = -Wall -g
 
+BUILDDIR = ./debian/build/
+
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
 else
        CFLAGS += -O2
 endif
 
-config.status: configure
+include /usr/share/dpatch/dpatch.make
+
+$(BUILDDIR)/config.status: configure
        dh_testdir
-       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
+       [ -e $(BUILDDIR) ] || mkdir $(BUILDDIR)
+       cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" ../../configure \
+                       --host=$(DEB_HOST_GNU_TYPE) \
                        --build=$(DEB_BUILD_GNU_TYPE) \
                        --prefix=/usr
 
 build: build-stamp
 
-build-stamp: config.status
+build-stamp: $(BUILDDIR)/config.status patch
        dh_testdir
        
-       $(MAKE)
+       $(MAKE) -C $(BUILDDIR)
        
        touch build-stamp
 
-clean:
+clean: unpatch
        dh_testdir
        dh_testroot
-       rm -f build-stamp 
-       rm -f config.sub config.guess
+       rm -f build-stamp
        
-       -$(MAKE) distclean
+       rm -rf $(BUILDDIR)
        
-       dh_clean 
+       dh_clean
 
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k 
+       dh_clean -k
        
-       $(MAKE) install DESTDIR=$(CURDIR)/debian/fusedav
+       $(MAKE) -C $(BUILDDIR) install DESTDIR=$(CURDIR)/debian/fusedav
 
 binary-indep:
        # nothing to do here
@@ -57,7 +62,7 @@ binary-indep:
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs 
+       dh_installchangelogs
        dh_installdocs README
        dh_installman debian/fusedav.1
        dh_link
@@ -71,5 +76,5 @@ binary-arch: build install
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: build clean binary-indep binary-arch binary install