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

Last change on this file since 10327 was 10327, checked in by kjdon, 19 years ago

changed GSDLSRCHOME to GSDL3SRCHOME, and now export it

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 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
42TOMCAT_HOME=$GSDL3SRCHOME/comms/jakarta/tomcat
43PATH=$GSDL3SRCHOME/packages/mysql/bin:$GSDL3SRCHOME/bin/script:$GSDL3SRCHOME/bin:$PATH
44export PATH
45MANPATH=$MANPATH:$GSDL3SRCHOME/doc/man
46export MANPATH
47
48CLASSPATH=$GSDL3HOME/WEB-INF/classes:$CLASSPATH
49for JARFILE in $GSDL3SRCHOME/lib/jni/*.jar; do
50 CLASSPATH=$CLASSPATH:$JARFILE
51done
52for JARFILE in $GSDL3HOME/WEB-INF/lib/*.jar; do
53 CLASSPATH=$CLASSPATH:$JARFILE
54done
55for JARFILE in $GSDL3SRCHOME/comms/soap/axis/lib/*.jar; do
56 CLASSPATH=$CLASSPATH:$JARFILE
57done
58for JARFILE in $TOMCAT_HOME/common/endorsed/*.jar; do
59 CLASSPATH=$CLASSPATH:$JARFILE
60done
61
62export CLASSPATH
63
64LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3SRCHOME/lib/jni:$GSDL3SRCHOME/packages/mysql/lib/mysql
65export LD_LIBRARY_PATH
66
67
68# see if we can find java
69java="java"
70jfound=1
71jok=1
72# if JAVAHOME or JAVA_HOME is set we'll use it to determine where java lives, otherwise
73# we just hope it's on the search path
74if [ "$JAVA_HOME" != "" ] ; then
75 java="$JAVA_HOME/bin/java"
76elif [ "$JAVAHOME" != "" ] ; then
77 java="$JAVAHOME/bin/java"
78 export JAVA_HOME=$JAVAHOME
79else
80 java=`which java 2> /dev/null`
81 if [ ! -x "$java" ]; then
82 echo "Failed to locate Java. You must install a java runtime environment"
83 echo "(version 1.4 or greater) before installing Greenstone 3."
84 jfound=0
85 jok=0
86 else
87 export JAVA_HOME=`echo $java | sed -n 's/[\\\/]bin[\\\/]java$//p'`
88 fi
89fi
90if [ $jfound -eq 1 ]; then
91 javaversion=`$java -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
92 jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
93 jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
94
95 if [ $jvmajor -lt 1 ] ; then
96 jok=0
97 fi
98 if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
99 jok=0
100 fi
101fi
102
103if [ $jfound -eq 1 ] && [ $jok -eq 0 ] ; then
104 echo "The version of the java runtime environment you have installed is too"
105 echo "old to run Greenstone 3. Please install a new version of the JRE (version"
106 echo "1.4 or newer) and rerun this installation."
107else
108 echo "Your environment has successfully been set up to run Greenstone3"
109fi
110
111#do we need to check for perl???
112# make sure perl is ok
113#perl=`which perl 2> /dev/null`
114# echo "perl: $perl"
115#if [ ! -x "$perl" ] ; then
116# echo "Greenstone 3 requires perl in order to operate but this installation"
117# echo "could not detect perl on your system. Please ensure that perl is installed"
118# echo "and is on your search path then rerun this installation script."
119# exit 1
120#fi
121
122
123
124
Note: See TracBrowser for help on using the repository browser.