This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
/
configure.ac
447 lines (369 loc) · 11.6 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# include some meta
m4_include([etc/make/version.m4])
# Which version of AC
AC_PREREQ(2.61)
# Init project
AC_INIT(icinga-web, [ICINGA_VERSION], [dev.icinga.org])
# Release date
RELEASE_DATE=ICINGA_RELEASE_DATE
AC_PREFIX_DEFAULT(/usr/local/icinga-web)
if test "x$prefix" = "xNONE" ; then
installDir="/usr/local/icinga-web"
prefix=$installDir
else
installDir=$prefix
fi
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_GREP
AC_PROG_SED
# Extract version parts
ACICINGA_EXTRACT_VERSION([VERSION_MAJOR],[VERSION_MINOR],[VERSION_PATCH],[VERSION_EXTEN])
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_PATCH)
AC_SUBST(VERSION_EXTEN)
AC_SUBST(RELEASE_DATE)
# Check for php
AC_ARG_VAR([PHP],[php cli binary])
ACICINGA_CHECK_BIN([PHP], [php])
# Check for mysql
# We don't need the client anymore, so this is commented out
# AC_ARG_VAR([MYSQL],[mysql client binary])
# ACICINGA_CHECK_BIN([MYSQL], [mysql])
# Check for phing - not required in normal non-dev installations
AC_ARG_VAR([PHING],[phing build tool])
ACICINGA_CHECK_BIN([PHING], [phing])
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
ACICINGA_CHECK_PHP_MODULE([sockets xsl xml json])
# Define install options
# Meta option
AC_ARG_WITH([app_name],
AS_HELP_STRING([--with-app-name=NAME], [Application name (default Icinga)]),
app_name=$withval,
app_name=Icinga
)
# Users for webfiles
AC_ARG_WITH([web_user],
AS_HELP_STRING([--with-web-user=USER], [username for web writable files (default www-data)]),
web_user=$withval,
ACICINGA_USER_GUESS([www wwwrun www-data apache httpd nobody],[web_user],[www-data])
)
AC_ARG_WITH([web_group],
AS_HELP_STRING([--with-web-group=GROUP], [group for web writable files (default www-data)]),
web_group=$withval,
ACICINGA_GROUP_GUESS([www www-data apache httpd nogroup nobody],[web_group], [www-data])
)
AC_ARG_WITH([web_path],
AS_HELP_STRING([--with-web-path=PATH], [web sub path (default /icinga-web)]),
web_path=$withval,
web_path=/icinga-web
)
AC_ARG_WITH([web_absolute_path],
AS_HELP_STRING([--with-web-absolute-path=PATH], [absolute path to pub (default %core.root_dir%/pub)]),
web_absolute_path=$withval,
web_absolute_path=%core.root_dir%/pub
)
AC_ARG_WITH([web_apache_path],
AS_HELP_STRING([--with-web-apache-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d]),
web_apache_path=$withval,
web_apache_path=ACICINGA_PATH_GUESS([/etc/httpd/conf.d /etc/apache2/conf-available /etc/apache2/conf.d /etc/apache/conf.d], [web_apache_path], [/etc/apache2/conf.d])
)
AC_ARG_WITH([clearcache_path],
AS_HELP_STRING([--with-clearcache-path=PATH], [Path to install the clearcache script]),
clearcache_bin_path=$withval,
clearcache_bin_path=$prefix/bin
)
AC_ARG_WITH([bin_user],
AS_HELP_STRING([--with-bin-user=USER], [user for all other files (default root)]),
bin_user=$withval,
bin_user=root
)
AC_ARG_WITH([bin_group],
AS_HELP_STRING([--with-bin-group=GROUP], [group for all other files (default bin)]),
bin_group=$withval,
bin_group=bin
)
# Web database switches
AC_ARG_WITH([db_type],
AS_HELP_STRING([--with-db-type=DBTYPE], [Type of dbms (default mysql)]),
db_type=$withval,
db_type=mysql
)
AC_ARG_WITH([db_host],
AS_HELP_STRING([--with-db-host=HOST], [Host of dbms (default localhost)]),
db_host=$withval,
db_host=localhost
)
AC_ARG_WITH([db_port],
AS_HELP_STRING([--with-db-port=PORT], [Port of the dbms (default 3306)]),
db_port=$withval,
db_port=3306
)
AC_ARG_WITH([db_name],
AS_HELP_STRING([--with-db-name=DBNAME], [DB name for icinga (default icinga_web)]),
db_name=$withval,
db_name=icinga_web
)
ACICINGA_ESCAPE_DBNAME([db_name])
AC_ARG_WITH([db_user],
AS_HELP_STRING([--with-db-user=USER], [DB user for icinga (default icinga_web)]),
db_user=$withval,
db_user=icinga_web
)
AC_ARG_WITH([db_pass],
AS_HELP_STRING([--with-db-pass=PASS], [DB pass for icinga (default icinga_web)]),
db_pass=$withval,
db_pass=icinga_web
)
AC_ARG_WITH([db_socket],
AS_HELP_STRING([--with-db-socket=SOCKET], [DB path to unix socket (default /tmp/mysql.sock)]),
db_socket=$withval,
db_socket=/tmp/mysql.sock
)
# Configure the icinga-api
AC_ARG_WITH([api_type],
AS_HELP_STRING([--with-api-type=APICON], [API type (default CONNECTION_IDO)]),
api_type=$withval,
api_type=CONNECTION_IDO
)
AC_ARG_WITH([api_subtype],
AS_HELP_STRING([--with-api-subtype=TYPE], [DB driver or network connection]),
api_subtype=$withval,
api_subtype=mysql
)
AC_ARG_WITH([api_host],
AS_HELP_STRING([--with-api-host=HOST], [Host to connect (DB or other) (default localhost)]),
api_host=$withval,
api_host=localhost
)
AC_ARG_WITH([api_port],
AS_HELP_STRING([--with-api-port=PORT], [Port for connection (default 3306)]),
api_port=$withval,
api_port=3306
)
AC_ARG_WITH([api_socket],
AS_HELP_STRING([--with-api-socket=PATH], [Path to socket (default none)]),
api_socket=$withval,
api_socket=
)
AC_ARG_WITH([api_db_user],
AS_HELP_STRING([--with-api-db-user=USER], [DB username (default icinga)]),
api_db_user=$withval,
api_db_user=icinga
)
AC_ARG_WITH([api_db_pass],
AS_HELP_STRING([--with-api-db-pass=PASS], [DB password (default icinga)]),
api_db_pass=$withval,
api_db_pass=icinga
)
AC_ARG_WITH([api_db_name],
AS_HELP_STRING([--with-api-db-name=DBNAME], [DB name (default icinga)]),
api_db_name=$withval,
api_db_name=icinga
)
AC_ARG_WITH([api_db_prefix],
AS_HELP_STRING([--with-api-db-prefix=PREFIX], [DB table prefiy (default icinga_)]),
api_db_prefix=$withval,
api_db_prefix=icinga_
)
AC_ARG_WITH([api_cmd_file],
AS_HELP_STRING([--with-api-cmd-file=PATH], [Icinga command file (default /usr/local/icinga/var/rw/icinga.cmd)]),
api_cmd_file=$withval,
api_cmd_file=/usr/local/icinga/var/rw/icinga.cmd
)
AC_ARG_WITH([api_cmd_instance],
AS_HELP_STRING([--with-api-cmd-instance=NAME], [Icinga default command instance name (default "default")]),
api_cmd_instance=$withval,
api_cmd_instance=default
)
AC_ARG_WITH([devel_mode],
AS_HELP_STRING([--with-devel-mode], [Web devel mode (disable caching)]),
devel_mode=$withval,
devel_mode=no
)
AC_ARG_WITH([sla_default_timespan],
AS_HELP_STRING([--with-sla-default-timespan=TIMESPAN], [The timespan used for non-detailed sla overviews]),
sla_default_timespan=$withval,
sla_default_timespan="-1 month"
)
AC_ARG_WITH([enable_sla],
AS_HELP_STRING([--with-enable-sla], [Enable SLA support]),
enable_sla=$withval,
enable_sla=false
)
# Configuration location
AC_ARG_WITH([conf_dir],
AS_HELP_STRING([--with-conf-dir=PATH], [Folder where to store custom user configurations (default etc/conf.d/)]),
web_conf_dir=$withval,
web_conf_dir=$prefix/etc/conf.d
)
# Log location
AC_ARG_WITH([log_dir],
AS_HELP_STRING([--with-log-dir=PATH], [Folder where to store log files (default log/)]),
web_log_dir=$withval,
web_log_dir=$prefix/log
)
# Agavi caching directory
AC_ARG_WITH([cache_dir],
AS_HELP_STRING([--with-cache-dir=PATH], [Directory to store agavi cache files (default app/cache/)]),
web_cache_dir=$withval,
web_cache_dir=$prefix/app/cache
)
# Jasper temporary directory for downloads
AC_ARG_WITH([reporting_tmp_dir],
AS_HELP_STRING([--with-reporting-tmp-dir=PATH], [Directory to store temporary files for jasper (default app/modules/Reporting/data/tmp)]),
reporting_tmp_dir=$withval,
reporting_tmp_dir=$prefix/app/modules/Reporting/data/tmp/
)
# icinga core options
AC_ARG_WITH([icinga_objects_dir],
AS_HELP_STRING([--with-icinga-objects-dir=PATH], [Path Icinga configuration items]),
icinga_objects_dir=$withval,
icinga_objects_dir=/usr/local/icinga/etc/objects
)
ACICINGA_RESOURCE_EXISTS([icinga_objects_dir], [$icinga_objects_dir])
AC_ARG_WITH([icinga_bin],
AS_HELP_STRING([--with-icinga-bin=PATH], [Icinga core binary]),
icinga_bin=$withval,
icinga_bin=/usr/local/icinga/bin/icinga
)
ACICINGA_RESOURCE_EXISTS([icinga], [$icinga_bin])
AC_ARG_WITH([icinga_cfg],
AS_HELP_STRING([--with-icinga-cfg=PATH], [Icinga core main configuration file]),
icinga_cfg=$withval,
icinga_cfg=/usr/local/icinga/etc/icinga.cfg
)
ACICINGA_RESOURCE_EXISTS([icinga_config], [$icinga_cfg])
# Testing switches
AC_ARG_WITH([phpunit],
AS_HELP_STRING([--with-phpunit=BINARY], [Path to phpunit script]),
PHPUNIT=$withval,
PHPUNIT=phpunit
)
# Supress warnings to the user
#ACICINGA_CHECK_BIN([PHPUNIT], [$phpunit])
AC_ARG_WITH([phpcs],
AS_HELP_STRING([--with-phpcs=BINARY], [Path to phpcs script]),
PHPCS=$withval,
PHPCS=phpcs
)
# Supress warnings ro the user
#ACICINGA_CHECK_BIN([PHPCS], [$phpcs])
# Custom vars
INSTALL_OPTS="-o $bin_user -g $bin_group"
INSTALL_OPTS_WEB="-o $web_user -g $web_group"
INSTALL_OPTS_CACHE="-o $web_user -g $web_group"
flag_caching=true
flag_debug=false
CFLAGS=""
ACICINGA_DEVEL_MODE()
# Substitutions
AC_SUBST(app_name)
AC_SUBST(web_user)
AC_SUBST(web_group)
AC_SUBST(web_path)
AC_SUBST(web_absolute_path)
AC_SUBST(web_apache_path)
AC_SUBST(clearcache_bin_path)
AC_SUBST(bin_user)
AC_SUBST(bin_group)
AC_SUBST(db_type)
AC_SUBST(db_host)
AC_SUBST(db_port)
AC_SUBST(db_name)
AC_SUBST(db_user)
AC_SUBST(db_pass)
AC_SUBST(db_socket)
AC_SUBST(api_type)
AC_SUBST(api_subtype)
AC_SUBST(api_host)
AC_SUBST(api_port)
AC_SUBST(api_socket)
AC_SUBST(api_db_user)
AC_SUBST(api_db_pass)
AC_SUBST(api_db_name)
AC_SUBST(api_db_prefix)
AC_SUBST(api_cmd_file)
AC_SUBST(api_cmd_instance)
AC_SUBST(enable_sla)
AC_SUBST(sla_default_timespan)
AC_SUBST(CFLAGS)
AC_SUBST(PHP)
AC_SUBST(MYSQL)
AC_SUBST(PHING)
AC_SUBST(PHPUNIT)
AC_SUBST(PHPCS)
AC_SUBST(INSTALL_OPTS)
AC_SUBST(INSTALL_OPTS_WEB)
AC_SUBST(INSTALL_OPTS_CACHE)
AC_SUBST(flag_caching)
AC_SUBST(flag_debug)
AC_SUBST(web_log_dir)
AC_SUBST(web_conf_dir)
AC_SUBST(web_cache_dir)
AC_SUBST(reporting_tmp_dir)
AC_SUBST(icinga_api)
AC_SUBST(icinga_objects_dir)
AC_SUBST(icinga_bin)
AC_SUBST(icinga_cfg)
AC_CONFIG_FILES([
Makefile
lib/Makefile
lib/icingaScheduler/config.php
lib/icingaScheduler/Makefile
lib/jit/Makefile
lib/ext3/Makefile
lib/agavi/Makefile
lib/phpseclib/Makefile
lib/doctrine/Makefile
lib/jsgettext/Makefile
lib/raphael/Makefile
pub/Makefile
etc/Makefile
bin/Makefile
doc/Makefile
app/Makefile
app/config.php
app/config/databases.xml
app/config/icinga.xml
app/config/logging.xml
app/config/settings.xml
app/config/translation.xml
app/config/factories.xml
app/modules/Api/config/access.xml
app/modules/Api/config/module.xml
app/modules/Api/config/views.xml
app/modules/AppKit/config/module.xml
app/modules/AppKit/config/auth.xml
app/modules/Config/config/module.xml
app/modules/Cronks/config/module.xml
app/modules/Reporting/config/module.xml
app/modules/Web/config/module.xml
etc/build.properties
tests/phpunit/test.properties
etc/apache2/icinga-web.conf
etc/scheduler/icingaCron
bin/clearcache.sh
etc/conf.d/access.xml
etc/conf.d/databases.xml
etc/conf.d/Makefile
etc/conf.d/sla.xml
])
AC_OUTPUT
echo ""
echo "icinga-web successfully configured!"
echo ""
echo "Please proceed with make to install your icinga-web instance:"
echo ""
echo " * make Some general hints about make targets"
echo " * make install Install a new instance of icinga-web"
echo " * make upgrade Upgrades an existing installation:"
echo " keep site config files untouched!"
echo ""
# [EOF]