2013-06-03 17:05:59 +02:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
2013-08-19 15:24:09 +02:00
AC_INIT([Icinga2Web], [1.0.0], [info@icinga.org])
2013-06-28 16:20:47 +02:00
AC_PREFIX_DEFAULT(/usr/local/icinga2-web)
2013-06-03 17:05:59 +02:00
if test "x$prefix" = "xNONE" ; then
2013-06-28 16:20:47 +02:00
installDir="/usr/local/icinga2-web"
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-07-01 17:51:18 +02:00
AC_ARG_WITH([icinga2web_config_path],
AS_HELP_STRING([--with-icinga2web-config-path], [Configuration path for icinga ]),
icinga2web_config_path="'$withval'",
icinga2web_config_path="'$prefix/config/'"
)
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],
AS_HELP_STRING([--with-web-path=PATH], [web sub path (default /cranberry)]),
web_path=$withval,
web_path=/cranberry
)
AC_ARG_WITH([www_conf_path],
2013-06-28 16:20:47 +02:00
AS_HELP_STRING([--with-http-configuration-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d)]),
2013-06-03 17:05:59 +02:00
www_conf_path=$withval,
www_conf_path=AC_PATH_GUESS([/etc/httpd/conf.d /etc/apache2/conf.d /etc/apache/conf.d], [www_conf_path], [/etc/apache2/conf.d])
)
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
)
AC_ARG_WITH([internal_db_name],
AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icinga2web)]),
internal_db_name=$withval,
internal_db_name=icinga2web
)
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
)
AC_ARG_WITH([internal_db_pass],
AS_HELP_STRING([--with-internal-db-pass=PASS], [database pass to use for internal database (default icinga2web)]),
internal_db_pass=$withval,
internal_db_pass=icinga2web
)
AC_ARG_WITH([internal_db_user],
AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icinga2web)]),
internal_db_user=$withval,
internal_db_user=icinga2web
)
#
# Authorization method
#
AC_ARG_WITH([internal_authentication],
AC_HELP_STRING([--with-internal-authentication], [use the internal database for authentication (default: yes)]),
internal_authentication=yes,
internal_authentication=def
)
AC_ARG_WITH([ldap_authentication],
AC_HELP_STRING([--with-ldap-authentication], [use a ldap server for authentication (default: no)]),
ldap_authentication=yes,
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,
ldap_binddn=["cn=Manager, ou=icinga, ou=org"]
)
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,
ldap_bindpass=["secret"]
)
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
AC_ARG_WITH([ldap_attribute_password],
AS_HELP_STRING([--with-ldap-attribute-password=LDAP_ATTRIBUTE], [user attribute to use for the password (default: password)]),
ldap_attribute_password=$withval,
ldap_attribute_password="password"
2013-06-28 16:20:47 +02:00
)
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([ldap_group_objectclass],
AS_HELP_STRING([--with-ldap-group-objectclass=LDAP_ATTRIBUTE], [ldap object type to use for group authentication (default: inetOrgPerson)]),
ldap_group_objectclass=$withval,
ldap_group_objectclass="group"
)
2013-08-19 15:24:09 +02:00
2013-07-01 17:51:18 +02:00
AC_ARG_WITH([ldap_attribute_groupname],
AS_HELP_STRING([--with-ldap-attribute-groupname=LDAP_OBJECT_CLASS], [user object type to use for the authentication (default: inetOrgPerson)]),
ldap_attribute_groupname=$withval,
ldap_attribute_groupname="guid"
2013-06-28 16:20:47 +02:00
)
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"
)
#
# 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,
ido_db_type="statusdat"
)
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
)
AC_ARG_WITH([ido_database],
AS_HELP_STRING([--with-ido-database=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
ido_database=$withval,
ido_database="icinga"
)
AC_ARG_WITH([ido_user],
AS_HELP_STRING([--with-ido-host=USER], [user to use for retrieving data from the ido db (default: icinga)]),
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],
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"
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
#
# Comment out the disabled backends per default
#
2013-07-01 17:51:18 +02:00
ido_enabled="disable=1"
statusdat_enabled="disable=1"
livestatus_enabled="disable=1"
ldap_enabled="disable=1"
AS_CASE([$icinga_backend],
["ido"], [ido_enabled=""],
["statusdat"], [statusdat_enabled=""],
["livestatus"], [livestatus_enabled=""],
[statusdat_enabled=""])
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])
ldap_enabled=""
)
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)
AC_SUBST(www_conf_path)
AC_SUBST(bin_user)
AC_SUBST(bin_group)
2013-07-01 17:51:18 +02:00
AC_SUBST(icinga2web_config_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)
AC_SUBST(internal_db_pass)
# 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)
AC_SUBST(ldap_attribute_password)
2013-07-01 17:51:18 +02:00
AC_SUBST(ldap_group_objectclass)
AC_SUBST(ldap_attribute_groupname)
# backend setup
AC_SUBST(icinga_backend)
# ido backend variables
AC_SUBST(ido_db_type)
AC_SUBST(ido_host)
AC_SUBST(ido_port)
AC_SUBST(ido_database)
AC_SUBST(ido_user)
AC_SUBST(ido_password)
# status.dat backend
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)
# command pipe
AC_SUBST(icinga_commandpipe)
# Comment placeholders for toggling backends
AC_SUBST(livestatus_enabled)
AC_SUBST(statusdat_enabled)
AC_SUBST(ido_enabled)
AC_SUBST(ldap_enabled)
2013-06-28 16:20:47 +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)
AC_SUBST(internal_db_pass)
# 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)
AC_SUBST(ldap_attribute_password)
2013-07-01 17:51:18 +02:00
AC_SUBST(ldap_group_objectclass)
AC_SUBST(ldap_attribute_groupname)
2013-06-28 16:20:47 +02:00
2013-07-01 17:51:18 +02:00
# backend setup
AC_SUBST(icinga_backend)
# ido backend variables
AC_SUBST(ido_db_type)
AC_SUBST(ido_host)
AC_SUBST(ido_port)
AC_SUBST(ido_database)
AC_SUBST(ido_user)
AC_SUBST(ido_password)
# status.dat backend
AC_SUBST(statusdat_file)
AC_SUBST(objects_cache_file)
# livestatus backend
AC_SUBST(livestatus_socket)
# command pipe
AC_SUBST(icinga_commandpipe)
# Comment placeholders for toggling backends
AC_SUBST(livestatus_enabled)
AC_SUBST(statusdat_enabled)
AC_SUBST(ido_enabled)
AC_SUBST(ldap_enabled)
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-08-19 15:24:09 +02:00
config/modules/monitoring/backends.ini
2013-07-01 17:51:18 +02:00
public/index.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