]> granicus.if.org Git - sudo/commitdiff
Don't install the rc.d link when installing to a DESTDIR.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 26 Apr 2017 20:49:05 +0000 (14:49 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 26 Apr 2017 20:49:05 +0000 (14:49 -0600)
DESTDIR is generally only set when installing to a temporary
directory for packaging in which case the link should be
made in a post-install script.

src/Makefile.in

index 607d6ae4b46420207391ef18a2159da46575f0e2..aefd4a1f44f1bc15894eb01939af81faf2c5ad1d 100644 (file)
@@ -172,20 +172,27 @@ pre-install:
 install: install-binaries install-rc @INSTALL_NOEXEC@
 
 install-dirs:
+       # We only create the rc.d dir when installing to the actual system dir
        $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
            $(DESTDIR)$(libexecdir)/sudo $(DESTDIR)$(noexecdir)
        if test -n "$(INIT_SCRIPT)"; then \
-           $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(INIT_DIR) \
-               `echo $(DESTDIR)$(RC_LINK) | $(SED) 's,/[^/]*$$,,'`; \
+           $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(INIT_DIR); \
+           if test -z "$(DESTDIR)"; then \
+               $(SHELL) $(top_srcdir)/mkinstalldirs \
+                   `echo $(RC_LINK) | $(SED) 's,/[^/]*$$,,'`; \
+           fi; \
        elif test -n "$(tmpfiles_d)"; then \
            $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(tmpfiles_d); \
        fi
 
 install-rc: install-dirs
+       # We only create the rc.d link when installing to the actual system dir
        if [ -n "$(INIT_SCRIPT)" ]; then \
            $(INSTALL) $(INSTALL_OWNER) -m 0755 $(top_builddir)/init.d/$(INIT_SCRIPT) $(DESTDIR)$(INIT_DIR)/sudo; \
-           rm -f $(DESTDIR)$(RC_LINK); \
-           ln -s $(INIT_DIR)/sudo $(DESTDIR)$(RC_LINK); \
+           if test -z "$(DESTDIR)"; then \
+               rm -f $(RC_LINK); \
+               ln -s $(INIT_DIR)/sudo $(RC_LINK); \
+           fi; \
        elif test -n "$(tmpfiles_d)"; then \
            $(INSTALL) $(INSTALL_OWNER) -m 0644 $(top_builddir)/init.d/sudo.conf $(DESTDIR)$(tmpfiles_d)/sudo.conf; \
        fi