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

Last change on this file since 13824 was 13824, checked in by kjdon, 17 years ago

removed mysql stuff from paths

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