diff --git a/configure b/configure index 2a4787ea0..463acab96 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for Cranberry 0.0.1. +# Generated by GNU Autoconf 2.69 for Icinga2Web 0.0.1. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,6 +87,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -133,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -166,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -211,14 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -320,6 +356,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -441,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -475,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -496,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -547,18 +575,35 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='Cranberry' -PACKAGE_TARNAME='cranberry' +PACKAGE_NAME='Icinga2Web' +PACKAGE_TARNAME='icinga2web' PACKAGE_VERSION='0.0.1' -PACKAGE_STRING='Cranberry 0.0.1' +PACKAGE_STRING='Icinga2Web 0.0.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' -ac_default_prefix=/usr/local/i2 +ac_default_prefix=/usr/local/icinga2-web ac_subst_vars='LTLIBOBJS LIBOBJS INSTALL_OPTS_WEB INSTALL_OPTS +ldap_attribute_password +ldap_attribute_lastname +ldap_attribute_firstname +ldap_attribute_username +ldap_attribute_basedn +ldap_user_class +ldap_bindpass +ldap_binddn +ldap_rootdn +ldap_port +ldap_host +internal_db_pass +internal_db_user +internal_db_port +internal_db_host +internal_db_name +internal_db_type bin_group bin_user www_conf_path @@ -619,6 +664,24 @@ with_web_path with_www_conf_path with_bin_user with_bin_group +with_internal_db_type +with_internal_db_name +with_internal_db_host +with_internal_db_port +with_internal_db_pass +with_internal_db_user +with_internal_authentication +with_ldap_authentication +with_ldap_host +with_ldap_port +with_ldap_binddn +with_ldap_bindpass +with_ldap_rootdn +with_ldap_user_class +with_ldap_attribute_username +with_ldap_attribute_firstname +with_ldap_attribute_lastname +with_ldap_attribute_password ' ac_precious_vars='build_alias host_alias @@ -1028,7 +1091,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1079,8 +1142,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1166,7 +1227,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Cranberry 0.0.1 to adapt to many kinds of systems. +\`configure' configures Icinga2Web 0.0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1214,7 +1275,7 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/cranberry] + --docdir=DIR documentation root [DATAROOTDIR/doc/icinga2web] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1227,7 +1288,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Cranberry 0.0.1:";; + short | recursive ) echo "Configuration of Icinga2Web 0.0.1:";; esac cat <<\_ACEOF @@ -1238,9 +1299,59 @@ Optional Packages: --with-web-group=GROUP group for web writable files (default www-data) --with-web-path=PATH web sub path (default /cranberry) --with-http-configuration-path=PATH - Include folder apache2 (default /etc/apache2/conf.d + Include folder apache2 (default /etc/apache2/conf.d) --with-bin-user=USER user for all other files (default root) --with-bin-group=GROUP group for all other files (default bin) + --with-internal-db-type=TYPE + database type to use for internal database (default + mysql, supported: pgsql, mysql) + --with-internal-db-name=NAME + database name to use for internal database (default + icinga2web) + --with-internal-db-host=HOST + database host to use for internal database (default + localhost) + --with-internal-db-port=PORT + database port to use for internal database (default: + 3306 for mysql, 5432 for pgsql) + --with-internal-db-pass=PASS + database pass to use for internal database (default + icinga2web) + --with-internal-db-user=USER + database user to use for internal database (default + icinga2web) + --with-internal-authentication + use the internal database for authentication + (default: yes) + --with-ldap-authentication + use a ldap server for authentication (default: no) + --with-ldap-host=HOST host to use for authentication via ldap (default + localhost) + --with-ldap-port=PORT port to use for authentication via ldap (default + 389) + --with-ldap-binddn=DN dn to use for retrieving user information via ldap + (default cn=admin, cn=config) + --with-ldap-bindpass=PASS + password to use for retrieving user information via + ldap (default admin) + --with-ldap-rootdn=LDAP_ATTRIBUTE + root dn to use for user lookup (default ou=people, + dc=icinga, dc=org) + --with-ldap-attribute-username=LDAP_ATTRIBUTE + user object type to use for the authentication + (defaults inetOrgPerson) + --with-ldap-attribute-username=LDAP_ATTRIBUTE + user attribute to use for the username (defaults + uid) + --with-ldap-attribute-firstname=LDAP_ATTRIBUTE + user attribute to use for the firstname (defaults + firstname) + --with-ldap-attribute-lastname=LDAP_ATTRIBUTE + user attribute to use for the lastname (defaults + lastname) + --with-ldap-attribute-password=LDAP_ATTRIBUTE + user attribute to use for the password (defaults + password) Some influential environment variables: PHP php cli binary @@ -1311,10 +1422,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Cranberry configure 0.0.1 -generated by GNU Autoconf 2.67 +Icinga2Web configure 0.0.1 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1328,8 +1439,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Cranberry $as_me 0.0.1, which was -generated by GNU Autoconf 2.67. Invocation command line was +It was created by Icinga2Web $as_me 0.0.1, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1587,7 +1698,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -1679,7 +1790,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$prefix" = "xNONE" ; then - installDir="/usr/local/i2" + installDir="/usr/local/icinga2-web" prefix=$installDir else installDir=$prefix @@ -1732,7 +1843,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -1752,7 +1863,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1810,7 +1921,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -1824,7 +1935,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -1873,7 +1984,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -1893,7 +2004,7 @@ do for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -1970,7 +2081,7 @@ fi set dummy php; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PHP+set}" = set; then : +if ${ac_cv_path_PHP+:} false; then : $as_echo_n "(cached) " >&6 else case $PHP in @@ -1984,7 +2095,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PHP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2033,8 +2144,10 @@ fi # Checks for header files. - +# # Users for webfiles +# + # Check whether --with-web_user was given. if test "${with_web_user+set}" = set; then : @@ -2115,6 +2228,10 @@ fi fi +# +# Users and groups for installation +# + # Check whether --with-bin_user was given. if test "${with_bin_user+set}" = set; then : @@ -2135,11 +2252,262 @@ else fi +# +# Internal database setup +# + + +# Check whether --with-internal_db_type was given. +if test "${with_internal_db_type+set}" = set; then : + withval=$with_internal_db_type; internal_db_type=$withval +else + internal_db_type=mysql + +fi + + + +# Check whether --with-internal_db_name was given. +if test "${with_internal_db_name+set}" = set; then : + withval=$with_internal_db_name; internal_db_name=$withval +else + internal_db_name=icinga2web + +fi + + + +# Check whether --with-internal_db_host was given. +if test "${with_internal_db_host+set}" = set; then : + withval=$with_internal_db_host; internal_db_host=$withval +else + internal_db_host=localhost + +fi + + + +# Check whether --with-internal_db_port was given. +if test "${with_internal_db_port+set}" = set; then : + withval=$with_internal_db_port; internal_db_port=$withval +else + internal_db_port=db_default_port + +fi + + + +# Check whether --with-internal_db_pass was given. +if test "${with_internal_db_pass+set}" = set; then : + withval=$with_internal_db_pass; internal_db_pass=$withval +else + internal_db_pass=icinga2web + +fi + + + +# Check whether --with-internal_db_user was given. +if test "${with_internal_db_user+set}" = set; then : + withval=$with_internal_db_user; internal_db_user=$withval +else + internal_db_user=icinga2web + +fi + + +# +# Authorization method +# +# + + +# Check whether --with-internal_authentication was given. +if test "${with_internal_authentication+set}" = set; then : + withval=$with_internal_authentication; internal_authentication=yes +else + internal_authentication=def + +fi + + + +# Check whether --with-ldap_authentication was given. +if test "${with_ldap_authentication+set}" = set; then : + withval=$with_ldap_authentication; ldap_authentication=yes +else + ldap_authentication=no + +fi + + +# +# LDAP Authorization +# + + +# Check whether --with-ldap_host was given. +if test "${with_ldap_host+set}" = set; then : + withval=$with_ldap_host; ldap_host=$withval +else + ldap_host=localhost + +fi + + + +# Check whether --with-ldap_port was given. +if test "${with_ldap_port+set}" = set; then : + withval=$with_ldap_port; ldap_port=$withval +else + ldap_port=389 + +fi + + + +# Check whether --with-ldap_binddn was given. +if test "${with_ldap_binddn+set}" = set; then : + withval=$with_ldap_binddn; ldap_binddn=$withval +else + ldap_binddn="cn=Manager, ou=icinga, ou=org" + +fi + + + +# Check whether --with-ldap_bindpass was given. +if test "${with_ldap_bindpass+set}" = set; then : + withval=$with_ldap_bindpass; ldap_bindpass=$withval +else + ldap_bindpass="secret" + +fi + + + +# Check whether --with-ldap_rootdn was given. +if test "${with_ldap_rootdn+set}" = set; then : + withval=$with_ldap_rootdn; ldap_rootdn=$withval +else + ldap_rootdn="ou=people, dc=icinga, dc=org" + +fi + + + +# Check whether --with-ldap_user_class was given. +if test "${with_ldap_user_class+set}" = set; then : + withval=$with_ldap_user_class; ldap_user_class=$withval +else + ldap_user_class="inetOrgPerson" + +fi + + + +# Check whether --with-ldap_attribute_username was given. +if test "${with_ldap_attribute_username+set}" = set; then : + withval=$with_ldap_attribute_username; ldap_attribute_username=$withval +else + ldap_attribute_username="uid" + +fi + + + +# Check whether --with-ldap_attribute_firstname was given. +if test "${with_ldap_attribute_firstname+set}" = set; then : + withval=$with_ldap_attribute_firstname; ldap_attribute_firstname=$withval +else + ldap_attribute_firstname="firstname" + +fi + + + +# Check whether --with-ldap_attribute_lastname was given. +if test "${with_ldap_attribute_lastname+set}" = set; then : + withval=$with_ldap_attribute_lastname; ldap_attribute_lastname=$withval +else + ldap_attribute_lastname="lastname" + +fi + + + +# Check whether --with-ldap_attribute_password was given. +if test "${with_ldap_attribute_password+set}" = set; then : + withval=$with_ldap_attribute_password; ldap_attribute_password=$withval +else + ldap_attribute_password="password" + +fi + + + # Installation options INSTALL_OPTS="-o $bin_user -g $bin_group" INSTALL_OPTS_WEB="-o $web_user -g $web_group" +if test "x$internal_db_type" == xmysql; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PHP runtime dependency 'Zend Framework - MySQL PDO Adapter' is available" >&5 +$as_echo_n "checking if PHP runtime dependency 'Zend Framework - MySQL PDO Adapter' is available... " >&6; } + if php -r 'require "Zend/Db/Adapter/Pdo/Mysql.php";' ; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: PHP runtime dependency fulfilled" >&5 +$as_echo "PHP runtime dependency fulfilled" >&6; } +else + as_fn_error $? "PHP runtime dependency 'Zend Framework - MySQL PDO Adapter' is missing" "$LINENO" 5 +fi + +fi +if test "x$internal_db_type" == xpgsql; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PHP runtime dependency 'Zend Framework - PostgreSQL PDO Adapter' is available" >&5 +$as_echo_n "checking if PHP runtime dependency 'Zend Framework - PostgreSQL PDO Adapter' is available... " >&6; } + if php -r 'require "Zend/Db/Adapter/Pdo/Pgsql.php";' ; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: PHP runtime dependency fulfilled" >&5 +$as_echo "PHP runtime dependency fulfilled" >&6; } +else + as_fn_error $? "PHP runtime dependency 'Zend Framework - PostgreSQL PDO Adapter' is missing" "$LINENO" 5 +fi + +fi +if test "x$ldap_authentication" != xno; then : + + for x in ldap;do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if php has $x module" >&5 +$as_echo_n "checking if php has $x module... " >&6; } + if php -m | $GREP -iq "^$x$" ; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } +else + as_fn_error $? "not found" "$LINENO" 5 +fi + done + +fi + +# Installation directives + + + + + + + + +# Internal db setup + + + + + + + +# ldap setup @@ -2151,7 +2519,13 @@ INSTALL_OPTS_WEB="-o $web_user -g $web_group" -ac_config_files="$ac_config_files Makefile etc/apache/cranberry.conf" + + + + + + +ac_config_files="$ac_config_files Makefile etc/config/authentication_db.ini etc/config/authentication_ldap.ini" cat >confcache <<\_ACEOF @@ -2218,10 +2592,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -2289,7 +2674,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -2390,6 +2775,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2585,16 +2971,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -2654,28 +3040,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -2696,8 +3070,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Cranberry $as_me 0.0.1, which was -generated by GNU Autoconf 2.67. Invocation command line was +This file was extended by Icinga2Web $as_me 0.0.1, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -2749,11 +3123,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Cranberry config.status 0.0.1 -configured by $0, generated by GNU Autoconf 2.67, +Icinga2Web config.status 0.0.1 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -2831,7 +3205,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -2861,9 +3235,10 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "etc/apache/cranberry.conf") CONFIG_FILES="$CONFIG_FILES etc/apache/cranberry.conf" ;; + "etc/config/authentication_db.ini") CONFIG_FILES="$CONFIG_FILES etc/config/authentication_db.ini" ;; + "etc/config/authentication_ldap.ini") CONFIG_FILES="$CONFIG_FILES etc/config/authentication_ldap.ini" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -2884,9 +3259,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -2894,12 +3270,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -2921,7 +3298,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -2949,7 +3326,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -2997,7 +3374,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -3029,7 +3406,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -3069,7 +3446,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -3088,7 +3465,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -3097,7 +3474,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -3123,8 +3500,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -3254,21 +3631,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; diff --git a/configure.ac b/configure.ac index 1de975d86..705c07585 100755 --- a/configure.ac +++ b/configure.ac @@ -3,11 +3,11 @@ AC_PREREQ([2.61]) -AC_INIT([Cranberry], [0.0.1], []) -AC_PREFIX_DEFAULT(/usr/local/i2) +AC_INIT([Icinga2Web], [0.0.1], []) +AC_PREFIX_DEFAULT(/usr/local/icinga2-web) if test "x$prefix" = "xNONE" ; then - installDir="/usr/local/i2" + installDir="/usr/local/icinga2-web" prefix=$installDir else installDir=$prefix @@ -30,8 +30,10 @@ AC_CHECK_PHP_MODULE([sockets json]) # Checks for header files. - +# # 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, @@ -51,11 +53,15 @@ AC_ARG_WITH([web_path], ) AC_ARG_WITH([www_conf_path], - AS_HELP_STRING([--with-http-configuration-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d]), + AS_HELP_STRING([--with-http-configuration-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d)]), 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]) ) +# +# Users and groups for installation +# + AC_ARG_WITH([bin_user], AS_HELP_STRING([--with-bin-user=USER], [user for all other files (default root)]), bin_user=$withval, @@ -68,10 +74,141 @@ AC_ARG_WITH([bin_group], bin_group=bin ) +# +# 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 +) + +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"] +) + +AC_ARG_WITH([ldap_user_class], + AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user object type to use for the authentication (defaults inetOrgPerson)]), + ldap_user_class=$withval, + ldap_user_class="inetOrgPerson" +) + +AC_ARG_WITH([ldap_attribute_username], + AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (defaults uid)]), + ldap_attribute_username=$withval, + ldap_attribute_username="uid" +) + +AC_ARG_WITH([ldap_attribute_firstname], + AS_HELP_STRING([--with-ldap-attribute-firstname=LDAP_ATTRIBUTE], [user attribute to use for the firstname (defaults firstname)]), + ldap_attribute_firstname=$withval, + ldap_attribute_firstname="firstname" +) + +AC_ARG_WITH([ldap_attribute_lastname], + AS_HELP_STRING([--with-ldap-attribute-lastname=LDAP_ATTRIBUTE], [user attribute to use for the lastname (defaults lastname)]), + ldap_attribute_lastname=$withval, + ldap_attribute_lastname="lastname" +) + +AC_ARG_WITH([ldap_attribute_password], + AS_HELP_STRING([--with-ldap-attribute-password=LDAP_ATTRIBUTE], [user attribute to use for the password (defaults password)]), + ldap_attribute_password=$withval, + ldap_attribute_password="password" +) + + # Installation options INSTALL_OPTS="-o $bin_user -g $bin_group" INSTALL_OPTS_WEB="-o $web_user -g $web_group" + +AS_IF([test "x$internal_db_type" == xmysql], + [AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Mysql.php],[Zend Framework - MySQL PDO Adapter])]) +AS_IF([test "x$internal_db_type" == xpgsql], + [AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Pgsql.php],[Zend Framework - PostgreSQL PDO Adapter])]) +AS_IF([test "x$ldap_authentication" != xno], + AC_CHECK_PHP_MODULE([ldap])) + +# Installation directives AC_SUBST(app_name) AC_SUBST(web_user) AC_SUBST(web_group) @@ -80,13 +217,36 @@ AC_SUBST(www_conf_path) AC_SUBST(bin_user) AC_SUBST(bin_group) +# 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) +AC_SUBST(ldap_user_class) +AC_SUBST(ldap_attribute_basedn) +AC_SUBST(ldap_attribute_username) +AC_SUBST(ldap_attribute_firstname) +AC_SUBST(ldap_attribute_lastname) +AC_SUBST(ldap_attribute_password) + + AC_SUBST(PHP) AC_SUBST(INSTALL_OPTS) AC_SUBST(INSTALL_OPTS_WEB) AC_CONFIG_FILES([ Makefile - etc/apache/cranberry.conf + etc/config/authentication_db.ini + etc/config/authentication_ldap.ini ]) AC_OUTPUT diff --git a/etc/config/authentication_db.ini.in b/etc/config/authentication_db.ini.in new file mode 100644 index 000000000..d57b573f8 --- /dev/null +++ b/etc/config/authentication_db.ini.in @@ -0,0 +1,9 @@ +[users] +backend=db +type=@internal_db_type@ +host=@internal_db_host@ +port=@internal_db_port@ +database=@internal_db_name@ +user=@internal_db_user@ +password=@internal_db_pass@ + diff --git a/etc/config/authentication_ldap.ini.in b/etc/config/authentication_ldap.ini.in new file mode 100644 index 000000000..4d50d285f --- /dev/null +++ b/etc/config/authentication_ldap.ini.in @@ -0,0 +1,15 @@ +[users] +backend=ldap +hostname=@ldap_host@ +port=@ldap_port@ +root_dn='@ldap_rootdn@' +bind_dn='@ldap_binddn@' +bind_pw=@ldap_bindpass@ + +; Attributes for ldap user lookup +user_class=@ldap_user_class@ +user_name_attribute=@ldap_attribute_username@ +user_firstname_attribute=@ldap_attribute_firstname@ +user_lastname_attribute=@ldap_attribute_lastname@ +user_password_attribute=@ldap_attribute_password@ + diff --git a/install-sh b/install-sh new file mode 120000 index 000000000..903dbcd72 --- /dev/null +++ b/install-sh @@ -0,0 +1 @@ +/usr/local/Cellar/automake/1.12.4/share/automake-1.12/install-sh \ No newline at end of file