Remove autotools files
In preparation for package w/ web installer installations all autotools files must be removed because the installation method using the latter will no longer be supported. refs #7505
This commit is contained in:
parent
0bf6dc24a8
commit
114c826f0e
158
Makefile.in
158
Makefile.in
|
@ -1,158 +0,0 @@
|
|||
SHELL=/bin/sh
|
||||
|
||||
PACKAGE_TARNAME=@PACKAGE_TARNAME@
|
||||
PACKAGE_NAME=@PACKAGE_NAME@
|
||||
PACKAGE_VERSION=@PACKAGE_VERSION@
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
|
||||
HTTPD_CONFIG_PATH=@httpd_config_path@
|
||||
ICINGAWEB_CONFIG_PATH=@icingaweb_config_path@
|
||||
ICINGAWEB_LOG_PATH=@icingaweb_log_path@
|
||||
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_OPTS=@INSTALL_OPTS@
|
||||
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
|
||||
|
||||
default:
|
||||
@echo "IcingaWeb make targets: "
|
||||
@printf "%b" " -install:\t\t\tInstall the application and overwrite configs\n"
|
||||
@printf "%b" " -update:\t\t\tInstall the application without touching the configs\n"
|
||||
@printf "%b" " -install-apache-config:\tInstall the apache configuration\n"
|
||||
|
||||
#
|
||||
# Installs the whole application w\o httpd configurations
|
||||
#
|
||||
install: install-config install-basic ensure-writable-folders install-cli
|
||||
|
||||
#
|
||||
# Install icingacli bin
|
||||
#
|
||||
|
||||
install-cli:
|
||||
$(INSTALL) -m 755 -d $(INSTALL_OPTS) $(bindir)
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS) "./bin/icingacli" $(bindir)/icingacli;
|
||||
|
||||
#
|
||||
# Installs the whole application w\o configuration
|
||||
#
|
||||
install-basic: install-static-files install-runtime-dirs ensure-writable-folders
|
||||
|
||||
#
|
||||
# Updates only the application
|
||||
#
|
||||
update: install-application
|
||||
|
||||
#
|
||||
# Removes files created by ./configure
|
||||
#
|
||||
clean:
|
||||
if [ -f ./Makefile ];then \
|
||||
rm ./Makefile; \
|
||||
fi; \
|
||||
if [ -f ./etc/apache/icingaweb.conf ];then \
|
||||
rm ./etc/apache/icingaweb.conf; \
|
||||
fi;
|
||||
|
||||
#
|
||||
# Installs/copies all static files (executables, scripts, html, etc)
|
||||
#
|
||||
install-static-files: install-application copy-web-files-public copy-web-files-modules
|
||||
|
||||
#
|
||||
# Installs all configuration files
|
||||
#
|
||||
install-config:
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(ICINGAWEB_CONFIG_PATH)
|
||||
|
||||
@dirs=`cd ./config ; find . -mindepth 1 -type d `;\
|
||||
for dir in $$dirs; do \
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(ICINGAWEB_CONFIG_PATH)/"$$dir"; \
|
||||
done;
|
||||
|
||||
@files=`cd ./config ; find . -mindepth 1 -type f \
|
||||
-and ! -name ".*" -and ! -name "*.in"`; \
|
||||
for file in $$files; do \
|
||||
$(INSTALL) -m 644 $(INSTALL_OPTS_WEB) "./config/$$file" $(DESTDIR)$(ICINGAWEB_CONFIG_PATH)/"$$file"; \
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Installs runtime directories like the application cache
|
||||
#
|
||||
install-runtime-dirs:
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/application/cache
|
||||
|
||||
#
|
||||
# Copies the tests into the installation directory
|
||||
#
|
||||
install-tests: copy-folder-tests
|
||||
|
||||
#
|
||||
# Install configurations for apache2
|
||||
#
|
||||
install-apache-config:
|
||||
$(INSTALL) -m 755 -d $(INSTALL_OPTS) $(DESTDIR)$(HTTPD_CONFIG_PATH)
|
||||
$(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/icingaweb.conf" $(DESTDIR)$(HTTPD_CONFIG_PATH)/icingaweb.conf;
|
||||
|
||||
#
|
||||
# Installs the php files to the prefix
|
||||
#
|
||||
install-application: copy-web-files-application copy-web-files-library install-cli
|
||||
|
||||
#
|
||||
# Rule for copying folders and containing files (arbitary types), hidden files are excluded
|
||||
#
|
||||
copy-folder-%:
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/$*
|
||||
|
||||
@dirs=`find ./$* -mindepth 1 -type d `;\
|
||||
for dir in $$dirs; do \
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/"$$dir"; \
|
||||
done;
|
||||
|
||||
@files=`find ./$* -mindepth 1 -type f \
|
||||
-and ! -name ".*"`; \
|
||||
for file in $$files; do \
|
||||
$(INSTALL) -m 644 $(INSTALL_OPTS) "$$file" $(DESTDIR)$(prefix)/"$$file"; \
|
||||
done
|
||||
|
||||
|
||||
ensure-writable-folders:
|
||||
$(INSTALL) -m 775 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/var/
|
||||
$(INSTALL) -m 775 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(ICINGAWEB_LOG_PATH)
|
||||
chmod -R 775 $(DESTDIR)$(ICINGAWEB_CONFIG_PATH)
|
||||
|
||||
|
||||
#
|
||||
# Rule for copying only php, *html, js and ini files. Hidden files are ignored
|
||||
#
|
||||
copy-web-files-%:
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/$*
|
||||
|
||||
@dirs=`find ./$* -mindepth 1 -type d `;\
|
||||
for dir in $$dirs; do \
|
||||
$(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/"$$dir"; \
|
||||
done;
|
||||
|
||||
@files=`find ./$* -mindepth 1 -type f \
|
||||
-name "*.php" -or -name "*.ini" -or -name "*.*html" \
|
||||
-or -name "*.js" -or -name "*.css" -or -name "*.less" \
|
||||
-or -name "*.otf" -or -name "*.ttf" -or -name "*.otf" \
|
||||
-or -name "*.svg" -or -name "*.woff" -or -name "*.png" \
|
||||
-and ! -name ".*"`; \
|
||||
for file in $$files; do \
|
||||
$(INSTALL) -m 644 $(INSTALL_OPTS_WEB) "$$file" $(DESTDIR)$(prefix)/"$$file"; \
|
||||
done
|
||||
|
||||
#
|
||||
# Create release or snapshot tarball
|
||||
#
|
||||
# TODO: Use git-archive
|
||||
# create-tarball:
|
||||
# @./bin/make-tarball --prefix $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/
|
||||
#
|
||||
# create-tarball-nightly:
|
||||
# ./bin/make-tarball --prefix $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-`date +%Y%m%d`-`git rev-parse --short HEAD`/
|
|
@ -1,84 +0,0 @@
|
|||
AC_DEFUN([AC_USER_GUESS],[
|
||||
$2=$3
|
||||
for x in $1; do
|
||||
AC_MSG_CHECKING([if user $x exists])
|
||||
AS_IF([ $GREP -q "^$x:" /etc/passwd ],
|
||||
[ AC_MSG_RESULT([found]); $2=$x ; break],
|
||||
[ AC_MSG_RESULT([not found]) ])
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_PHP_MODULE],[
|
||||
for x in $1;do
|
||||
AC_MSG_CHECKING([if php has $x module])
|
||||
AS_IF([ php -m | $GREP -iq "^$x$" ],
|
||||
[ AC_MSG_RESULT([found]) ],
|
||||
[ AC_MSG_ERROR([not found])])
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_PHP_VERSION],[
|
||||
AC_MSG_CHECKING([if php has at least version $1.$2.$3])
|
||||
AS_IF([ test $1 -le `php -r 'echo PHP_MAJOR_VERSION;'` && \
|
||||
test $2 -le `php -r 'echo PHP_MINOR_VERSION;'` && \
|
||||
test $3 -le `php -r 'echo PHP_RELEASE_VERSION;'`],
|
||||
[ AC_MSG_RESULT([PHP version is correct])],
|
||||
[ AC_MSG_ERROR([You need at least PHP version $1.$2.$3])])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_PHP_INCLUDE],[
|
||||
AC_MSG_CHECKING([if PHP runtime dependency '$2' is available])
|
||||
AS_IF([ php -r 'require "$1";' ],
|
||||
[ AC_MSG_RESULT([PHP runtime dependency fulfilled])],
|
||||
[ AC_MSG_ERROR([PHP runtime dependency '$2' is missing])])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_GROUP_GUESS],[
|
||||
$2=$3
|
||||
for x in $1; do
|
||||
AC_MSG_CHECKING([if group $x exists])
|
||||
AS_IF([ $GREP -q "^$x:" /etc/group ],
|
||||
[ AC_MSG_RESULT([found]); $2=$x ; break],
|
||||
[ AC_MSG_RESULT([not found]) ])
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_BIN], [
|
||||
AC_PATH_PROG([$1],[$2],[not found])
|
||||
|
||||
AS_IF([ test "XX${$1}" == "XXnot found" ],
|
||||
[ AC_MSG_WARN([binary $2 not found in PATH]) ])
|
||||
|
||||
test "XX${$1}" == "XXnot found" && $1=""
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_PATH_GUESS], [
|
||||
$2=$3
|
||||
for x in $1; do
|
||||
AC_MSG_CHECKING([if path $x exists])
|
||||
AS_IF([test -d $x],
|
||||
[AC_MSG_RESULT([found]); $2=$x; break],
|
||||
[AC_MSG_RESULT([not found])]
|
||||
)
|
||||
done
|
||||
])
|
||||
|
||||
# ICINGA_CHECK_DBTYPE(DBTYPE, ARGUMENT_NAME)
|
||||
# ------------------------------------------
|
||||
AC_DEFUN([ICINGA_CHECK_DBTYPE], [
|
||||
AC_MSG_CHECKING([Testing database type for $2])
|
||||
AS_IF(echo "$1" | $GREP -q "^\(my\|pg\)sql$",
|
||||
AC_MSG_RESULT([OK ($1)]),
|
||||
AC_MSG_ERROR([$1])
|
||||
)
|
||||
])
|
||||
|
||||
# ICINGA_CHECK_BACKENDTYPE(BACKENDTYPE, ARGUMENT_NAME)
|
||||
# ------------------------------------------
|
||||
AC_DEFUN([ICINGA_CHECK_BACKENDTYPE], [
|
||||
AC_MSG_CHECKING([Testing backend type for $2])
|
||||
AS_IF(echo "$1" | $GREP -q "^\(ido\|statusdat\|livestatus\)$",
|
||||
AC_MSG_RESULT([OK ($1)]),
|
||||
AC_MSG_ERROR([$1])
|
||||
)
|
||||
])
|
448
configure.ac
448
configure.ac
|
@ -1,448 +0,0 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.61])
|
||||
AC_INIT([IcingaWeb2], [1.0.0], [info@icinga.org])
|
||||
AC_PREFIX_DEFAULT(/usr/local/icingaweb)
|
||||
|
||||
if test "x$prefix" = "xNONE" ; then
|
||||
installDir="/usr/local/icingaweb"
|
||||
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])
|
||||
|
||||
#
|
||||
# Configuration files
|
||||
#
|
||||
AC_ARG_WITH([icingaweb_config_path],
|
||||
AS_HELP_STRING([--with-icingaweb-config-path=PATH], [Configuration path for icinga web (default $prefix/config)]),
|
||||
icingaweb_config_path=$withval,
|
||||
icingaweb_config_path=$prefix/config
|
||||
)
|
||||
|
||||
#
|
||||
# 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
|
||||
)
|
||||
|
||||
#
|
||||
# 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,
|
||||
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 /icingaweb)]),
|
||||
web_path=$withval,
|
||||
web_path=/icingaweb
|
||||
)
|
||||
|
||||
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])
|
||||
)
|
||||
|
||||
#
|
||||
# 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,
|
||||
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
|
||||
)
|
||||
|
||||
#
|
||||
# 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
|
||||
)
|
||||
|
||||
ICINGA_CHECK_DBTYPE($internal_db_type, [--with-internal-db-type])
|
||||
|
||||
AC_ARG_WITH([internal_db_name],
|
||||
AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icingaweb)]),
|
||||
internal_db_name=$withval,
|
||||
internal_db_name=icingaweb
|
||||
)
|
||||
|
||||
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_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
|
||||
)
|
||||
|
||||
AC_ARG_WITH([internal_db_user],
|
||||
AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icingaweb)]),
|
||||
internal_db_user=$withval,
|
||||
internal_db_user=icingaweb
|
||||
)
|
||||
|
||||
#
|
||||
# Authorization method
|
||||
#
|
||||
|
||||
AC_ARG_WITH([internal_authentication],
|
||||
AC_HELP_STRING([--with-internal-authentication], [use the internal database for authentication (default: yes)]),
|
||||
internal_authentication=$withval,
|
||||
internal_authentication=yes
|
||||
)
|
||||
|
||||
AC_ARG_WITH([ldap_authentication],
|
||||
AC_HELP_STRING([--with-ldap-authentication], [use a ldap server for authentication (default: no)]),
|
||||
ldap_authentication=$withval,
|
||||
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=admin,cn=config"]
|
||||
)
|
||||
|
||||
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=["admin"]
|
||||
)
|
||||
|
||||
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_objectclass],
|
||||
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"
|
||||
)
|
||||
|
||||
AC_ARG_WITH([ldap_attribute_username],
|
||||
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (default: uid)]),
|
||||
ldap_attribute_username=$withval,
|
||||
ldap_attribute_username="uid"
|
||||
)
|
||||
|
||||
#
|
||||
# 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"
|
||||
)
|
||||
|
||||
ICINGA_CHECK_BACKENDTYPE($icinga_backend, [--with-icinga-backend])
|
||||
|
||||
#
|
||||
# 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="mysql"
|
||||
)
|
||||
|
||||
ICINGA_CHECK_DBTYPE($ido_db_type, [--with-ido-db-type])
|
||||
|
||||
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_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"
|
||||
)
|
||||
|
||||
AC_ARG_WITH([ido_user],
|
||||
AS_HELP_STRING([--with-ido-user=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"
|
||||
)
|
||||
|
||||
AC_ARG_WITH([objects_cache_file],
|
||||
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)]),
|
||||
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"
|
||||
)
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
# 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])
|
||||
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])
|
||||
])
|
||||
|
||||
#
|
||||
# Disable authentication backends
|
||||
#
|
||||
|
||||
ido_enabled="disabled = \"1\""
|
||||
statusdat_enabled="disabled = \"1\""
|
||||
livestatus_enabled="disabled = \"1\""
|
||||
|
||||
AS_CASE([$icinga_backend],
|
||||
["ido"], [ido_enabled=""],
|
||||
["statusdat"], [statusdat_enabled=""],
|
||||
["livestatus"], [livestatus_enabled=""],
|
||||
[statusdat_enabled=""])
|
||||
|
||||
ldap_auth_disabled="disabled = \"1\""
|
||||
AS_IF([test "x$ldap_authentication" != xno],
|
||||
AC_CHECK_PHP_MODULE([ldap])
|
||||
ldap_auth_disabled=""
|
||||
)
|
||||
|
||||
internal_auth_disabled="disabled = \"1\""
|
||||
AS_IF([test "x$internal_authentication" != xno],
|
||||
AC_CHECK_PHP_MODULE([ldap])
|
||||
internal_auth_disabled=""
|
||||
)
|
||||
|
||||
#
|
||||
# Substitution variables
|
||||
#
|
||||
|
||||
# Installation directives
|
||||
AC_SUBST(app_name)
|
||||
AC_SUBST(web_user)
|
||||
AC_SUBST(web_group)
|
||||
AC_SUBST(web_path)
|
||||
AC_SUBST(httpd_config_path)
|
||||
AC_SUBST(bin_user)
|
||||
AC_SUBST(bin_group)
|
||||
AC_SUBST(icingaweb_config_path)
|
||||
AC_SUBST(icingaweb_log_path)
|
||||
|
||||
# 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_password)
|
||||
|
||||
# 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_objectclass)
|
||||
AC_SUBST(ldap_attribute_basedn)
|
||||
AC_SUBST(ldap_attribute_username)
|
||||
|
||||
# backend setup
|
||||
AC_SUBST(icinga_backend)
|
||||
|
||||
# ido backend variables
|
||||
AC_SUBST(ido_enabled)
|
||||
AC_SUBST(ido_db_type)
|
||||
AC_SUBST(ido_host)
|
||||
AC_SUBST(ido_port)
|
||||
AC_SUBST(ido_db_name)
|
||||
AC_SUBST(ido_user)
|
||||
AC_SUBST(ido_password)
|
||||
|
||||
# status.dat backend
|
||||
AC_SUBST(statusdat_enabled)
|
||||
AC_SUBST(statusdat_file)
|
||||
AC_SUBST(objects_cache_file)
|
||||
|
||||
# livestatus backend
|
||||
AC_SUBST(livestatus_socket)
|
||||
AC_SUBST(livestatus_enabled)
|
||||
|
||||
# command pipe
|
||||
AC_SUBST(icinga_commandpipe)
|
||||
|
||||
# Comment placeholders for toggling backends
|
||||
|
||||
AC_SUBST(ldap_auth_disabled)
|
||||
AC_SUBST(internal_auth_disabled)
|
||||
|
||||
# Application and installation
|
||||
AC_SUBST(PHP)
|
||||
AC_SUBST(INSTALL_OPTS)
|
||||
AC_SUBST(INSTALL_OPTS_WEB)
|
||||
|
||||
#
|
||||
# Create config files
|
||||
#
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
config/authentication.ini
|
||||
config/config.ini
|
||||
config/resources.ini
|
||||
config/modules/monitoring/backends.ini
|
||||
config/modules/monitoring/instances.ini
|
||||
etc/apache/icingaweb.conf
|
||||
])
|
||||
|
||||
#
|
||||
# Commit and write
|
||||
#
|
||||
AC_OUTPUT
|
520
install-sh
520
install-sh
|
@ -1,520 +0,0 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -1,6 +0,0 @@
|
|||
GCC=gcc
|
||||
PROGRAM=extcmd_test
|
||||
SOURCE=${PROGRAM}.c
|
||||
|
||||
all:
|
||||
cd bin/ && gcc ${SOURCE} -o ${PROGRAM}
|
Loading…
Reference in New Issue