icingaweb2/Makefile.in

150 lines
4.2 KiB
Makefile
Raw Normal View History

SHELL=/bin/sh
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
2013-06-03 17:05:59 +02:00
prefix=@prefix@
exec_prefix=@exec_prefix@
HTTPD_CONFIG_PATH=@httpd_config_path@
ICINGAWEB_CONFIG_PATH=@icingaweb_config_path@
ICINGAWEB_LOG_PATH=@icingaweb_log_path@
2013-06-03 17:05:59 +02:00
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"
2013-06-03 17:05:59 +02:00
#
# Installs the whole application w\o httpd configurations
#
2013-10-20 18:49:19 +02:00
install: install-config install-basic ensure-writable-folders
#
# Installs the whole application w\o configuration
#
install-basic: install-static-files install-runtime-dirs ensure-writable-folders
2013-06-03 17:05:59 +02:00
#
# Updates only the application
#
update: install-application
2013-06-03 17:05:59 +02:00
#
# 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; \
2013-06-03 17:05:59 +02:00
fi;
#
# Installs/copies all static files (executables, scripts, html, etc)
#
install-static-files: install-application copy-web-files-public copy-web-files-modules
$(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess;
2013-06-03 17:05:59 +02:00
#
# 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
2013-06-03 17:05:59 +02:00
#
# 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;
2013-06-03 17:05:59 +02:00
#
# Installs the php files to the prefix
#
install-application: copy-web-files-application copy-web-files-library
2013-06-03 17:05:59 +02:00
#
# Rule for copying folders and containing files (arbitary types), hidden files are excluded
2013-06-03 17:05:59 +02:00
#
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)
2013-06-03 17:05:59 +02:00
#
# Rule for copying only php, *html, js and ini files. Hidden files are ignored
#
copy-web-files-%:
2013-06-03 17:05:59 +02:00
$(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"; \
2013-06-03 17:05:59 +02:00
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" \
2013-06-03 17:05:59 +02:00
-and ! -name ".*"`; \
for file in $$files; do \
$(INSTALL) -m 644 $(INSTALL_OPTS_WEB) "$$file" $(DESTDIR)$(prefix)/"$$file"; \
2013-06-03 17:05:59 +02:00
done
#
# Create release or snapshot tarball
#
create-tarball:
@./bin/make-tarball --prefix $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/
2013-06-03 17:05:59 +02:00
create-tarball-nightly:
./bin/make-tarball --prefix $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-`date +%Y%m%d`-`git rev-parse --short HEAD`/