-
Notifications
You must be signed in to change notification settings - Fork 1
/
set_env.sh
executable file
·51 lines (41 loc) · 1.78 KB
/
set_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
# Set environment variables needed for testing RDF::Pipeline.
# Only the RDF_PIPELINE_DEV_DIR must be set manually.
# All others are (normally) set automatically by this script.
#
# RDF_PIPELINE_DEV_DIR must be set to the top development directory
# for the RDF::Pipeline project (as checked out from github), which must
# contain the module directory "RDF-Pipeline".
export RDF_PIPELINE_DEV_DIR=/home/dbooth/rdf-pipeline/trunk
#################################################################
# All variables beyond this point are set automatically (unless
# something goes wrong).
#################################################################
# Set RDF_PIPELINE_WWW_DIR. Use $DOCUMENT_ROOT if set, or look
# in the default Apache2 config file for the DocumentRoot definition.
if [ ! "$DOCUMENT_ROOT" ]
then
APACHECONFIG="/etc/apache2/sites-enabled/000-default"
DOCROOT=`expand "$APACHECONFIG" | grep '^ *DocumentRoot ' | sed 's/^ *DocumentRoot *//'`
WORDCOUNT=`echo "$DOCROOT" | wc -w`
if [ $WORDCOUNT = 1 ]
then
export DOCUMENT_ROOT="$DOCROOT"
elif [ $WORDCOUNT = 0 ]
then
echo '[ERROR] DocumentRoot not found in' "$APACHECONFIG" 1>&2
else
echo '[ERROR] Multiple DocumentRoot definitions found in' "$APACHECONFIG": "$DOCROOT" 1>&2
fi
fi
export RDF_PIPELINE_WWW_DIR="$DOCUMENT_ROOT"
# Perl library path:
export PERL5LIB="$PERL5LIB:$RDF_PIPELINE_DEV_DIR/RDF-Pipeline/lib"
# Add test utilities to $PATH:
export PATH="$PATH:$RDF_PIPELINE_DEV_DIR/RDF-Pipeline/t"
export PATH="$PATH:$RDF_PIPELINE_DEV_DIR/RDF-Pipeline/t/helpers"
# Add tools utilities to $PATH:
export PATH="$PATH:$RDF_PIPELINE_DEV_DIR/tools"
# Add generic sparql utilities to path (initially sesame,
# but eventually should become generic):
export PATH="$PATH:$RDF_PIPELINE_DEV_DIR/tools/gsparql/scripts/sesame2_6"