Package: cdbs
Version: 0.4.130

Currently, the debhelper rules run dh_systemd_enable and
dh_systemd_start consecutively towards the end of the binary-install
phase. However, according to dh_systemd_enable(1), dh_systemd_enable
should run before dh_installinit. Indeed, the dh-systemd debhelper
sequence module does it this way:

$ cat /usr/share/perl5/Debian/Debhelper/Sequence/systemd.pmĀ 
#!/usr/bin/perl
use warnings;
use strict;
use Debian::Debhelper::Dh_Lib;

# dh_systemd_enable runs unconditionally, and before dh_installinit, so that
# the latter can use invoke-rc.d and all symlinks are already in place.
insert_before("dh_installinit", "dh_systemd_enable");

# dh_systemd_start handles the case where there is no corresponding init
# script, so it runs after dh_installinit.
insert_after("dh_installinit", "dh_systemd_start");

1

The attached patch should fix it.

--
Dan
From 119c49e03fdd8c3b9e5ab9603474effd4177a810 Mon Sep 17 00:00:00 2001
From: Dan Nicholson <[email protected]>
Date: Tue, 19 Jan 2016 11:57:05 -0800
Subject: [PATCH] Run dh_systemd_enable before dh_installinit

According to dh_systemd_enable(1), it needs to be run before
dh_installinit. Change the ordering in binary-install appropriately.
---
 1/rules/debhelper.mk.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/1/rules/debhelper.mk.in b/1/rules/debhelper.mk.in
index 13d149a..4e43a56 100644
--- a/1/rules/debhelper.mk.in
+++ b/1/rules/debhelper.mk.in
@@ -212,6 +212,9 @@ $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%:
 		$(call cdbs_expand_curvar,DEB_DH_INSTALL_MENU_ARGS)
 	dh_installcron -p$(cdbs_curpkg) \
 		$(call cdbs_expand_curvar,DEB_DH_INSTALL_CRON_ARGS)
+	$(if $(wildcard /usr/bin/dh_systemd_enable),\
+		dh_systemd_enable -p$(cdbs_curpkg) \
+			$(call cdbs_expand_curvar,DEB_DH_SYSTEMD_ENABLE_ARGS))
 	dh_installinit -p$(cdbs_curpkg) \
 		$(if $(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS),\
 			--update-rcd-params="$(call cdbs_strip_quotes,$(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS))") \
@@ -248,9 +251,6 @@ $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%:
 		$(if $(DEB_DH_INSTALL_SOURCEDIR),\
 			--sourcedir=$(DEB_DH_INSTALL_SOURCEDIR)) \
 		$(call cdbs_expand_curvar,DEB_DH_INSTALL_ARGS)
-	$(if $(wildcard /usr/bin/dh_systemd_enable),\
-		dh_systemd_enable -p$(cdbs_curpkg) \
-			$(call cdbs_expand_curvar,DEB_DH_SYSTEMD_ENABLE_ARGS))
 	$(if $(wildcard /usr/bin/dh_systemd_start),\
 		dh_systemd_start -p$(cdbs_curpkg) \
 			$(call cdbs_expand_curvar,DEB_DH_SYSTEMD_START_ARGS))
-- 
2.1.4

Reply via email to