From b1679b0dc674722732386a48aa8e6006e4108860 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Tue, 26 Sep 2017 09:58:03 +0900 Subject: [PATCH] Do not install launchctl utils if DESTDIR is set Only install and install launchctl if DESTDIR is unset, or set to "/". --- Makefile.am | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3f18b4ccf..f3317308a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,27 +75,31 @@ pkg-utils: @DEFAULT_PACKAGE@-utils if CONFIG_USER install-data-hook:: @echo - for plistfile in $(launchddaemon_DATA); do \ - bn=`basename "$$plistfile"`; \ - echo "Attempting to unload $$bn ..."; \ - $(DESTDIR)/bin/launchctl unload -F \ - $(DESTDIR)$(launchddaemondir)/"$$bn" \ - || echo "Ignoring errors"; \ - echo "Attempting to load $$bn ..."; \ - $(DESTDIR)/bin/launchctl load -wF \ - $(DESTDIR)$(launchddaemondir)/"$$bn" \ - || echo "Ignoring errors"; \ - done + if [ -z "$(DESTDIR)" ] || [ x"$(DESTDIR)" = x"/" ]; then \ + for plistfile in $(launchddaemon_DATA); do \ + bn=`basename "$$plistfile"`; \ + echo "Attempting to unload $$bn ..."; \ + $(DESTDIR)/bin/launchctl unload -F \ + $(DESTDIR)$(launchddaemondir)/"$$bn" \ + || echo "Ignoring errors"; \ + echo "Attempting to load $$bn ..."; \ + $(DESTDIR)/bin/launchctl load -wF \ + $(DESTDIR)$(launchddaemondir)/"$$bn" \ + || echo "Ignoring errors"; \ + done \ + fi echo "Install done." uninstall-hook:: @echo - for plistfile in $(launchddaemon_DATA); do \ - label=`defaults read "$$PWD"/"$$plistfile" Label`; \ - echo "Attempting to remove $$label ..."; \ - $(DESTDIR)/bin/launchctl remove "$$label" \ - || echo "Ignoring errors"; \ - done + if [ -z "$(DESTDIR)" ] || [ x"$(DESTDIR)" == x"/" ]; then \ + for plistfile in $(launchddaemon_DATA); do \ + label=`defaults read "$$PWD"/"$$plistfile" Label`; \ + echo "Attempting to remove $$label ..."; \ + $(DESTDIR)/bin/launchctl remove "$$label" \ + || echo "Ignoring errors"; \ + done \ + fi $(RM) -r $(DESTDIR)@FILESYSTEMS_PREFIX@/zfs.fs $(RM) -r $(DESTDIR)@KERNEL_MODPREFIX@/zfs.kext endif