Skip to content

Commit

Permalink
debian/rules: Do not hardcode the authd daemons path
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Feb 29, 2024
1 parent cfe90ef commit 27b8048
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debian/authd.service → debian/authd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PartOf=authd.socket

[Service]
Type=notify
ExecStart=/usr/libexec/authd
ExecStart=@AUTHD_DAEMONS_PATH@/authd

# Some daemon restrictions
LockPersonality=yes
Expand Down
2 changes: 1 addition & 1 deletion debian/install
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27b8048

Please sign in to comment.