From: Sebastien GODARD Date: Thu, 19 Mar 2015 20:22:55 +0000 (+0100) Subject: Call chkconfig only if $(COPY_ONLY) is set to no X-Git-Tag: v11.1.4~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=657480fc0606c32bb19ae119fd1cbee98350bc4e;p=sysstat Call chkconfig only if $(COPY_ONLY) is set to no 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 --- diff --git a/Makefile.in b/Makefile.in index d87576c..3ec0a88 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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)