summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2021-09-30 13:26:48 -0700
committerLee Duncan <lduncan@suse.com>2021-09-30 13:26:48 -0700
commitfff82c57f5dfe6d3db795f1195b4d2ebc497d33c (patch)
treee9946cd5e909201b7f3c2ac06c27e2c3f12611e8 /Makefile
parent3a920cda8aa7f0e67bca834d278da5167862a404 (diff)
downloadopen-iscsi-fff82c57f5dfe6d3db795f1195b4d2ebc497d33c.tar.gz
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
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)