- Switched to machine-independent environment configuration.
1 parent fb5650b commit 3f66360ff5b06317b57e8eca0986ae53c4cc9963
nstanger authored on 12 Dec 2005
Showing 5 changed files
View
99
Repositories/statistics/Makefile
SHELL=/bin/sh
 
EPRINTSSTATS:=/usr/local/eprints/ePrintsStats
# Load in machine-specific environment settings from environment_config.make.
# This include file MUST be created and MUST define the following variables:
#
# EPRINTSSTATS: /path/to/eprintsstats/installation
# EPRINTS_USER: the user that owns the EPrints directory
# EPRINTS_GROUP: the group that owns the EPrints directory
#
# EPRINTS_HOST: eprints host name
# EPRINTS_PORT: appropriate HTTP port
# EPRINTS_ADMIN_EMAIL: administrator email address (quote "@" with \)
#
# GEOIP_DATABASE:=/usr/local/share/GeoIP/GeoIP.dat
#
# APACHE_LOG_LOCATION:=/sw/var/apache2/logs/
# APACHE_LOG_NAME:=access_log
#
# PHP_LIB:=/sw/lib/php4
#
include environment_config.make
 
 
BINDIR:=$(EPRINTSSTATS)/scripts
 
GENERATED_FILES:=config/inc.vars.es.php scripts/eprints-usage.php \
scripts/fix-countries.php vhost/apache.conf
 
CONFIG_SUBS:=EPRINTSSTATS EPRINTS_HOST EPRINTS_PORT EPRINTS_ADMIN_EMAIL
USAGE_SUBS:=GEOIP_DATABASE APACHE_LOG_LOCATION APACHE_LOG_NAME
FIX_SUBS:=GEOIP_DATABASE
VHOST_SUBS:=EPRINTSSTATS PHP_LIB
 
 
.PHONY: deploy stats
 
 
deploy:
deploy: $(GENERATED_FILES)
@announce "Copying files..."
@sudo rsync --verbose --cvs-exclude --exclude=Makefile \
--exclude='*.make' --exclude='*_src.*' \
--recursive --times . $(EPRINTSSTATS)
@announce "Correcting ownership..."
sudo chown -R www:www $(EPRINTSSTATS)
sudo chown -R $(EPRINTS_USER):$(EPRINTS_GROUP) $(EPRINTSSTATS)
 
 
config/inc.vars.es.php: config/inc.vars.es_src.php
@announce "Generating $@"
perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
 
 
scripts/eprints-usage.php: scripts/eprints-usage_src.php
@announce "Generating $@"
perl -p $(foreach SUB,$(USAGE_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
 
 
scripts/fix-countries.php: scripts/fix-countries_src.php
@announce "Generating $@"
perl -p $(foreach SUB,$(FIX_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
 
 
vhost/apache.conf: vhost/apache_src.conf
@announce "Generating $@"
perl -p $(foreach SUB,$(VHOST_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
 
 
stats:
@announce "Generating statistics..."
@sudo -u www php $(BINDIR)/eprints-usage.php
@sudo -u www perl $(BINDIR)/add_country.pl
@sudo -u $(EPRINTS_USER) php $(BINDIR)/eprints-usage.php
# @sudo -u $(EPRINTS_USER) perl $(BINDIR)/add_country.pl
 
 
debug:
@echo "EPRINTSSTATS = [$(EPRINTSSTATS)]"
View
8
Repositories/statistics/config/inc.vars.es_src.php
"filelocation" => array(
"vTITLE" => "File locations",
"vDESCRIPTION" => "Install directory and location of required files.",
"base_install_dir" => array(
"unix" => "/usr/local/eprints/ePrintsStats",
"unix" => "##EPRINTSSTATS##",
"windows" => "C:/ePrintsStats",
),
"base_log_dir" => "logs",
"base_includes_dir" => "includes",
"general" => array(
"vTITLE" => "General progam details",
"vDESCRIPTION" => "Admin name and contact, prog title",
"admin_name" => "ePrints Administrator",
"admin_email" => "admin@eprints.otago.ac.nz",
"admin_email" => "##EPRINTS_ADMIN_EMAIL##",
"support_name" => "ePrints Administrator",
"support_email" => "admin@eprints.otago.ac.nz",
"support_email" => "##EPRINTS_ADMIN_EMAIL##",
"prog_title" => "ePrints Statistics",
"prog_title_public" => "ePrints Statistics",
"short_prog_title" => "es",
"public_prog" => "index.php",
"public_prog_request_uri" => "/index.php",
"eprints_location" => "http://eprints.otago.ac.nz",
"eprints_location" => "http://##EPRINTS_HOST##:##EPRINTS_PORT##",
/* replaced admin_prog */
"prog_address" => array(
"public" => "index.php",
),
View
Repositories/statistics/scripts/eprints-usage_src.php
View
Repositories/statistics/scripts/fix-countries_src.php
View
Repositories/statistics/vhost/apache_src.conf