diff --git a/debian/authd.service b/debian/authd.service.in similarity index 95% rename from debian/authd.service rename to debian/authd.service.in index f3ae33c02..94030a892 100644 --- a/debian/authd.service +++ b/debian/authd.service.in @@ -6,7 +6,7 @@ PartOf=authd.socket [Service] Type=notify -ExecStart=/usr/libexec/authd +ExecStart=@AUTHD_DAEMONS_PATH@/authd # Some daemon restrictions LockPersonality=yes diff --git a/debian/install b/debian/install index 2d5b5fd4e..180aa90b8 100755 --- a/debian/install +++ b/debian/install @@ -1,7 +1,7 @@ #!/usr/bin/dh-exec # Install daemon -usr/bin/authd /usr/libexec +usr/bin/authd ${env:AUTHD_DAEMONS_PATH} # pam-auth-update files debian/pam-configs/* /usr/share/pam-configs diff --git a/debian/rules b/debian/rules index a7a105a90..3002aea43 100755 --- a/debian/rules +++ b/debian/rules @@ -34,6 +34,9 @@ export CARGO_HOME = $(CURDIR)/debian/cargo_home # Needed by the pam module loader export AUTHD_PAM_MODULES_PATH = /usr/lib/$(DEB_TARGET_GNU_TYPE)/security +# Used not to hardcore the daemons paths +export AUTHD_DAEMONS_PATH := /usr/libexec + # Skip some tests that rely on external dependencies when building package: # they need external commands (e.g. `vhs`) that are not available in the build environment. export AUTHD_SKIP_EXTERNAL_DEPENDENT_TESTS=1 @@ -67,12 +70,19 @@ override_dh_auto_clean: # Cleanup empty cargo-checksum rm -f debian/cargo-checksum.json + # Cleanup generated service files + rm -f debian/*.service + override_dh_auto_configure: dh_auto_configure touch debian/cargo-checksum.json dh_auto_configure --buildsystem=cargo + for i in debian/*.service.in; do \ + sed s,@AUTHD_DAEMONS_PATH@,$(AUTHD_DAEMONS_PATH),g $$i > $${i%.*}; \ + done + override_dh_auto_build: # Build PAM library & Go loader DH_GOLANG_GO_GENERATE=1 dh_auto_build -- $(AUTHD_GO_PACKAGE)/pam