From fff82c57f5dfe6d3db795f1195b4d2ebc497d33c Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Thu, 30 Sep 2021 13:26:48 -0700 Subject: Use "sbindir" for path in systemd service files Use a variable for the sbin directory where executables go in our systemd unit files, so that the files can be configured, during installation, to have the correct path, instead of just hard-coding these paths. Now "make sbindir=/SOME/PATH ..." works correctly for different paths. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7f52cc8..08b9cf6 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,10 @@ install_udev_rules: install_systemd: $(INSTALL) -d $(DESTDIR)$(systemddir) $(INSTALL) -m 644 $(SYSTEMDFILES) $(DESTDIR)/$(systemddir) + for f in $(SYSTEMDFILES); do \ + p=$(DESTDIR)/$(systemddir)/system/$${f##*/}; \ + sed -i -e 's:@SBINDIR@:$(sbindir):' $$p; \ + done install_programs: $(PROGRAMS) $(SCRIPTS) $(INSTALL) -d $(DESTDIR)$(sbindir) -- cgit v1.2.1