2013-06-03 17:05:59 +02:00
|
|
|
prefix=@prefix@
|
|
|
|
exec_prefix=@exec_prefix@
|
|
|
|
|
|
|
|
WWW_CONF_PATH=@www_conf_path@
|
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_OPTS=@INSTALL_OPTS@
|
|
|
|
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
|
|
|
|
|
2013-07-03 14:00:55 +02:00
|
|
|
default:
|
2013-08-23 11:33:54 +02:00
|
|
|
@echo "IcingaWeb make targets: "
|
2013-07-08 16:04:36 +02:00
|
|
|
@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-07-03 14:00:55 +02:00
|
|
|
|
2013-06-03 17:05:59 +02:00
|
|
|
#
|
|
|
|
# Installs the whole application w\o httpd configurations
|
|
|
|
#
|
2013-08-29 10:55:12 +02:00
|
|
|
install: install-static-files install-runtime-dirs ensure-writable-folders
|
2013-06-03 17:05:59 +02:00
|
|
|
|
2013-07-03 14:00:55 +02:00
|
|
|
update: install-application
|
2013-06-03 17:05:59 +02:00
|
|
|
#
|
|
|
|
# Removes files created by ./configure
|
|
|
|
#
|
|
|
|
clean:
|
|
|
|
fi; \
|
|
|
|
if [ -f ./Makefile ];then \
|
|
|
|
rm ./Makefile; \
|
|
|
|
fi; \
|
2013-08-23 11:33:54 +02:00
|
|
|
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)
|
|
|
|
#
|
2013-07-08 16:08:15 +02:00
|
|
|
install-static-files: install-application copy-web-files-public copy-web-files-config copy-web-files-modules
|
2013-08-29 10:55:12 +02:00
|
|
|
$(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess;
|
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
|
|
|
|
#
|
2013-07-03 14:00:55 +02:00
|
|
|
install-apache-config:
|
2013-08-23 11:33:54 +02:00
|
|
|
$(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/icingaweb.conf" $(WWW_CONF_PATH)/icingaweb.conf;
|
2013-06-03 17:05:59 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Installs the php files to the prefix
|
|
|
|
#
|
2013-08-29 10:55:12 +02:00
|
|
|
install-application: copy-web-files-application copy-web-files-library
|
2013-06-03 17:05:59 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Rule for coying 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
|
|
|
|
|
|
|
|
|
2013-08-29 10:55:12 +02:00
|
|
|
ensure-writable-folders:
|
|
|
|
$(INSTALL) -m 775 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/var/
|
|
|
|
$(INSTALL) -m 775 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/var/log
|
|
|
|
chmod 775 -R $(DESTDIR)$(prefix)/config
|
|
|
|
|
|
|
|
|
2013-06-03 17:05:59 +02:00
|
|
|
#
|
|
|
|
# Rule for copying only php, *html, js and ini files. Hidden files are ignored
|
|
|
|
#
|
2013-07-01 17:51:18 +02:00
|
|
|
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 \
|
2013-08-23 11:33:54 +02:00
|
|
|
$(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 \
|
2013-08-23 11:33:54 +02:00
|
|
|
-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" \
|
2013-06-03 17:05:59 +02:00
|
|
|
-and ! -name ".*"`; \
|
|
|
|
for file in $$files; do \
|
2013-08-23 11:33:54 +02:00
|
|
|
$(INSTALL) -m 644 $(INSTALL_OPTS_WEB) "$$file" $(DESTDIR)$(prefix)/"$$file"; \
|
2013-06-03 17:05:59 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
|