For info, attached is a patch (relative to cryptmount-5.1-1)
which I believe fixes the automake issue, as well as the outstanding
lintian warnings.

diff --git a/debian/changelog b/debian/changelog
index 86f7fa1..eba7e8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+cryptmount (5.1-2) unstable; urgency=medium
+
+  * Patched installation path for cryptmount.service to be beneath /lib/systemd
+
+  * Improved postinst/postrm support for systemd
+
+  * Removed duplicated example configuration file
+
+  * Rebuilt debian/rules script to use debhelper v7 and dh_autoreconf
+
+ -- RW Penney <rwpen...@users.sourceforge.net>  Sun, 26 Jul 2015 12:00:00 +0000
+
 cryptmount (5.1-1) unstable; urgency=low
 
   * Updated to version 5.1 of upstream package
diff --git a/debian/control b/debian/control
index 10ec589..50e11b6 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: extra
 Maintainer: RW Penney <rwpen...@users.sourceforge.net>
 Homepage: http://cryptmount.sourceforge.net
 Build-Depends: debhelper (>= 9.0.0), dpkg-dev (>=1.16.1),
-            automake, autotools-dev,
+            automake, dh-autoreconf,
             libcryptsetup-dev (>= 1.6), libdevmapper-dev,
             libgcrypt20-dev (>= 1.5), pkg-config
 Standards-Version: 3.9.6
diff --git a/debian/cryptmount.lintian-overrides b/debian/cryptmount.lintian-overrides
new file mode 100644
index 0000000..698a82d
--- /dev/null
+++ b/debian/cryptmount.lintian-overrides
@@ -0,0 +1,4 @@
+# lintian-override for cryptmount
+
+# cryptmount needs to have setuid privileges to be usable by ordinary users:
+cryptmount: setuid-binary usr/bin/cryptmount 4755 root/root
diff --git a/debian/dirs b/debian/dirs
index e453b9c..fa9d077 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,7 +1,6 @@
 etc/cryptmount
-etc/init.d
 etc/modules-load.d
-usr/lib/systemd/system
+lib/systemd/system
 usr/share/doc/cryptmount/examples
 usr/share/man
 usr/share/lintian/overrides
diff --git a/debian/lintian-override b/debian/lintian-override
deleted file mode 100644
index 698a82d..0000000
--- a/debian/lintian-override
+++ /dev/null
@@ -1,4 +0,0 @@
-# lintian-override for cryptmount
-
-# cryptmount needs to have setuid privileges to be usable by ordinary users:
-cryptmount: setuid-binary usr/bin/cryptmount 4755 root/root
diff --git a/debian/patches/autotools-fixes.patch b/debian/patches/autotools-fixes.patch
new file mode 100644
index 0000000..90e16e2
--- /dev/null
+++ b/debian/patches/autotools-fixes.patch
@@ -0,0 +1,38 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -5,7 +5,6 @@
+ 		-DCM_SYSRUN_DIR="\"$(CM_SYSRUN_DIR)\"" \
+ 		-DCM_MODULE_DIR="\"$(pkglibdir)\""
+ 
+-ACLOCAL_AMFLAGS = #-I m4
+ bin_PROGRAMS=cryptmount
+ cryptmount_SOURCES=cryptmount.c cryptmount.h \
+ 	armour.c armour.h \
+@@ -30,7 +29,7 @@
+ EXTRA_DIST = config.rpath mkinstalldirs cmtab.example \
+ 	README.OpenSSL RELNOTES ToDo cryptmount.spec \
+ 	debian/changelog debian/compat debian/control debian/copyright \
+-	debian/dirs debian/docs debian/rules debian/lintian-override \
++	debian/dirs debian/docs debian/rules debian/cryptmount.lintian-overrides \
+ 	debian/postinst debian/postrm debian/watch debian/source/format \
+ 	debian/upstream/signing-key.asc
+ 
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -358,7 +358,6 @@
+ 		-DCM_SYSRUN_DIR="\"$(CM_SYSRUN_DIR)\"" \
+ 		-DCM_MODULE_DIR="\"$(pkglibdir)\""
+ 
+-ACLOCAL_AMFLAGS = #-I m4
+ cryptmount_SOURCES = cryptmount.c cryptmount.h \
+ 	armour.c armour.h \
+ 	armour-builtin.c armour-gcry.c armour-luks.c \
+@@ -376,7 +375,7 @@
+ EXTRA_DIST = config.rpath mkinstalldirs cmtab.example \
+ 	README.OpenSSL RELNOTES ToDo cryptmount.spec \
+ 	debian/changelog debian/compat debian/control debian/copyright \
+-	debian/dirs debian/docs debian/rules debian/lintian-override \
++	debian/dirs debian/docs debian/rules debian/cryptmount.lintian-overrides \
+ 	debian/postinst debian/postrm debian/watch debian/source/format \
+ 	debian/upstream/signing-key.asc
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 57f58cd..5aca477 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
+systemd-paths.patch
 install-example-cmtab.patch
 init.d-script.patch
+autotools-fixes.patch
diff --git a/debian/patches/systemd-paths.patch b/debian/patches/systemd-paths.patch
new file mode 100644
index 0000000..28d0c4c
--- /dev/null
+++ b/debian/patches/systemd-paths.patch
@@ -0,0 +1,17 @@
+--- a/sysinit/Makefile.am
++++ b/sysinit/Makefile.am
+@@ -26,11 +26,11 @@
+ 
+ install-inits:	cryptmount.service initscript
+ if USE_SYSTEMD
+-	test -d "${DESTDIR}/usr/lib/systemd/system" || mkdir -p "${DESTDIR}/usr/lib/systemd/system"
++	test -d "${DESTDIR}/lib/systemd/system" || mkdir -p "${DESTDIR}/lib/systemd/system"
+ 	test -d "${DESTDIR}/etc/modules-load.d" || mkdir -p "${DESTDIR}/etc/modules-load.d"
+ endif	# USE_SYSTEMD
+-	if test -d "${DESTDIR}/usr/lib/systemd/system" ; then \
+-	    ${INSTALL_PROGRAM_ENV} ${INSTALL_DATA} cryptmount.service "${DESTDIR}/usr/lib/systemd/system"; \
++	if test -d "${DESTDIR}/lib/systemd/system" ; then \
++	    ${INSTALL_PROGRAM_ENV} ${INSTALL_DATA} cryptmount.service "${DESTDIR}/lib/systemd/system"; \
+ 	fi
+ 	if test -d "${DESTDIR}/etc/modules-load.d" ; then \
+ 	     ${INSTALL_PROGRAM_ENV} ${INSTALL_DATA} modules-load.conf "${DESTDIR}/etc/modules-load.d/cryptmount.conf"; \
diff --git a/debian/postinst b/debian/postinst
index b1efff7..eb503af 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -19,7 +19,10 @@ set -e
 
 case "$1" in
     configure)
-        update-rc.d cryptmount defaults 28 > /dev/null
+        #if [ -x /etc/init.d/cryptmount ]; then
+        #    update-rc.d cryptmount defaults 28 > /dev/null
+        #fi
+        deb-systemd-helper enable cryptmount.service
 
         if [ -r /proc/1/root -a /proc/1/root/ -ef /proc/self/root/ ]; then
             modprobe -q -a dm-mod dm-crypt || true
diff --git a/debian/postrm b/debian/postrm
index e4c5f2d..948a92a 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -19,19 +19,20 @@ set -e
 
 
 case "$1" in
-    remove)
-	;;
-    purge)
-	update-rc.d cryptmount remove > /dev/null
-	;;
+    remove|purge)
+        deb-systemd-helper disable cryptmount.service
+        #if [ -x /etc/init.d/cryptmount ]; then
+        #    update-rc.d cryptmount remove > /dev/null
+        #fi
+    ;;
 
     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-	;;
+    ;;
 
     *)
-	echo "postrm called with unknown argument \`$1'" >&2
-	exit 1
-	;;
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
 esac
 
 # dh_installdeb will replace this with shell code automatically
@@ -40,3 +41,5 @@ esac
 #DEBHELPER#
 
 exit 0
+
+# vim: set ts=4 sw=4 et:
diff --git a/debian/rules b/debian/rules
index 912847d..1a525c9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,105 +1,36 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
 
-include /usr/share/dpkg/buildflags.mk
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
-CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
-else
-CROSS= --build $(DEB_BUILD_GNU_TYPE)
-endif
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
 
+# main packaging script based on dh7 syntax
+%:
+	dh $@  --with autoreconf --parallel
 
-config.status: configure
-	dh_testdir
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-	cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-	cp -f /usr/share/misc/config.guess config.guess
-endif
-	./configure $(CROSS) CFLAGS="$(CFLAGS)" \
-		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
-		--prefix=/usr --sysconfdir=/etc --with-sysrundir=/run \
-		--with-libgcrypt --enable-luks \
-		--enable-keymodules --enable-delegation --enable-fsck \
-		--enable-cswap --enable-openssl-compat \
-		--mandir=\$${prefix}/share/man \
-		--infodir=\$${prefix}/share/info
-
-build: build-stamp
-
-build-arch:	build
-
-build-indep:	build
-
-build-stamp:  config.status
-	dh_testdir
-
-	# Add here commands to compile the package.
-	$(MAKE)
-	#docbook-to-man debian/cryptmount.sgml > cryptmount.1
-
-	touch $@
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp 
+.PHONY:	override_dh_auto_configure override_dh_fixperms
 
-	# Add here commands to clean up after the build process.
-	[ ! -f Makefile ] || $(MAKE) distclean
-	rm -f config.sub config.guess
-
-	dh_clean 
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-
-	# Add here commands to install the package into debian/cryptmount.
-	$(MAKE) DESTDIR=$(CURDIR)/debian/cryptmount install
-	install -m 0644 debian/lintian-override $(CURDIR)/debian/cryptmount/usr/share/lintian/overrides/cryptmount
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
+# debmake generated override targets
+override_dh_auto_configure:
+	dh_auto_configure -- \
+		--prefix=/usr --sysconfdir=/etc --with-sysrundir=/run \
+		--with-systemd --with-libgcrypt --enable-luks \
+		--enable-delegation --enable-fsck \
+		--enable-cswap --enable-openssl-compat
 
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs ChangeLog
-	dh_installdocs
-	dh_installexamples $(CURDIR)/cmtab.example
-#	dh_installinit
-	dh_installman
-	dh_link
-	dh_strip
-	dh_compress
+override_dh_fixperms:
 	dh_fixperms --exclude usr/bin/cryptmount
-#	dh_makeshlibs
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 

Reply via email to