ifndef INSTALL_DOC
INSTALL_DOC = @INSTALL_DOC@
endif
+ifndef COPY_ONLY
+COPY_ONLY = @COPY_ONLY@
+endif
# Systemd
SYSTEMCTL = @SYSTEMCTL@
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 "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
+ if [ -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; \
if [ -x $(CHKCONFIG) ]; then \
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
fi \
fi
+ifeq ($(COPY_ONLY),n)
+ if [ -x $(SYSTEMCTL) ]; then \
+ $(SYSTEMCTL) enable sysstat.service; \
+ fi
+endif
uninstall_man:
ifeq ($(INSTALL_DOC),y)
-$(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 "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
+ifeq ($(COPY_ONLY),n)
+ if [ -x $(SYSTEMCTL) ]; then \
$(SYSTEMCTL) disable sysstat.service; \
+ fi
+endif
+ if [ -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat.service; \
fi
--- /dev/null
+
+Answer y to make sure that installing sysstat on your machine
+only results on files being copied to destinations directories
+and nothing else (like activating a service) is done.
+This option is interesting for those creating a sysstat package
+for example. Indeed some distributions want to install files
+into $DESTDIR before actually installing them into the root
+directory. If the distribution uses systemd (a system management
+daemon written for Linux), the sysstat service should not be
+activated in this case before files are actually copied into
+the root directory.
+But for most of you wanting sysstat to be properly installed
+when you enter "make install", just answer n here (this is the
+default answer).
+
CRON_INTERVAL
SU_C_OWNER
CRON_OWNER
+COPY_ONLY
cron_interval
cron_owner
INSTALL_CRON
enable_clean_sa_dir
enable_install_cron
enable_collect_all
+enable_copy_only
enable_documentation
enable_debuginfo
enable_stripping
--enable-clean-sa-dir clean system activity directory
--enable-install-cron install a crontab to start sar
--enable-collect-all collect all possible activities
+ --enable-copy-only only copy files when installing
--disable-documentation do not install documentation
--enable-debuginfo enable debug output (--debuginfo option)
--disable-stripping do not strip object files
# --disable-documentation do not install documentation (man pages...)
# --disable-sensors do not link against libsensors even if available
# --disable-stripping do not strip object files
+# --enablle-copy-only only copy files when installing sysstat
#
# Some influential environment variables:
# rcdir directory where startup scripts are installed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUX_COLL" >&5
$as_echo "$AUX_COLL" >&6; }
+# Check whether files should only be copied
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether files should only be copied" >&5
+$as_echo_n "checking whether files should only be copied... " >&6; }
+ # Check whether --enable-copy-only was given.
+if test "${enable_copy_only+set}" = set; then :
+ enableval=$enable_copy_only; OCOPY=$enableval
+else
+ OCOPY=no
+fi
+
+ if test $OCOPY != "yes"; then
+ COPY_ONLY=n
+ OCOPY=no
+ else
+ COPY_ONLY=y
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCOPY" >&5
+$as_echo "$OCOPY" >&6; }
+
+
else
CRON_OWNER="root"
SU_C_OWNER=""
# --disable-documentation do not install documentation (man pages...)
# --disable-sensors do not link against libsensors even if available
# --disable-stripping do not strip object files
+# --enablle-copy-only only copy files when installing sysstat
#
# Some influential environment variables:
# rcdir directory where startup scripts are installed
fi
AC_MSG_RESULT($AUX_COLL)
+# Check whether files should only be copied
+ AC_MSG_CHECKING(whether files should only be copied)
+ AC_ARG_ENABLE(copy-only,
+ AC_HELP_STRING([--enable-copy-only],
+ [only copy files when installing]),
+ OCOPY=$enableval,OCOPY=no)
+ if test $OCOPY != "yes"; then
+ COPY_ONLY=n
+ OCOPY=no
+ else
+ COPY_ONLY=y
+ fi
+ AC_MSG_RESULT($OCOPY)
+ AC_SUBST(COPY_ONLY)
+
else
CRON_OWNER="root"
SU_C_OWNER=""
fi
fi
+if [ "${CRON}" != "" ];
+then
+ # Only copy files
+ COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
+ if [ "${COPY_ONLY}" = "y" ]; then
+ COPY_ONLY="--enable-copy-only "
+ else
+ COPY_ONLY=""
+ echo "Parameter --enable-copy-only is NOT set"
+ fi
+fi
+
# Compress manual pages
COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"`
if [ "${COMPRESSMANPG}" = "y" ]; then
echo
echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
-${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}"
+${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
echo
./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
-${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}
+${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}