source: trunk/gsdl3/gs3-setup.sh@ 10952

Last change on this file since 10952 was 10952, checked in by kjdon, 18 years ago

added some stuff onto the CLASSPATH for use with GAI

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1# if this file is executed, /bin/sh is used, as we don't start with #!
2# this should work under ash, bash, zsh, ksh, sh style shells.
3
4# make sure we are sourced, and not run
5
6if test "$0" != "`echo $0 | sed s/gs3-setup\.sh//`" ; then
7# if $0 contains "gs3-setup.sh" we've been run... $0 is shellname if sourced.
8# One exception is zsh has an option to set it temporarily to the script name
9 if test -z "$ZSH_NAME" ; then
10 # we aren't using zsh
11 gsdl_not_sourced=true
12 fi
13fi
14
15if test -n "$gsdl_not_sourced" ; then
16 echo " Error: Make sure you source this script, not execute it. Eg:"
17 echo " $ source gs3-setup.sh"
18 echo " or"
19 echo " $ . ./gs3-setup.sh"
20 echo " not"
21 echo " $ ./gs3-setup.sh"
22 unset gsdl_not_sourced
23 exit 1
24fi
25
26if test ! -f gs3-setup.sh ; then
27 echo "You must source the script from within the Greenstone home directory"
28 exit 1
29fi
30
31GSDL3SRCHOME=`pwd`
32GSDL3HOME=$GSDL3SRCHOME/web
33export GSDL3HOME
34export GSDL3SRCHOME
35GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
36# check for running bash under cygwin
37if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then
38 GSDLOS=windows
39fi
40export GSDLOS
41
42#change this if external tomcat
43TOMCAT_HOME=$GSDL3SRCHOME/packages/tomcat
44
45PATH=$GSDL3SRCHOME/packages/mysql/bin:$GSDL3SRCHOME/bin/script:$GSDL3SRCHOME/bin:$PATH
46export PATH
47MANPATH=$MANPATH:$GSDL3SRCHOME/doc/man
48export MANPATH
49
50CLASSPATH=$GSDL3HOME/WEB-INF/classes:$GSDL3SRCHOME/resources/java:$CLASSPATH
51for JARFILE in $GSDL3SRCHOME/lib/jni/*.jar; do
52 CLASSPATH=$CLASSPATH:$JARFILE
53done
54for JARFILE in $GSDL3HOME/WEB-INF/lib/*.jar; do
55 CLASSPATH=$CLASSPATH:$JARFILE
56done
57for JARFILE in $TOMCAT_HOME/common/endorsed/*.jar; do
58 CLASSPATH=$CLASSPATH:$JARFILE
59done
60for JARFILE in $GSDL3SRCHOME/build/*.jar; do
61 CLASSPATH=$CLASSPATH:$JARFILE
62done
63
64export CLASSPATH
65
66LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3SRCHOME/lib/jni:$GSDL3SRCHOME/packages/mysql/lib/mysql
67export LD_LIBRARY_PATH
68## for mac
69DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GSDL3SRCHOME/lib/jni:$GSDL3SRCHOME/packages/mysql/lib/mysql
70export DYLD_LIBRARY_PATH
71
72
73# see if we can find java
74java="java"
75jfound=1
76jok=1
77# if JAVAHOME or JAVA_HOME is set we'll use it to determine where java lives, otherwise
78# we just hope it's on the search path
79if [ "$JAVA_HOME" != "" ] ; then
80 java="$JAVA_HOME/bin/java"
81elif [ "$JAVAHOME" != "" ] ; then
82 java="$JAVAHOME/bin/java"
83 export JAVA_HOME=$JAVAHOME
84else
85 java=`which java 2> /dev/null`
86 if [ ! -x "$java" ]; then
87 echo "Failed to locate Java. You must install a java runtime environment"
88 echo "(version 1.4 or greater) before installing Greenstone 3."
89 jfound=0
90 jok=0
91 else
92 export JAVA_HOME=`echo $java | sed -n 's/[\\\/]bin[\\\/]java$//p'`
93 fi
94fi
95if [ $jfound -eq 1 ]; then
96 javaversion=`$java -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
97 jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
98 jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
99
100 if [ $jvmajor -lt 1 ] ; then
101 jok=0
102 fi
103 if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
104 jok=0
105 fi
106fi
107
108if [ $jfound -eq 1 ] && [ $jok -eq 0 ] ; then
109 echo "The version of the java runtime environment you have installed is too"
110 echo "old to run Greenstone 3. Please install a new version of the JRE (version"
111 echo "1.4 or newer) and rerun this installation."
112else
113 echo "Your environment has successfully been set up to run Greenstone3"
114fi
115
116#do we need to check for perl???
117# make sure perl is ok
118#perl=`which perl 2> /dev/null`
119# echo "perl: $perl"
120#if [ ! -x "$perl" ] ; then
121# echo "Greenstone 3 requires perl in order to operate but this installation"
122# echo "could not detect perl on your system. Please ensure that perl is installed"
123# echo "and is on your search path then rerun this installation script."
124# exit 1
125#fi
126
127
128
129
Note: See TracBrowser for help on using the repository browser.