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

Last change on this file since 7988 was 7469, checked in by kjdon, 20 years ago

now includes GSDLHOME for the gs2extra stuff that is needed to run gli for gs3

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 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
23elif test ! -f gs3-setup.sh ; then
24 echo "You must source the script from within the Greenstone home directory"
25
26else
27
28 GSDL3HOME=`pwd`
29 export GSDL3HOME
30 GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
31 # check for running bash under cygwin
32 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then
33 GSDLOS=windows
34 fi
35 export GSDLOS
36
37 # gsdl2home for running gli under gs3
38 GSDLHOME=$GSDL3HOME/gs2extra
39 export GSDLHOME
40
41 PATH=$GSDL3HOME/packages/mysql/bin:$GSDL3HOME/bin/script:$GSDL3HOME/bin:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS:$PATH
42 export PATH
43 MANPATH=$MANPATH:$GSDL3HOME/doc/man
44 export MANPATH
45
46 CLASSPATH=$GSDL3HOME/resources/java:$GSDL3HOME/resources/dtd:$GSDL3HOME/src/java:$GSDL3HOME/comms/jakarta/tomcat/common/lib/servlet.jar:$GSDL3HOME/lib/java
47 for JARFILE in $GSDL3HOME/lib/java/*.jar; do
48 CLASSPATH=$CLASSPATH:$JARFILE
49 done
50 export CLASSPATH
51
52 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3HOME/lib:$GSDL3HOME/packages/mysql/lib/mysql
53 export LD_LIBRARY_PATH
54
55
56 # see if we can find java
57 java="java"
58 jfound=1
59 jok=1
60 # if JAVAHOME or JAVA_HOME is set we'll use it to determine where java lives, otherwise
61 # we just hope it's on the search path
62 if [ "$JAVA_HOME" != "" ] ; then
63 java="$JAVA_HOME/bin/java"
64 elif [ "$JAVAHOME" != "" ] ; then
65 java="$JAVAHOME/bin/java"
66 export JAVA_HOME=$JAVAHOME
67 else
68 java=`which java 2> /dev/null`
69 if [ ! -x "$java" ]; then
70 echo "Failed to locate Java. You must install a java runtime environment"
71 echo "(version 1.4 or greater) before installing Greenstone 3."
72 jfound=0
73 jok=0
74 else
75 export JAVA_HOME=`echo $java | sed -n 's/[\\\/]bin[\\\/]java$//p'`
76 fi
77 fi
78 if [ $jfound -eq 1 ]; then
79 javaversion=`$java -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
80 jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
81 jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
82
83 if [ $jvmajor -lt 1 ] ; then
84 jok=0
85 fi
86 if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
87 jok=0
88 fi
89 fi
90
91 if [ $jfound -eq 1 ] && [ $jok -eq 0 ] ; then
92 echo "The version of the java runtime environment you have installed is too"
93 echo "old to run Greenstone 3. Please install a new version of the JRE (version"
94 echo "1.4 or newer) and rerun this installation."
95 else
96 echo "Your environment has successfully been set up to run Greenstone3"
97 fi
98fi
99
100unset gsdl_not_sourced
101
102#do we need to check for perl???
103# make sure perl is ok
104#perl=`which perl 2> /dev/null`
105# echo "perl: $perl"
106#if [ ! -x "$perl" ] ; then
107# echo "Greenstone 3 requires perl in order to operate but this installation"
108# echo "could not detect perl on your system. Please ensure that perl is installed"
109# echo "and is on your search path then rerun this installation script."
110# exit 1
111#fi
112
113
114
115
Note: See TracBrowser for help on using the repository browser.