Make the debian/rules a bit more modern
authorPierre Habouzit <madcoder@debian.org>
Mon, 26 Nov 2007 15:14:07 +0000 (16:14 +0100)
committerPierre Habouzit <madcoder@debian.org>
Mon, 26 Nov 2007 15:14:40 +0000 (16:14 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
debian/rules
debian/xinetd.defaults [moved from debian/xinetd-default with 100% similarity]
debian/xinetd.dirs [new file with mode: 0644]
debian/xinetd.install [new file with mode: 0644]

index f9c2355..621f59b 100644 (file)
@@ -1,63 +1,96 @@
 #!/usr/bin/make -f
-#export DH_VERBOSE=1
 
+CFLAGS=-Wall -Wextra -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
 tmp = $(CURDIR)/debian/xinetd
 
+srcpkg = $(shell dpkg-parsechangelog | sed -ne 's/Source: *//p')
+srcver = $(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-[0-9]*$$/\1/p')
+pkgdir = '$(CURDIR)'/debian/xinetd
+#{{{ generic rules
+
+../$(srcpkg)_$(srcver).orig.tar.gz:
+       @if git rev-parse --git-dir >/dev/null 2>&1; then                 \
+           echo -n 'Regenerating $(@F)';                                 \
+           git show pristine-tar:$(@F).delta | pristine-tar gentar - $@; \
+           echo .;                                                       \
+       fi
+
+check-tarball: ../$(srcpkg)_$(srcver).orig.tar.gz
+
+.PHONY: check-tarball
+
+#}}}
+#{{{ maintainer stuff
+
+refresh-patches: check-tarball
+       @dh_testdir
+       @echo 'refreshing debian/patches:'
+       @rm -rf '$(CURDIR)'/debian/patches
+       @mkdir -p '$(CURDIR)'/debian/patches
+       @cd '$(CURDIR)'/debian/patches && git format-patch upstream..upstream+patches
+       @echo .
+
+#}}}
+
+patch: patch-stamp check-tarball
+patch-stamp:
+       dh_testdir
+       set -e; test -e patch-stamp || \
+           for i in `ls -1 debian/patches/*.patch || :`; do patch -p1 <$$i > /dev/null; done
+       touch $@
+
+unpatch:
+       dh_testdir
+       set -e; ! test -e patch-stamp || \
+           for i in `ls -1r debian/patches/*.patch || :`; do patch -p1 -R <$$i > /dev/null; done
+       rm -f patch-stamp
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
        chmod -R a=rX,u=rwX .
-
-       CFLAGS="-O2" ./configure \
-               --with-loadavg \
-               --with-libwrap \
-               --prefix=/usr \
-               --mandir='$${prefix}/share/man'
-       touch configure-stamp
+       CFLAGS="-O2" ./configure --prefix=/usr             \
+              --mandir=\$${prefix}/share/man              \
+              --infodir=\$${prefix}/share/info            \
+              --host=$(DEB_HOST_GNU_TYPE)                 \
+              --build=$(DEB_BUILD_GNU_TYPE)               \
+              \
+              --with-loadavg          \
+              --with-libwrap
+       touch $@
 
 build: configure-stamp build-stamp
 build-stamp:
        dh_testdir
        $(MAKE)
+       touch $@
 
-       touch build-stamp
-
-clean:
+clean: unpatch
        dh_testdir
        dh_testroot
+       ! test -e Makefile || $(MAKE) distclean
        rm -f build-stamp configure-stamp
-       -$(MAKE) distclean
        dh_clean
 
 install: build
        dh_testdir
        dh_testroot
        dh_clean -k
-
-       $(MAKE) install prefix=$(tmp)/usr
+       dh_installdirs
+       $(MAKE) install prefix=$(pkgdir)
+       mv $(pkgdir)/etc/xinetd.d/xinetd.conf $(pkgdir)/etc/
 
 binary-indep: build install
 
 binary-arch: build install
        dh_testdir
        dh_testroot
-
        dh_installchangelogs CHANGELOG
        dh_installdocs README debian/README.update-inetd debian/xinetd.org-FAQ.html
        dh_installexamples xinetd/sample.conf
        dh_installinit -r
-
-       install -m755 -o0 -g0 -d $(tmp)/etc/xinetd.d
-       install -m755 -o0 -g0 -d $(tmp)/etc/default
-       install -m644 -o0 -g0 debian/conffiles/* \
-               $(tmp)/etc/xinetd.d
-       
-       install -m644 -o0 -g0 debian/xinetd-default \
-               $(tmp)/etc/default/xinetd
-       
-       mv $(tmp)/etc/xinetd.d/xinetd.conf $(tmp)/etc/
-       
        dh_installdebconf
+       dh_install
        dh_strip
        dh_compress
        dh_fixperms
similarity index 100%
rename from debian/xinetd-default
rename to debian/xinetd.defaults
diff --git a/debian/xinetd.dirs b/debian/xinetd.dirs
new file mode 100644 (file)
index 0000000..e831ff1
--- /dev/null
@@ -0,0 +1 @@
+etc/xinetd.d
diff --git a/debian/xinetd.install b/debian/xinetd.install
new file mode 100644 (file)
index 0000000..b436e37
--- /dev/null
@@ -0,0 +1 @@
+debian/conffiles/*     etc/xinetd.d