2 #@(#) Configuration script for sysstat
3 # (C) 2000-2020 Sebastien GODARD (sysstat <at> orange.fr)
8 echo Welcome to sysstat\'s Interactive Configuration script!
10 echo This script enables you to set the parameters value used by ./configure.
11 echo Please enter the value for the parameters listed below.
12 echo Press Return to tell ./configure to use the default value or to try to guess the proper one.
13 echo "Defaut value for yes/no questions is no (parameter is NOT set)."
14 echo You can enter a ? to display a help message at any time...
17 # Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
19 # Installation directory
20 PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
21 if [ "${PREFIX}" != "" ]; then
22 PREFIX="--prefix=${PREFIX} "
26 SA_LIB_DIR=`${ASK} 'sadc directory:' "sa_lib_dir" "sa_lib_dir"`
27 if [ "${SA_LIB_DIR}" != "" ]; then
28 SA_LIB_DIR="sa_lib_dir=${SA_LIB_DIR} "
31 # System Activity directory
32 SA_DIR=`${ASK} 'System activity directory:' "sa_dir" "sa_dir"`
33 if [ "${SA_DIR}" != "" ]; then
34 SA_DIR="sa_dir=${SA_DIR} "
37 # sysstat configuration directory
38 SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"`
39 if [ "${SYSCONFIG_DIR}" != "" ]; then
40 SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} "
43 # sysstat configuration file
44 SYSCONFIG_FILE=`${ASK} 'sysstat configuration file:' "conf_file" "conf_file"`
45 if [ "${SYSCONFIG_FILE}" != "" ]; then
46 SYSCONFIG_FILE="conf_file=${SYSCONFIG_FILE} "
50 CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"`
51 if [ "${CLEAN_SA_DIR}" = "y" ]; then
52 CLEAN_SA_DIR="--enable-clean-sa-dir "
55 echo "Parameter --enable-clean-sa-dir is NOT set"
58 # National Language Support
59 NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"`
60 if [ "${NLS}" = "y" ]; then
64 echo "Parameter --disable-nls is NOT set"
68 SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"`
69 if [ "${SENSORS}" = "y" ]; then
70 SENSORS="--disable-sensors "
73 echo "Parameter --disable-sensors is NOT set"
77 PCP=`${ASK} 'Disable PCP support? (y/n)' "--disable-pcp" "pcp"`
78 if [ "${PCP}" = "y" ]; then
82 echo "Parameter --disable-pcp is NOT set"
85 # Data history to keep by sa2
86 HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"`
87 if [ "${HISTORY}" != "" ]; then
88 HISTORY="history=${HISTORY} "
91 # Random delay before sa2 script generates its reports files
92 DELAY_RANGE=`${ASK} 'Maximum delay in seconds to wait before sa2 script runs:' "delay_range" "delay_range"`
93 if [ "${DELAY_RANGE}" != "" ]; then
94 DELAY_RANGE="delay_range=${DELAY_RANGE} "
97 # Delay after which datafiles are to be compressed
98 COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"`
99 if [ "${COMPRESSAFTER}" != "" ]; then
100 COMPRESSAFTER="compressafter=${COMPRESSAFTER} "
104 MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"`
105 if [ "${MAN}" != "" ]; then
106 MAN="man_group=${MAN} "
109 # Don't set attributes on files being installed
110 IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
111 if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
112 IGNORE_FILE_ATTR="--disable-file-attr "
115 echo "Parameter --disable-file-attr is NOT set"
119 CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"`
120 if [ "${CRON}" = "y" ]; then
121 CRON="--enable-install-cron "
124 echo "Parameter --enable-install-cron is NOT set"
127 if [ "${CRON}" != "" ];
129 CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"`
130 if [ "${CRON_OWNER}" != "" ]; then
131 CRON="${CRON}cron_owner=${CRON_OWNER} "
135 if [ "${CRON}" != "" ];
137 USE_CROND=`${ASK} 'Use standard cron daemon? (y/n)' "--enable-use-crond" "use-crond"`
138 if [ "${USE_CROND}" = "y" ]; then
139 USE_CROND="--enable-use-crond "
142 echo "Parameter --enable-use-crond is NOT set"
146 if [ "${CRON}" != "" ];
148 CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
149 if [ "${CRON_INTERVAL}" != "" ]; then
150 CRON="${CRON}cron_interval=${CRON_INTERVAL} "
154 if [ "${CRON}" != "" ];
156 COLL_ALL=`${ASK} 'Should sadc collect optional activities? (y/n)' "--enable-collect-all" "collect-all"`
157 if [ "${COLL_ALL}" = "y" ]; then
158 CRON="${CRON}--enable-collect-all "
160 echo "Parameter --enable-collect-all is NOT set"
164 if [ "${CRON}" != "" -a "${COLL_ALL}" != "y" ];
166 # Optional args for sadc
167 SADC_OPT=`${ASK} 'Options to be passed to sadc:' "sadc_options" "sadc_options"`
172 if [ "${CRON}" != "" ];
175 RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"`
176 if [ "${RCDIR}" != "" ]; then
177 RCDIR="rcdir=${RCDIR} "
181 if [ "${CRON}" != "" ];
184 COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
185 if [ "${COPY_ONLY}" = "y" ]; then
186 COPY_ONLY="--enable-copy-only "
189 echo "Parameter --enable-copy-only is NOT set"
193 # Compress manual pages
194 COMPRESSMANPG=`${ASK} 'Do not compress manual pages? (y/n)' "--disable-compress-manpg" "compress-manpg"`
195 if [ "${COMPRESSMANPG}" = "y" ]; then
196 COMPRESSMANPG="--disable-compress-manpg "
199 echo "Parameter --disable-compress-manpg is NOT set"
202 # Install documentation
203 INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"`
204 if [ "${INSTALL_DOC}" = "y" ]; then
205 INSTALL_DOC="--disable-documentation "
208 echo "Parameter --disable-documentation is NOT set"
212 DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"`
213 if [ "${DEBUGINFO}" = "y" ]; then
214 DEBUGINFO="--enable-debuginfo "
217 echo "Parameter --enable-debuginfo is NOT set"
221 STRIP=`${ASK} 'Do not strip object files? (y/n)' "--disable-stripping" "stripping"`
222 if [ "${STRIP}" = "y" ]; then
223 STRIP="--disable-stripping "
226 echo "Parameter --disable-stripping is NOT set"
230 echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
231 ${CLEAN_SA_DIR}${NLS}${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR} \
232 ${CRON}${USE_CROND}${RCDIR}"
233 if [ "${SADC_OPT}" != "" ];
235 echo -n "sadc_options=\"${SADC_OPT}\""
237 echo "${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS}${PCP}${STRIP}${COPY_ONLY}"
240 ./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
241 ${CLEAN_SA_DIR}${NLS} \
242 ${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR} \
243 sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS} \
244 ${PCP}${STRIP}${COPY_ONLY}