]> granicus.if.org Git - sysstat/blob - iconfig
NLS: Sync with translation project
[sysstat] / iconfig
1 #!/bin/sh
2 #@(#) Configuration script for sysstat
3 # (C) 2000-2014 Sebastien GODARD (sysstat <at> orange.fr)
4
5 ASK="sh build/Ask.sh"
6
7 echo ; echo
8 echo Welcome to sysstat\'s  Interactive Configuration script!
9 echo
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...
15 echo
16
17 # Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
18
19 # Installation directory
20 PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
21 if [ "${PREFIX}" != "" ]; then
22         PREFIX="--prefix=${PREFIX} "
23 fi
24
25 # sadc directory
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} "
29 fi
30
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} "
35 fi
36
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} "
41 fi
42
43 # Clean sa directory
44 CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"`
45 if [ "${CLEAN_SA_DIR}" = "y" ]; then
46         CLEAN_SA_DIR="--enable-clean-sa-dir "
47 else
48         CLEAN_SA_DIR=""
49         echo "Parameter --enable-clean-sa-dir is NOT set"
50 fi
51
52 # National Language Support
53 NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"`
54 if [ "${NLS}" = "y" ]; then
55         NLS="--disable-nls "
56 else
57         NLS=""
58         echo "Parameter --disable-nls is NOT set"
59 fi
60
61 # Sensors support
62 SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"`
63 if [ "${SENSORS}" = "y" ]; then
64         SENSORS="--disable-sensors "
65 else
66         SENSORS=""
67         echo "Parameter --disable-sensors is NOT set"
68 fi
69
70 # Data history to keep by sa2
71 HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"`
72 if [ "${HISTORY}" != "" ]; then
73         HISTORY="history=${HISTORY} "
74 fi
75
76 # Delay after which datafiles are to be compressed
77 COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"`
78 if [ "${COMPRESSAFTER}" != "" ]; then
79         COMPRESSAFTER="compressafter=${COMPRESSAFTER} "
80 fi
81
82 # Preallocation factor
83 PREALLOC_ANSWER=`${ASK} 'Preallocation factor value:' "prealloc" "prealloc"`
84 if [ "${PREALLOC_ANSWER}" != "" ]; then
85         PREALLOC_ANSWER="prealloc=${PREALLOC_ANSWER} "
86 fi
87
88 # Manual page group
89 MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"`
90 if [ "${MAN}" != "" ]; then
91         MAN="man_group=${MAN} "
92 fi
93
94 # Don't set attributes on files being installed
95 IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
96 if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
97         IGNORE_FILE_ATTR="--disable-file-attr "
98 else
99         IGNORE_FILE_ATTR=""
100         echo "Parameter --disable-file-attr is NOT set"
101 fi
102
103 # Crontab
104 CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"`
105 if [ "${CRON}" = "y" ]; then
106         CRON="--enable-install-cron "
107 else
108         CRON=""
109         echo "Parameter --enable-install-cron is NOT set"
110 fi
111
112 if [ "${CRON}" != "" ];
113 then
114         CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"`
115         if [ "${CRON_OWNER}" != "" ]; then
116                 CRON="${CRON}cron_owner=${CRON_OWNER} "
117         fi
118 fi
119
120 if [ "${CRON}" != "" ];
121 then
122         CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
123         if [ "${CRON_INTERVAL}" != "" ]; then
124                 CRON="${CRON}cron_interval=${CRON_INTERVAL} "
125         fi
126 fi
127
128 if [ "${CRON}" != "" ];
129 then
130         COLL_ALL=`${ASK} 'Should sadc collect optional activities? (y/n)' "--enable-collect-all" "collect-all"`
131         if [ "${COLL_ALL}" = "y" ]; then
132                 CRON="${CRON}--enable-collect-all "
133         else
134                 echo "Parameter --enable-collect-all is NOT set"
135         fi
136 fi
137
138 if [ "${CRON}" != "" -a "${COLL_ALL}" != "y" ];
139 then
140         # Optional args for sadc
141         SADC_OPT=`${ASK} 'Options to be passed to sadc:' "sadc_options" "sadc_options"`
142 else
143         SADC_OPT=
144 fi
145
146 if [ "${CRON}" != "" ];
147 then
148         # rc directory
149         RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"`
150         if [ "${RCDIR}" != "" ]; then
151                 RCDIR="rcdir=${RCDIR} "
152         fi
153 fi
154
155 if [ "${CRON}" != "" ];
156 then
157         # Only copy files
158         COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
159         if [ "${COPY_ONLY}" = "y" ]; then
160                 COPY_ONLY="--enable-copy-only "
161         else
162                 COPY_ONLY=""
163                 echo "Parameter --enable-copy-only is NOT set"
164         fi
165 fi
166
167 # Compress manual pages
168 COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"`
169 if [ "${COMPRESSMANPG}" = "y" ]; then
170         COMPRESSMANPG="--enable-compress-manpg "
171 else
172         COMPRESSMANPG=""
173         echo "Parameter --enable-compress-manpg is NOT set"
174 fi
175
176 # Install documentation
177 INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"`
178 if [ "${INSTALL_DOC}" = "y" ]; then
179         INSTALL_DOC="--disable-documentation "
180 else
181         INSTALL_DOC=""
182         echo "Parameter --disable-documentation is NOT set"
183 fi
184
185 # Debug mode
186 DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"`
187 if [ "${DEBUGINFO}" = "y" ]; then
188         DEBUGINFO="--enable-debuginfo "
189 else
190         DEBUGINFO=""
191         echo "Parameter --enable-debuginfo is NOT set"
192 fi
193
194 # Install isag script
195 INSTALL_ISAG=`${ASK} 'Install isag script? (y/n)' "--enable-install-isag" "install-isag"`
196 if [ "${INSTALL_ISAG}" = "y" ]; then
197         INSTALL_ISAG="--enable-install-isag "
198 else
199         INSTALL_ISAG=""
200         echo "Parameter --enable-install-isag is NOT set"
201 fi
202
203 # Strip object files
204 STRIP=`${ASK} 'Do not strip object files? (y/n)' "--disable-stripping" "stripping"`
205 if [ "${STRIP}" = "y" ]; then
206         STRIP="--disable-stripping "
207 else
208         STRIP=""
209         echo "Parameter --disable-stripping is NOT set"
210 fi
211
212 echo
213 echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
214 ${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR}"
215 if [ "${SADC_OPT}" != "" ];
216 then
217         echo -n "sadc_options=\"${SADC_OPT}\""
218 fi
219 echo "${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
220 echo
221
222 ./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
223 ${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
224 sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS} \
225 ${STRIP}${COPY_ONLY}
226