]> granicus.if.org Git - sysstat/commitdiff
Call chkconfig only if $(COPY_ONLY) is set to no
authorSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 19 Mar 2015 20:22:55 +0000 (21:22 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 19 Mar 2015 20:27:05 +0000 (21:27 +0100)
Call chkconfig (or create corresponding links) only if
$(COPY_ONLY) variable is set to no.
The chkconfig command doesn't take into account the $(DESTDIR) variable
contents, trying to create links outside the $(DESTDIR) tree, which can
be considered as a way to activate sysstat service.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
Makefile.in

index d87576c3588e939ef357f8f4e0b59ff374e05901..3ec0a88c9d7c3a647997a65f44ef336f9a485026 100644 (file)
@@ -411,27 +411,31 @@ endif
                $(INSTALL_DATA) cron/sysstat-summary.timer $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
        elif [ -d $(DESTDIR)$(INIT_DIR) ]; then \
                $(INSTALL_BIN) sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \
-               if [ -x "$(CHKCONFIG)" ]; then \
-                       cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \
-               else \
-                       [ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
-                       [ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
-                       [ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
-                       cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
-                       cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
-                       cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
+               if [ "$(COPY_ONLY)" == "n" ]; then \
+                       if [ -x "$(CHKCONFIG)" ]; then \
+                               cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \
+                       else \
+                               [ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
+                               [ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
+                               [ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
+                               cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
+                               cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
+                               cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
+                       fi \
                fi \
        elif [ -d $(DESTDIR)$(RC_DIR) ]; then \
                $(INSTALL_BIN) sysstat $(DESTDIR)$(RC_DIR)/rc.sysstat; \
-               if [ -x "$(CHKCONFIG)" ]; then \
-                       cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add rc.sysstat; \
-               else \
-                       [ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
-                       [ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
-                       [ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
-                       cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
-                       cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
-                       cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
+               if [ "$(COPY_ONLY)" == "n" ]; then \
+                       if [ -x "$(CHKCONFIG)" ]; then \
+                               cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add rc.sysstat; \
+                       else \
+                               [ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
+                               [ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
+                               [ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
+                               cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
+                               cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
+                               cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
+                       fi \
                fi \
        fi
 ifeq ($(COPY_ONLY),n)