Changeset 8060


Ignore:
Timestamp:
2004-08-26T06:24:32+12:00 (20 years ago)
Author:
kjdon
Message:

made this look for gsdl a bit better - need gsdl to run gli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/gs3-setup.sh

    r7469 r8060  
    2020  echo "    not"
    2121  echo "        $ ./gs3-setup.sh"
     22  unset gsdl_not_sourced
     23  exit 1
     24fi
    2225
    23 elif test ! -f gs3-setup.sh ; then
     26if test ! -f gs3-setup.sh ; then
    2427  echo "You must source the script from within the Greenstone home directory"
    25  
    26 else
     28  exit 1
     29fi
    2730
    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
     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
    3639
    37   # gsdl2home for running gli under gs3
    38   GSDLHOME=$GSDL3HOME/gs2extra
    39   export GSDLHOME
     40## determine GSDLHOME for running gli under gs3
     41gsdlpath=
    4042
    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
     43# Some users may set the above line manually
     44if [ "$gsdlpath" == "" ]; then
     45    # check to see if we have a gs2extra directory
     46    if [ -d gs2extra ]; then
     47    gsdlpath=$GSDL3HOME/gs2extra
     48    # Check the environment variable   
     49    elif [ "$GSDLHOME" != "" ]; then
     50    gsdlpath=$GSDLHOME
     51   
     52    else
     53    echo "Could not determine the location of a greenstone 2 installation."
     54    echo "You will be able to run greenstone3 but not use the GLI."
     55    echo "To use the GLI, please run 'source setup.bash' in your gsdl installation before running this script, or set gsdlpath in the gs3-setup.sh script."
     56    fi
     57fi
     58
     59GSDLHOME=$gsdlpath
     60export GSDLHOME
     61
     62PATH=$GSDL3HOME/packages/mysql/bin:$GSDL3HOME/bin/script:$GSDL3HOME/bin:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS:$PATH
     63export PATH
     64MANPATH=$MANPATH:$GSDL3HOME/doc/man
     65export MANPATH
     66
     67CLASSPATH=$GSDL3HOME/resources/java:$GSDL3HOME/resources/dtd:$GSDL3HOME/src/java:$GSDL3HOME/comms/jakarta/tomcat/common/lib/servlet.jar:$GSDL3HOME/lib/java
     68for JARFILE in  $GSDL3HOME/lib/java/*.jar; do
    4869    CLASSPATH=$CLASSPATH:$JARFILE
    49   done
    50   export CLASSPATH
     70done
     71export CLASSPATH
    5172
    52   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3HOME/lib:$GSDL3HOME/packages/mysql/lib/mysql
    53   export LD_LIBRARY_PATH
     73LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3HOME/lib:$GSDL3HOME/packages/mysql/lib/mysql
     74export LD_LIBRARY_PATH
    5475
    5576
    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
     77# see if we can find java
     78java="java"
     79jfound=1
     80jok=1
     81# if JAVAHOME or JAVA_HOME is set we'll use it to determine where java lives, otherwise
     82#  we just hope it's on the search path
     83if [ "$JAVA_HOME" != "" ] ; then
    6384    java="$JAVA_HOME/bin/java"
    64   elif [ "$JAVAHOME" != "" ] ; then
     85elif [ "$JAVAHOME" != "" ] ; then
    6586    java="$JAVAHOME/bin/java"
    6687    export JAVA_HOME=$JAVAHOME
    67   else
     88else
    6889    java=`which java 2> /dev/null`
    6990    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
     91    echo "Failed to locate Java. You must install a java runtime environment"
     92    echo "(version 1.4 or greater) before installing Greenstone 3."
     93    jfound=0
     94    jok=0
    7495    else
    75       export JAVA_HOME=`echo $java | sed -n 's/[\\\/]bin[\\\/]java$//p'`
     96    export JAVA_HOME=`echo $java | sed -n 's/[\\\/]bin[\\\/]java$//p'`
    7697    fi
    77   fi
    78   if [ $jfound -eq 1 ]; then
     98fi
     99if [ $jfound -eq 1 ]; then
    79100    javaversion=`$java -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
    80101    jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
    81102    jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
    82 
     103   
    83104    if [ $jvmajor -lt 1 ] ; then
    84       jok=0
     105    jok=0
    85106    fi
    86107    if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
    87       jok=0
     108    jok=0
    88109    fi
    89   fi
    90    
    91   if [ $jfound -eq 1 ] && [ $jok -eq 0 ] ; then
     110fi
     111
     112if [ $jfound -eq 1 ] && [ $jok -eq 0 ] ; then
    92113    echo "The version of the java runtime environment you have installed is too"
    93114    echo "old to run Greenstone 3. Please install a new version of the JRE (version"
    94115    echo "1.4 or newer) and rerun this installation."
    95   else
     116else
    96117    echo "Your environment has successfully been set up to run Greenstone3"
    97   fi
    98118fi
    99 
    100 unset gsdl_not_sourced
    101119
    102120#do we need to check for perl???
Note: See TracChangeset for help on using the changeset viewer.