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
- Fixed chmod bug with rsync.
master
1 parent
c464d9b
commit
67762c8de0091c62cbea52b91208b49763f01826
nstanger
authored
on 13 Dec 2005
Patch
Showing
1 changed file
Repositories/otago_eprints/Makefile
Ignore Space
Show notes
View
Repositories/otago_eprints/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 # APACHE_PID: the path to the Apache PID file # # Used in ARCHIVE.xml configuration file # 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 # # Used in apachevhost.conf # EPRINTS_ALLOWED_DOMAINS: domains that web registration is allowed from # EPRINTSSTATS: /path/to/EPrintsStats/installation # include environment_config.make CONFIG_SUBS:=EPRINTS_HOST EPRINTS_PORT EPRINTS_ADMIN_EMAIL EPRINTS_ARCHIVE_NAME VHOST_SUBS:=EPRINTS_ALLOWED_DOMAINS EPRINTSSTATS ARCHIVE_NAME:=otago_eprints BINDIR:=$(EPRINTS_ROOT)/bin ARCHIVE_ROOT:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME) ARCHIVE_CONFIG:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME).xml GENERATED_FILES:=$(ARCHIVE_NAME).xml $(ARCHIVE_NAME)/cfg/apachevhost.conf .PHONY: deploy generate_apacheconf import_subjects generate_static \ generate_abstracts generate_views restart_apache index stats deploy: $(GENERATED_FILES) @announce "Copying files..." @sudo -u $(EPRINTS_USER) 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 "$(ARCHIVE_NAME)\\.xml" .del-rsync-output && $(MAKE) generate_apacheconf @-grep --quiet "$(ARCHIVE_NAME)/cfg/subjects" .del-rsync-output && $(MAKE) import_subjects @-grep --quiet "\\(otago_eprints/cfg/static/\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) generate_static @-grep --quiet "\\(\\.pm\\)\\|\\(\\.xml\\)\|\($(ARCHIVE_NAME)/cfg/subjects\)" .del-rsync-output && $(MAKE) generate_views @-grep --quiet "\\($(ARCHIVE_NAME)/cfg/ArchiveRenderConfig.pm\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) generate_abstracts @-grep --quiet "\\(\\.conf\\)\\|\\(\\.pm\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) restart_apache @rm -f .del-rsync-output $(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 -u $(EPRINTS_USER) $(BINDIR)/$@ import_subjects generate_static generate_abstracts generate_views: @announce "$@ $(ARCHIVE_NAME)" @sudo -u $(EPRINTS_USER) $(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 -u $(EPRINTS_USER) $(BINDIR)/indexer start --once --notdaemon stats: @announce "Generating statistics..." @php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php # @sudo -u $(EPRINTS_USER) perl $(EPRINTS_ROOT)/ePrintsStats/scripts/add_country.pl debug: @echo "ARCHIVE_NAME = [$(ARCHIVE_NAME)]" @echo "EPRINTS = [$(EPRINTS)]" @echo "ARCHIVE_ROOT = [$(ARCHIVE_ROOT)]" @echo "ARCHIVE_CONFIG = [$(ARCHIVE_CONFIG)]"
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 file # 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 # # Used in apachevhost.conf # EPRINTS_ALLOWED_DOMAINS: domains that web registration is allowed from # EPRINTSSTATS: /path/to/EPrintsStats/installation # include environment_config.make CONFIG_SUBS:=EPRINTS_HOST EPRINTS_PORT EPRINTS_ADMIN_EMAIL EPRINTS_ARCHIVE_NAME VHOST_SUBS:=EPRINTS_ALLOWED_DOMAINS EPRINTSSTATS ARCHIVE_NAME:=otago_eprints BINDIR:=$(EPRINTS_ROOT)/bin ARCHIVE_ROOT:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME) ARCHIVE_CONFIG:=$(EPRINTS_ROOT)/archives/$(ARCHIVE_NAME).xml GENERATED_FILES:=$(ARCHIVE_NAME).xml $(ARCHIVE_NAME)/cfg/apachevhost.conf .PHONY: deploy generate_apacheconf import_subjects generate_static \ generate_abstracts generate_views restart_apache index stats deploy: $(GENERATED_FILES) @announce "Copying files..." @sudo -u $(EPRINTS_USER) 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 "$(ARCHIVE_NAME)\\.xml" .del-rsync-output && $(MAKE) generate_apacheconf @-grep --quiet "$(ARCHIVE_NAME)/cfg/subjects" .del-rsync-output && $(MAKE) import_subjects @-grep --quiet "\\(otago_eprints/cfg/static/\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) generate_static @-grep --quiet "\\(\\.pm\\)\\|\\(\\.xml\\)\|\($(ARCHIVE_NAME)/cfg/subjects\)" .del-rsync-output && $(MAKE) generate_views @-grep --quiet "\\($(ARCHIVE_NAME)/cfg/ArchiveRenderConfig.pm\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) generate_abstracts @-grep --quiet "\\(\\.conf\\)\\|\\(\\.pm\\)\\|\\(\\.xml\\)" .del-rsync-output && $(MAKE) restart_apache @rm -f .del-rsync-output $(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;' $< > $@ @chmod 600 $@ $(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 -u $(EPRINTS_USER) $(BINDIR)/$@ import_subjects generate_static generate_abstracts generate_views: @announce "$@ $(ARCHIVE_NAME)" @sudo -u $(EPRINTS_USER) $(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 -u $(EPRINTS_USER) $(BINDIR)/indexer start --once --notdaemon stats: @announce "Generating statistics..." @php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php # @sudo -u $(EPRINTS_USER) perl $(EPRINTS_ROOT)/ePrintsStats/scripts/add_country.pl debug: @echo "ARCHIVE_NAME = [$(ARCHIVE_NAME)]" @echo "EPRINTS = [$(EPRINTS)]" @echo "ARCHIVE_ROOT = [$(ARCHIVE_ROOT)]" @echo "ARCHIVE_CONFIG = [$(ARCHIVE_CONFIG)]"
Show line notes below