From e57e5ae9aa6a9cd9bc387286480dde4484c0d5bd Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sun, 12 Jan 2014 08:10:51 +0100 Subject: [PATCH] Take $DESTDIR variable into account when installing sysstat service used by systemd. Previous code for installing sysstat using systemd needed rw permissions to the root directory. Yet some users and distributions want to install files into $(DESTDIR) before actually installing into the root directory. So take $DESTDIR variable into account. Signed-off-by: Sebastien GODARD --- Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9ce9ee6..d43d1cf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -375,8 +375,8 @@ install_all: install_base cron/crontab sysstat \ echo "USER'S PREVIOUS CRONTAB SAVED IN CURRENT DIRECTORY (USING .save SUFFIX)."; \ su $(CRON_OWNER) -c "crontab cron/crontab"; \ fi - if [ -x $(SYSTEMCTL) -a -d "$(SYSTEMD_UNIT_DIR)" ]; then \ - $(INSTALL_DATA) sysstat.service $(SYSTEMD_UNIT_DIR); \ + if [ -x $(SYSTEMCTL) -a -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \ + $(INSTALL_DATA) sysstat.service $(DESTDIR)$(SYSTEMD_UNIT_DIR); \ $(SYSTEMCTL) enable sysstat.service; \ elif [ -d $(DESTDIR)$(INIT_DIR) ]; then \ $(INSTALL_BIN) sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \ @@ -478,9 +478,9 @@ uninstall_all: uninstall_base -$(CP) -a /tmp/crontab-$(CRON_OWNER).old ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.old @echo "USER CRONTAB SAVED IN CURRENT DIRECTORY (WITH .old SUFFIX)." -su $(CRON_OWNER) -c "crontab -r" - if [ -x $(SYSTEMCTL) -a -d "$(SYSTEMD_UNIT_DIR)" ]; then \ + if [ -x $(SYSTEMCTL) -a -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \ $(SYSTEMCTL) disable sysstat.service; \ - rm -f $(SYSTEMD_UNIT_DIR)/sysstat.service; \ + rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat.service; \ fi ifeq ($(INSTALL_CRON),y) -- 2.40.0