2013-06-03 17:05:59 +02:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
2013-10-22 10:30:41 +02:00
AC_INIT([IcingaWeb2], [1.0.0], [info@icinga.org])
2013-08-23 11:33:54 +02:00
AC_PREFIX_DEFAULT(/usr/local/icingaweb)
2013-06-03 17:05:59 +02:00
if test "x$prefix" = "xNONE" ; then
2013-08-23 11:33:54 +02:00
installDir="/usr/local/icingaweb"
2013-06-03 17:05:59 +02:00
prefix=$installDir
else
installDir=$prefix
fi
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_GREP
AC_PROG_SED
# Check for php
AC_ARG_VAR([PHP],[php cli binary])
AC_CHECK_PHP_INCLUDE([Zend/Application.php],[Zend Framework])
AC_CHECK_PHP_VERSION([5],[3],[0])
AC_CHECK_BIN([PHP], [php])
# Checks for libraries.
AC_CHECK_PHP_MODULE([sockets json])
2013-08-19 15:24:09 +02:00
#
# Configuration files
#
2013-08-23 11:33:54 +02:00
AC_ARG_WITH([icingaweb_config_path],
2013-10-20 18:32:39 +02:00
AS_HELP_STRING([--with-icingaweb-config-path=PATH], [Configuration path for icinga web (default $prefix/config)]),
2013-10-22 11:39:06 +02:00
icingaweb_config_path=$withval,
icingaweb_config_path=$prefix/config
2013-07-01 17:51:18 +02:00
)
2013-10-20 18:32:39 +02:00
#
# Log files
#
AC_ARG_WITH([icingaweb_log_path],
AS_HELP_STRING([--with-icingaweb-log-path=PATH], [Log path for icinga web (default $prefix/var/log)]),
icingaweb_log_path=$withval,
icingaweb_log_path=$prefix/var/log
)
2013-06-28 16:20:47 +02:00
#
2013-08-19 15:24:09 +02:00
# Users for webfiles
2013-06-28 16:20:47 +02:00
#
2013-06-03 17:05:59 +02:00
AC_ARG_WITH([web_user],
AS_HELP_STRING([--with-web-user=USER], [username for web writable files (default www-data)]),
web_user=$withval,
AC_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,
AC_GROUP_GUESS([www www-data apache httpd nogroup nobody],[web_group], [www-data])
)
AC_ARG_WITH([web_path],
2013-08-23 11:33:54 +02:00
AS_HELP_STRING([--with-web-path=PATH], [web sub path (default /icingaweb)]),
2013-06-03 17:05:59 +02:00
web_path=$withval,
2013-08-23 11:33:54 +02:00
web_path=/icingaweb
2013-06-03 17:05:59 +02:00
)
2013-10-20 16:00:12 +02:00
AC_ARG_WITH([httpd_config_path],
AS_HELP_STRING([--with-httpd-config-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d)]),
httpd_config_path=$withval,
httpd_config_path=AC_PATH_GUESS([/etc/httpd/conf.d /etc/apache2/conf-available /etc/apache2/conf.d /etc/apache/conf.d], [httpd_config_path], [/etc/apache2/conf.d])
2013-06-03 17:05:59 +02:00
)
2013-06-28 16:20:47 +02:00
#
# Users and groups for installation
#
2013-06-03 17:05:59 +02:00
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
)
2013-06-28 16:20:47 +02:00
#
# Internal database setup
#
AC_ARG_WITH([internal_db_type],
AS_HELP_STRING([--with-internal-db-type=TYPE], [database type to use for internal database (default mysql, supported: pgsql, mysql)]),
internal_db_type=$withval,
internal_db_type=mysql
)
2013-10-22 13:32:10 +02:00
ICINGA_CHECK_DBTYPE($internal_db_type, [--with-internal-db-type])
2013-06-28 16:20:47 +02:00
AC_ARG_WITH([internal_db_name],
2013-08-23 11:33:54 +02:00
AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icingaweb)]),
2013-06-28 16:20:47 +02:00
internal_db_name=$withval,
2013-08-23 11:33:54 +02:00
internal_db_name=icingaweb
2013-06-28 16:20:47 +02:00
)
2013-08-19 15:24:09 +02:00
2013-06-28 16:20:47 +02:00
AC_ARG_WITH([internal_db_host],
AS_HELP_STRING([--with-internal-db-host=HOST], [database host to use for internal database (default localhost)]),
internal_db_host=$withval,
internal_db_host=localhost
)
AC_ARG_WITH([internal_db_port],
AS_HELP_STRING([--with-internal-db-port=PORT], [database port to use for internal database (default: 3306 for mysql, 5432 for pgsql)]),
internal_db_port=$withval,
internal_db_port=db_default_port
)
2013-10-22 17:49:49 +02:00
AC_ARG_WITH([internal_db_password],
AS_HELP_STRING([--with-internal-db-password=PASS], [database pass to use for internal database (default icingaweb)]),
internal_db_password=$withval,
internal_db_password=icingaweb
2013-06-28 16:20:47 +02:00
)
AC_ARG_WITH([internal_db_user],
2013-08-23 11:33:54 +02:00
AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icingaweb)]),
2013-06-28 16:20:47 +02:00
internal_db_user=$withval,
2013-08-23 11:33:54 +02:00
internal_db_user=icingaweb
2013-06-28 16:20:47 +02:00
)
#
# Authorization method
#
AC_ARG_WITH([internal_authentication],
AC_HELP_STRING([--with-internal-authentication], [use the internal database for authentication (default: yes)]),
2013-10-22 14:16:46 +02:00
internal_authentication=$withval,
2013-08-27 14:37:22 +02:00
internal_authentication=yes
2013-06-28 16:20:47 +02:00
)
AC_ARG_WITH([ldap_authentication],
AC_HELP_STRING([--with-ldap-authentication], [use a ldap server for authentication (default: no)]),
2013-10-22 14:16:46 +02:00
ldap_authentication=$withval,
2013-06-28 16:20:47 +02:00
ldap_authentication=no
)
#
# LDAP Authorization
#
AC_ARG_WITH([ldap_host],
AS_HELP_STRING([--with-ldap-host=HOST], [host to use for authentication via ldap (default localhost)]),
ldap_host=$withval,
ldap_host=localhost
)
AC_ARG_WITH([ldap_port],
AS_HELP_STRING([--with-ldap-port=PORT], [port to use for authentication via ldap (default 389)]),
ldap_port=$withval,
ldap_port=389
)
AC_ARG_WITH([ldap_binddn],
AS_HELP_STRING([--with-ldap-binddn=DN], [dn to use for retrieving user information via ldap (default cn=admin, cn=config)]),
ldap_binddn=$withval,
2013-08-26 16:54:23 +02:00
ldap_binddn=["cn=admin,cn=config"]
2013-06-28 16:20:47 +02:00
)
AC_ARG_WITH([ldap_bindpass],
AS_HELP_STRING([--with-ldap-bindpass=PASS], [password to use for retrieving user information via ldap (default admin)]),
ldap_bindpass=$withval,
2013-08-26 16:54:23 +02:00
ldap_bindpass=["admin"]
2013-06-28 16:20:47 +02:00
)
AC_ARG_WITH([ldap_rootdn],
AS_HELP_STRING([--with-ldap-rootdn=LDAP_ATTRIBUTE], [root dn to use for user lookup (default ou=people, dc=icinga, dc=org)]),
ldap_rootdn=$withval,
ldap_rootdn=["ou=people, dc=icinga, dc=org"]
)
2013-08-19 15:24:09 +02:00
AC_ARG_WITH([ldap_user_objectclass],
2013-07-01 17:51:18 +02:00
AS_HELP_STRING([--with-ldap-user-objectclass=LDAP_OBJECT_CLASS], [ldap object class to use for user authentication (default: inetOrgPerson)]),
ldap_user_objectclass=$withval,
ldap_user_objectclass="inetOrgPerson"
2013-06-28 16:20:47 +02:00
)
2013-08-19 15:24:09 +02:00
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([ldap_attribute_username],
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (default: uid)]),
2013-06-28 16:20:47 +02:00
ldap_attribute_username=$withval,
ldap_attribute_username="uid"
)
2013-07-01 17:51:18 +02:00
#
# Icinga backend selection
#
AC_ARG_WITH([icinga_backend],
AS_HELP_STRING([--with-icinga-backend=(ido, statusdat, livestatus)], [backend to use for rb (default: statusdat)]),
icinga_backend=$withval,
icinga_backend="statusdat"
)
2013-10-22 17:49:49 +02:00
ICINGA_CHECK_BACKENDTYPE($icinga_backend, [--with-icinga-backend])
2013-07-01 17:51:18 +02:00
#
# Ido settings
#
AC_ARG_WITH([ido_db_type],
AS_HELP_STRING([--with-ido-db-type=(mysql, pgsql)], [database engine to use for retrieving data from the ido db (default: mysql)]),
ido_db_type=$withval,
2013-08-19 18:28:14 +02:00
ido_db_type="mysql"
2013-07-01 17:51:18 +02:00
)
2013-10-22 13:32:10 +02:00
ICINGA_CHECK_DBTYPE($ido_db_type, [--with-ido-db-type])
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([ido_host],
AS_HELP_STRING([--with-ido-host=HOST], [host to use for retrieving data from the ido db (default: localhost)]),
ido_host=$withval,
ido_host="localhost"
)
AC_ARG_WITH([ido_port],
AS_HELP_STRING([--with-ido-port=PORT], [backend to use for retrieving data from the ido db (default: 3306 for mysql. 5432 for pgsql)]),
ido_port=$withval,
ido_port=db_default_port
)
2013-10-22 17:49:49 +02:00
AC_ARG_WITH([ido_db_name],
AS_HELP_STRING([--with-ido-db-name=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
ido_db_name=$withval,
ido_db_name="icinga"
2013-07-01 17:51:18 +02:00
)
AC_ARG_WITH([ido_user],
2013-10-22 17:49:49 +02:00
AS_HELP_STRING([--with-ido-user=USER], [user to use for retrieving data from the ido db (default: icinga)]),
2013-07-01 17:51:18 +02:00
ido_user=$withval,
ido_user="icinga"
)
AC_ARG_WITH([ido_password],
AS_HELP_STRING([--with-ido-password=PASSWORD], [password to use for retrieving data from the ido db (default: icinga)]),
ido_password=$withval,
ido_password="icinga"
)
#
# Statusdat file location
#
AC_ARG_WITH([statusdat_file],
AS_HELP_STRING([--with-statusdat-file=FILE], [location of the status.dat file when retrieving data from status.dat (default: /usr/local/icinga/var/status.dat)]),
statusdat_file=$withval,
statusdat_file="/usr/local/icinga/var/status.dat"
2013-06-28 16:20:47 +02:00
)
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([objects_cache_file],
2013-10-22 16:04:38 +02:00
AS_HELP_STRING([--with-objects-cache-file=FILE], [location of the objects.cache file when retrieving data from status.dat (default: /usr/local/icinga/var/objects.cache)]),
2013-07-01 17:51:18 +02:00
objects_cache_file=$withval,
objects_cache_file="/usr/local/icinga/var/objects.cache"
2013-08-19 15:24:09 +02:00
)
2013-07-01 17:51:18 +02:00
#
# Livestatus connection
#
AC_ARG_WITH([livestatus_socket],
AS_HELP_STRING([--with-livestatus-socket=FILE], [location of the livestatus socket (default: /usr/local/icinga/var/rw/live)]),
livestatus_socket=$withval,
livestatus_socket="/usr/local/icinga/var/rw/live"
)
#
2013-08-19 15:24:09 +02:00
# Icinga commandpipe
2013-07-01 17:51:18 +02:00
#
AC_ARG_WITH([icinga_commandpipe],
AS_HELP_STRING([--with-icinga-commandpipe=FILE], [location of the command pipe used for sending commands (default: /usr/local/icinga/var/rw/icinga.cmd)]),
icinga_commandpipe=$withval,
icinga_commandpipe="/usr/local/icinga/var/rw/icinga.cmd"
)
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([objects_cache_file],
AS_HELP_STRING([--with-objects-file=FILE], [location of the objects.cache file when retrieving data from status.dat (default: /usr/local/icinga/var/objects.cache)]),
objects_cache_file=$withval,
objects_cache_file="/usr/local/icinga/var/objects.cache"
)
#
# Livestatus connection
#
AC_ARG_WITH([livestatus_socket],
AS_HELP_STRING([--with-livestatus-socket=FILE], [location of the livestatus socket (default: /usr/local/icinga/var/rw/live)]),
livestatus_socket=$withval,
livestatus_socket="/usr/local/icinga/var/rw/live"
)
#
# Icinga commandpipe
#
AC_ARG_WITH([icinga_commandpipe],
AS_HELP_STRING([--with-icinga-commandpipe=FILE], [location of the command pipe used for sending commands (default: /usr/local/icinga/var/rw/icinga.cmd)]),
icinga_commandpipe=$withval,
icinga_commandpipe="/usr/local/icinga/var/rw/icinga.cmd"
)
2013-06-28 16:20:47 +02:00
2013-06-03 17:05:59 +02:00
# Installation options
INSTALL_OPTS="-o $bin_user -g $bin_group"
INSTALL_OPTS_WEB="-o $web_user -g $web_group"
2013-07-01 17:51:18 +02:00
AS_IF([test "x$internal_db_type" = xmysql], [
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Mysql.php],[Zend Framework - MySQL PDO Adapter])
AC_CHECK_PHP_MODULE([mysql])
AS_IF([test "x$internal_db_port" == xdb_default_port], [internal_db_port=3306])
])
AS_IF([test "x$ido_db_type" = xmysql], [
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Mysql.php],[Zend Framework - MySQL PDO Adapter])
AC_CHECK_PHP_MODULE([mysql])
AS_IF([test "x$ido_port" = xdb_default_port], [ido_port=3306])
])
AS_IF([test "x$internal_db_type" = xpgsql], [
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Pgsql.php],[Zend Framework - PostgreSQL PDO Adapter])
AC_CHECK_PHP_MODULE([pgsql])
AS_IF([test "x$internal_db_port" = xdb_default_port], [internal_db_port=5432])
])
AS_IF([test "x$ido_db_type" = xpgsql], [
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Pgsql.php],[Zend Framework - PostgreSQL PDO Adapter])
AC_CHECK_PHP_MODULE([pgsql])
AS_IF([test "x$ido_port" = xdb_default_port], [ido_port=5432])
])
2013-08-19 15:24:09 +02:00
#
2013-10-22 17:49:49 +02:00
# Disable authentication backends
2013-08-19 15:24:09 +02:00
#
2013-10-22 16:04:38 +02:00
ido_enabled="disabled = \"1\""
statusdat_enabled="disabled = \"1\""
livestatus_enabled="disabled = \"1\""
2013-07-01 17:51:18 +02:00
AS_CASE([$icinga_backend],
["ido"], [ido_enabled=""],
["statusdat"], [statusdat_enabled=""],
["livestatus"], [livestatus_enabled=""],
[statusdat_enabled=""])
2013-10-22 16:47:04 +02:00
ldap_auth_disabled="disabled = \"1\""
2013-06-28 16:20:47 +02:00
AS_IF([test "x$ldap_authentication" != xno],
2013-07-01 17:51:18 +02:00
AC_CHECK_PHP_MODULE([ldap])
2013-10-22 16:47:04 +02:00
ldap_auth_disabled=""
2013-08-27 14:37:22 +02:00
)
2013-10-22 16:47:04 +02:00
internal_auth_disabled="disabled = \"1\""
2013-08-27 14:37:22 +02:00
AS_IF([test "x$internal_authentication" != xno],
AC_CHECK_PHP_MODULE([ldap])
2013-10-22 16:47:04 +02:00
internal_auth_disabled=""
2013-07-01 17:51:18 +02:00
)
2013-06-28 16:20:47 +02:00
2013-08-19 15:24:09 +02:00
#
# Substitution variables
#
2013-06-28 16:20:47 +02:00
# Installation directives
2013-06-03 17:05:59 +02:00
AC_SUBST(app_name)
AC_SUBST(web_user)
AC_SUBST(web_group)
AC_SUBST(web_path)
2013-10-20 16:00:12 +02:00
AC_SUBST(httpd_config_path)
2013-06-03 17:05:59 +02:00
AC_SUBST(bin_user)
AC_SUBST(bin_group)
2013-08-23 11:33:54 +02:00
AC_SUBST(icingaweb_config_path)
2013-10-20 18:32:39 +02:00
AC_SUBST(icingaweb_log_path)
2013-06-03 17:05:59 +02:00
2013-06-28 16:20:47 +02:00
# Internal db setup
AC_SUBST(internal_db_type)
AC_SUBST(internal_db_name)
AC_SUBST(internal_db_host)
AC_SUBST(internal_db_port)
AC_SUBST(internal_db_user)
2013-10-22 17:49:49 +02:00
AC_SUBST(internal_db_password)
2013-06-28 16:20:47 +02:00
# ldap setup
AC_SUBST(ldap_host)
AC_SUBST(ldap_port)
AC_SUBST(ldap_rootdn)
AC_SUBST(ldap_binddn)
AC_SUBST(ldap_bindpass)
2013-07-01 17:51:18 +02:00
AC_SUBST(ldap_user_objectclass)
2013-06-28 16:20:47 +02:00
AC_SUBST(ldap_attribute_basedn)
AC_SUBST(ldap_attribute_username)
2013-07-01 17:51:18 +02:00
# backend setup
AC_SUBST(icinga_backend)
# ido backend variables
2013-10-22 16:04:38 +02:00
AC_SUBST(ido_enabled)
2013-07-01 17:51:18 +02:00
AC_SUBST(ido_db_type)
AC_SUBST(ido_host)
AC_SUBST(ido_port)
2013-10-22 17:49:49 +02:00
AC_SUBST(ido_db_name)
2013-07-01 17:51:18 +02:00
AC_SUBST(ido_user)
AC_SUBST(ido_password)
# status.dat backend
2013-10-22 16:04:38 +02:00
AC_SUBST(statusdat_enabled)
2013-07-01 17:51:18 +02:00
AC_SUBST(statusdat_file)
AC_SUBST(objects_cache_file)
2013-06-28 16:20:47 +02:00
2013-07-01 17:51:18 +02:00
# livestatus backend
AC_SUBST(livestatus_socket)
2013-10-22 16:04:38 +02:00
AC_SUBST(livestatus_enabled)
2013-07-01 17:51:18 +02:00
# command pipe
AC_SUBST(icinga_commandpipe)
# Comment placeholders for toggling backends
2013-07-01 17:51:18 +02:00
2013-10-22 16:47:04 +02:00
AC_SUBST(ldap_auth_disabled)
AC_SUBST(internal_auth_disabled)
2013-06-28 16:20:47 +02:00
2013-08-19 15:24:09 +02:00
# Application and installation
2013-06-03 17:05:59 +02:00
AC_SUBST(PHP)
AC_SUBST(INSTALL_OPTS)
AC_SUBST(INSTALL_OPTS_WEB)
2013-08-19 15:24:09 +02:00
#
# Create config files
#
2013-06-03 17:05:59 +02:00
AC_CONFIG_FILES([
Makefile
2013-07-01 17:51:18 +02:00
config/authentication.ini
2013-10-20 18:32:39 +02:00
config/config.ini
2013-08-19 18:28:14 +02:00
config/resources.ini
2013-08-19 15:24:09 +02:00
config/modules/monitoring/backends.ini
2013-10-20 16:00:12 +02:00
config/modules/monitoring/instances.ini
2013-08-23 11:33:54 +02:00
etc/apache/icingaweb.conf
2013-08-27 14:37:22 +02:00
public/.htaccess
2013-10-20 17:47:35 +02:00
public/index.php
2014-02-18 20:18:12 +01:00
public/css.php
2013-06-03 17:05:59 +02:00
])
2013-08-19 15:24:09 +02:00
#
# Commit and write
#
2013-06-03 17:05:59 +02:00
AC_OUTPUT