GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Digital_Repository
Browse code
- Changed mechanism for detecting whether Apache is running; removed
reliance on Apache PID file (which was always unreliable).
master
1 parent
c3c237f
commit
fa89d4081985624547b58b2473b54248d501a18c
nstanger
authored
on 29 Oct 2009
Patch
Showing
1 changed file
Repositories/otago_eprints3/Makefile
Ignore Space
Show notes
View
Repositories/otago_eprints3/Makefile
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: # # Used in Makefile # EPRINTS_ROOT: /path/to/eprints/installation # EPRINTS_USER: the user that owns the EPrints directory # EPRINTS_GROUP: the group that owns the EPrints directory # APACHE_STOP: the command to stop Apache # APACHE_START: the command to start Apache # # Used in archive XML configuration files # EPRINTS_HOST: eprints host name # EPRINTS_ALIASES: eprints host aliases (if any, in full XML form) # EPRINTS_PORT: appropriate HTTP port # EPRINTS_ADMIN_EMAIL: administrator email address (quote "@" with \) # EPRINTS_ARCHIVE_NAME: full archive name as it appears in web pages # EPRINTS_DB_NAME: name of archive database # EPRINTS_DB_USER: user for archive database # EPRINTS_DB_PASS: password for archive database # # Used in apache .conf files # EPRINTS_ALLOWED_DOMAINS: domains that web registration is allowed from # EPRINTSSTATS: /path/to/EPrintsStats/installation # PHPSURVEYOR: /path/to/phpSurveyor/installation (deprecated) # # Required commands: # pgrep # include environment_config.make XML_PL_SUBS:=EPRINTS_HOST EPRINTS_PORT EPRINTS_ADMIN_EMAIL \ EPRINTS_ARCHIVE_NAME EPRINTS_DB_NAME EPRINTS_DB_USER EPRINTS_DB_PASS CONF_SUBS:=EPRINTS_ROOT EPRINTS_ALLOWED_DOMAINS EPRINTSSTATS #PHPSURVEYOR ARCHIVE_NAME:=otago_eprints BINDIR:=$(EPRINTS_ROOT)/bin ARCHIVE_ROOT:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME) ARCHIVE_CONFIG:=$(ARCHIVE_NAME)/cfg/cfg.d SOURCE_PL:=$(shell find . -name "*_src.pl" -type f) SOURCE_CONF:=$(shell find . -name "*_src.conf" -type f) GENERATED_XML:=$(subst _src,,$(SOURCE_PL)) GENERATED_CONF:=$(subst _src,,$(SOURCE_CONF)) GENERATED_FILES:=$(GENERATED_XML) $(GENERATED_CONF) .PHONY: deploy generate_apacheconf import_subjects generate_static \ generate_abstracts generate_views restart_apache index stats deploy: $(GENERATED_FILES) @announce "Copying files..." @$(SUDO) rsync --verbose --cvs-exclude --exclude=Makefile \ --exclude='*.make' --exclude='*_src.*' \ --recursive --times . $(EPRINTS_ROOT)/archives > .del-rsync-output @-grep $(ARCHIVE_NAME) .del-rsync-output @-grep --quiet "cfg\\.d/\\(10_core\\)\\|\\(20_baseurls\\)" .del-rsync-output && $(MAKE) generate_apacheconf @-grep --quiet "cfg/subjects" .del-rsync-output && $(MAKE) import_subjects @-grep --quiet "cfg/\\(static\\|lang\\)/" .del-rsync-output && $(MAKE) generate_static @-grep --quiet "\\(cfg/subjects\\)\\|\\(cfg/citations\\)" .del-rsync-output && $(MAKE) generate_views @-grep --quiet "\\(cfg\\.d/eprint_render\\)\\|\\(cfg/citations\\)\\|\\(document_formats\\)" .del-rsync-output && $(MAKE) generate_abstracts @-grep --quiet "\\(\\.conf\\)\\|\\(\\.pl\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) restart_apache @rm -f .del-rsync-output %.pl: %_src.pl environment_config.make @announce "Creating $@" @perl -p $(foreach SUB,$(XML_PL_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") \ -e "s|##EPRINTS_ALIASES##|$(foreach A,$(EPRINTS_ALIASES),\n {\n 'redirect' => 'yes',\n 'name' => '$(A)'\n },)|g;" $< > $@ %.conf: %_src.conf environment_config.make @announce "Creating $@" @perl -p $(foreach SUB,$(CONF_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ # $(ARCHIVE_NAME).xml: $(ARCHIVE_NAME)_src.xml environment_config.make # @announce "Creating $@" # perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") \ # -e 's|##EPRINTS_ALIASES##|$(foreach A,$(EPRINTS_ALIASES),\n <alias redirect="yes">$(A)</alias>)|g;' $< > $@ # # # $(ARCHIVE_NAME)/cfg/apachevhost.conf: $(ARCHIVE_NAME)/cfg/apachevhost_src.conf environment_config.make # @announce "Creating $@" # perl -p $(foreach SUB,$(VHOST_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ generate_apacheconf: @announce "generate_apacheconf" $(SUDO) $(BINDIR)/$@ import_subjects: @announce "$@ $(ARCHIVE_NAME)" @$(SUDO) $(BINDIR)/$@ $(ARCHIVE_NAME) --xml $(ARCHIVE_NAME)/cfg/subjects.xml # @$(SUDO) $(BINDIR)/import $(ARCHIVE_NAME) subject XML generate_static generate_abstracts generate_views: @announce "$@ $(ARCHIVE_NAME)" @$(SUDO) $(BINDIR)/$@ $(ARCHIVE_NAME) restart_apache: @announce "Waiting for Apache to shut down..." @sudo $(APACHE_STOP) @while `pgrep "apache|httpd" > /dev/null`; do echo > /dev/null; done @announce "Waiting for Apache to start up..." @sudo $(APACHE_START) @until `pgrep "apache|httpd" > /dev/null`; do echo > /dev/null; done index: @announce "Rebuilding indexes..." @$(SUDO) $(BINDIR)/indexer start --once --notdaemon # stats: # @announce "Generating statistics..." # @php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php # # @$(SUDO) perl $(EPRINTS_ROOT)/ePrintsStats/scripts/add_country.pl debug: @echo "ARCHIVE_NAME = [$(ARCHIVE_NAME)]" @echo "ARCHIVE_ROOT = [$(ARCHIVE_ROOT)]" @echo "ARCHIVE_CONFIG = [$(ARCHIVE_CONFIG)]" @echo "GENERATED_FILES = [$(GENERATED_FILES)]"
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: # # Used in Makefile # EPRINTS_ROOT: /path/to/eprints/installation # EPRINTS_USER: the user that owns the EPrints directory # EPRINTS_GROUP: the group that owns the EPrints directory # APACHE_STOP: the command to stop Apache # APACHE_START: the command to start Apache # APACHE_PID: the path to the Apache PID file # # Used in archive XML configuration files # EPRINTS_HOST: eprints host name # EPRINTS_ALIASES: eprints host aliases (if any, in full XML form) # EPRINTS_PORT: appropriate HTTP port # EPRINTS_ADMIN_EMAIL: administrator email address (quote "@" with \) # EPRINTS_ARCHIVE_NAME: full archive name as it appears in web pages # EPRINTS_DB_NAME: name of archive database # EPRINTS_DB_USER: user for archive database # EPRINTS_DB_PASS: password for archive database # # Used in apache .conf files # EPRINTS_ALLOWED_DOMAINS: domains that web registration is allowed from # EPRINTSSTATS: /path/to/EPrintsStats/installation # PHPSURVEYOR: /path/to/phpSurveyor/installation (deprecated) # include environment_config.make XML_PL_SUBS:=EPRINTS_HOST EPRINTS_PORT EPRINTS_ADMIN_EMAIL \ EPRINTS_ARCHIVE_NAME EPRINTS_DB_NAME EPRINTS_DB_USER EPRINTS_DB_PASS CONF_SUBS:=EPRINTS_ROOT EPRINTS_ALLOWED_DOMAINS EPRINTSSTATS #PHPSURVEYOR ARCHIVE_NAME:=otago_eprints BINDIR:=$(EPRINTS_ROOT)/bin ARCHIVE_ROOT:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME) ARCHIVE_CONFIG:=$(ARCHIVE_NAME)/cfg/cfg.d SOURCE_PL:=$(shell find . -name "*_src.pl" -type f) SOURCE_CONF:=$(shell find . -name "*_src.conf" -type f) GENERATED_XML:=$(subst _src,,$(SOURCE_PL)) GENERATED_CONF:=$(subst _src,,$(SOURCE_CONF)) GENERATED_FILES:=$(GENERATED_XML) $(GENERATED_CONF) .PHONY: deploy generate_apacheconf import_subjects generate_static \ generate_abstracts generate_views restart_apache index stats deploy: $(GENERATED_FILES) @announce "Copying files..." @$(SUDO) rsync --verbose --cvs-exclude --exclude=Makefile \ --exclude='*.make' --exclude='*_src.*' \ --recursive --times . $(EPRINTS_ROOT)/archives > .del-rsync-output @-grep $(ARCHIVE_NAME) .del-rsync-output @-grep --quiet "cfg\\.d/\\(10_core\\)\\|\\(20_baseurls\\)" .del-rsync-output && $(MAKE) generate_apacheconf @-grep --quiet "cfg/subjects" .del-rsync-output && $(MAKE) import_subjects @-grep --quiet "cfg/\\(static\\|lang\\)/" .del-rsync-output && $(MAKE) generate_static @-grep --quiet "\\(cfg/subjects\\)\\|\\(cfg/citations\\)" .del-rsync-output && $(MAKE) generate_views @-grep --quiet "\\(cfg\\.d/eprint_render\\)\\|\\(cfg/citations\\)\\|\\(document_formats\\)" .del-rsync-output && $(MAKE) generate_abstracts @-grep --quiet "\\(\\.conf\\)\\|\\(\\.pl\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) restart_apache @rm -f .del-rsync-output %.pl: %_src.pl environment_config.make @announce "Creating $@" @perl -p $(foreach SUB,$(XML_PL_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") \ -e "s|##EPRINTS_ALIASES##|$(foreach A,$(EPRINTS_ALIASES),\n {\n 'redirect' => 'yes',\n 'name' => '$(A)'\n },)|g;" $< > $@ %.conf: %_src.conf environment_config.make @announce "Creating $@" @perl -p $(foreach SUB,$(CONF_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ # $(ARCHIVE_NAME).xml: $(ARCHIVE_NAME)_src.xml environment_config.make # @announce "Creating $@" # perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") \ # -e 's|##EPRINTS_ALIASES##|$(foreach A,$(EPRINTS_ALIASES),\n <alias redirect="yes">$(A)</alias>)|g;' $< > $@ # # # $(ARCHIVE_NAME)/cfg/apachevhost.conf: $(ARCHIVE_NAME)/cfg/apachevhost_src.conf environment_config.make # @announce "Creating $@" # perl -p $(foreach SUB,$(VHOST_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ generate_apacheconf: @announce "generate_apacheconf" $(SUDO) $(BINDIR)/$@ import_subjects: @announce "$@ $(ARCHIVE_NAME)" @$(SUDO) $(BINDIR)/$@ $(ARCHIVE_NAME) --xml $(ARCHIVE_NAME)/cfg/subjects.xml # @$(SUDO) $(BINDIR)/import $(ARCHIVE_NAME) subject XML generate_static generate_abstracts generate_views: @announce "$@ $(ARCHIVE_NAME)" @$(SUDO) $(BINDIR)/$@ $(ARCHIVE_NAME) restart_apache: @announce "Waiting for Apache to shut down..." @sudo $(APACHE_STOP) @sleep 10 @announce "Waiting for Apache to start up..." @sudo $(APACHE_START) @while [ ! -f $(APACHE_PID) ]; do echo > /dev/null; done index: @announce "Rebuilding indexes..." @$(SUDO) $(BINDIR)/indexer start --once --notdaemon # stats: # @announce "Generating statistics..." # @php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php # # @$(SUDO) perl $(EPRINTS_ROOT)/ePrintsStats/scripts/add_country.pl debug: @echo "ARCHIVE_NAME = [$(ARCHIVE_NAME)]" @echo "ARCHIVE_ROOT = [$(ARCHIVE_ROOT)]" @echo "ARCHIVE_CONFIG = [$(ARCHIVE_CONFIG)]" @echo "GENERATED_FILES = [$(GENERATED_FILES)]"
Show line notes below