From 6f51dbeae706e8b488b1e7f4b93767299d1e8937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 26 Feb 2024 16:30:27 +0100 Subject: [PATCH] debian/rules: Do not hardcode the authd daemons path --- debian/{authd.service => authd.service.in} | 2 +- debian/install | 2 +- debian/rules | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) rename debian/{authd.service => authd.service.in} (95%) 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