summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2021-10-28 09:15:37 -0700
committerLee Duncan <lduncan@suse.com>2021-10-28 09:15:37 -0700
commita5f09ce5855d448d14148dfe46ce595bfb18cea8 (patch)
treec39c0d5d67cd4522dc19aa039af4b82a0fe436d2 /Makefile
parent4353670c281ccd4dd1c028be8c806797580ecd66 (diff)
downloadopen-iscsi-a5f09ce5855d448d14148dfe46ce595bfb18cea8.tar.gz
Finish ability to have binary location configurable.
A Recent commit, fff82c57f5df ("Use "sbindir" for path in systemd service files") added the ability to have our binaries in another location rather than /sbin (e.g. /usr/sbin), but it was incomplete. This commit finishes the job. Fixes: fff82c57f5dfe6d3db795f1195b4d2ebc497d33c
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 08b9cf6..ee4746f 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@
# that you want everything installed into.
DESTDIR ?=
+SED = /usr/bin/sed
+
prefix = /usr
exec_prefix = /
sbindir = $(exec_prefix)/sbin
@@ -60,7 +62,7 @@ endif
all: user
user: iscsiuio/Makefile
- $(MAKE) -C libopeniscsiusr
+ $(MAKE) -C libopeniscsiusr SBINDIR=$(sbindir) SBINDIR=$(sbindir)
$(MAKE) -C utils/sysdeps
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
@@ -110,18 +112,26 @@ install_user: install_programs install_doc install_etc \
install_udev_rules:
$(INSTALL) -d $(DESTDIR)$(rulesdir)
$(INSTALL) -m 644 $(RULESFILES) $(DESTDIR)/$(rulesdir)
+ for f in $(RULESFILES); do \
+ p=$(DESTDIR)/$(rulesdir)/$${f##*/}; \
+ $(SED) -i -e 's:@SBINDIR@:$(sbindir):' $$p; \
+ done
install_systemd:
- $(INSTALL) -d $(DESTDIR)$(systemddir)
- $(INSTALL) -m 644 $(SYSTEMDFILES) $(DESTDIR)/$(systemddir)
+ $(INSTALL) -d $(DESTDIR)$(systemddir)/system
+ $(INSTALL) -m 644 $(SYSTEMDFILES) $(DESTDIR)/$(systemddir)/system
for f in $(SYSTEMDFILES); do \
p=$(DESTDIR)/$(systemddir)/system/$${f##*/}; \
- sed -i -e 's:@SBINDIR@:$(sbindir):' $$p; \
+ $(SED) -i -e 's:@SBINDIR@:$(sbindir):' $$p; \
done
-install_programs: $(PROGRAMS) $(SCRIPTS)
+install_programs: $(PROGRAMS) $(SCRIPTS)
$(INSTALL) -d $(DESTDIR)$(sbindir)
$(INSTALL) -m 755 $^ $(DESTDIR)$(sbindir)
+ for f in $(SCRIPTS); do \
+ p=$(DESTDIR)/$(sbindir)/$${f##*/}; \
+ $(SED) -i -e 's:@SBINDIR@:$(sbindir):' $$p; \
+ done
# ugh, auto-detection is evil
# Gentoo maintains their own init.d stuff
@@ -168,7 +178,7 @@ install_doc: $(MANPAGES)
install_iname:
if [ ! -f $(DESTDIR)/etc/iscsi/initiatorname.iscsi ]; then \
- echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \
+ echo "InitiatorName=`$(DESTDIR)$(sbindir)/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \
echo "***************************************************" ; \
echo "Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \
echo "To override edit $(DESTDIR)/etc/iscsi/initiatorname.iscsi" ; \