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

Last change on this file since 8868 was 8067, checked in by mdewsnip, 20 years ago

Removed GSDLHOME stuff (it is now done only when necessary -- in the gli4gs3 scripts).

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