Skip to content

Commit

Permalink
Do not install launchctl utils if DESTDIR is set
Browse files Browse the repository at this point in the history
Only install and install launchctl if DESTDIR is unset, or
set to "/".
  • Loading branch information
lundman committed Sep 28, 2017
1 parent cedec90 commit b1679b0
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions Makefile.am
Expand Up @@ -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

0 comments on commit b1679b0

Please sign in to comment.