diff --git a/Repositories/otago_eprints/Makefile b/Repositories/otago_eprints/Makefile index f7898c3..1628954 100755 --- a/Repositories/otago_eprints/Makefile +++ b/Repositories/otago_eprints/Makefile @@ -8,6 +8,9 @@ # 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 @@ -40,12 +43,10 @@ deploy: $(GENERATED_FILES) @announce "Copying files..." - @sudo rsync --verbose --cvs-exclude --exclude=Makefile \ + @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 - @announce "Correcting ownership..." - sudo chown -R $(EPRINTS_USER):$(EPRINTS_GROUP) $(ARCHIVE_CONFIG) $(ARCHIVE_ROOT) @-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 @@ -58,6 +59,7 @@ $(ARCHIVE_NAME).xml: $(ARCHIVE_NAME)_src.xml @announce "Creating $@" perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@ + @chmod 600 $@ $(ARCHIVE_NAME)/cfg/apachevhost.conf: $(ARCHIVE_NAME)/cfg/apachevhost_src.conf @@ -77,11 +79,11 @@ restart_apache: @announce "Waiting for Apache to shut down..." - @sudo /sw/sbin/apachectl stop + @sudo $(APACHE_STOP) @sleep 10 @announce "Waiting for Apache to start up..." - @sudo /sw/sbin/apachectl start - @while [ ! -f /sw/var/apache2/logs/httpd.pid ]; do echo > /dev/null; done + @sudo $(APACHE_STOP) + @while [ ! -f $(APACHE_PID) ]; do echo > /dev/null; done index: @@ -91,7 +93,7 @@ stats: @announce "Generating statistics..." - @sudo -u $(EPRINTS_USER) php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php + @php $(EPRINTS_ROOT)/ePrintsStats/scripts/eprints-usage.php # @sudo -u $(EPRINTS_USER) perl $(EPRINTS_ROOT)/ePrintsStats/scripts/add_country.pl