diff --git a/Repositories/phpSurveyor/Makefile b/Repositories/phpSurveyor/Makefile new file mode 100755 index 0000000..5cdaaa9 --- /dev/null +++ b/Repositories/phpSurveyor/Makefile @@ -0,0 +1,42 @@ +SHELL=/bin/sh + +# Load in machine-specific environment settings from environment_config.make. +# This include file MUST be created and MUST define the following variables: +# +# SURVEYOR_ROOT: /path/to/phpsurveyor/installation +# SURVEYOR_USER: the user that owns the phpSurveyor directory +# SURVEYOR_PORT: appropriate HTTP port +# SURVEYOR_ADMIN_EMAIL: administrator email address (quote "@" with \) +# SURVEYOR_ADMIN_NAME: administrator real name +# +include environment_config.make + + +BINDIR:=$(EPRINTSSTATS)/scripts + +GENERATED_FILES:=config.php apache.conf + +CONFIG_SUBS:=SURVEYOR_ROOT SURVEYOR_PORT SURVEYOR_ADMIN_EMAIL SURVEYOR_ADMIN_NAME + + +.PHONY: deploy stats + + +deploy: $(GENERATED_FILES) + @announce "Copying files..." + @sudo -u $(SURVEYOR_USER) rsync --verbose --cvs-exclude --exclude=Makefile \ + --exclude='*.make' --exclude='*_src.*' \ + --recursive --times . $(SURVEYOR_ROOT) + + +config.php: config_src.php environment_config.make + @announce "Generating $@" + perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ + +apache.conf: apache_src.conf environment_config.make + @announce "Generating $@" + perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ + + +debug: + @echo "SURVEYOR_ROOT = [$(SURVEYOR_ROOT)]"