source: trunk/gsdl3/setup.bash@ 3635

Last change on this file since 3635 was 3635, checked in by kjdon, 21 years ago

this now needs to be run after install.bash, so removed the lines that prevent it running if GSDL3HOME is set

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 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/setup\.bash//`" ; then
7# if $0 contains "setup.bash" 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 setup.bash"
18 echo " or"
19 echo " $ . ./setup.bash"
20 echo " not"
21 echo " $ ./setup.bash"
22#elif test -n "$GSDL3HOME" ; then
23# echo "Your environment is already set up for Greenstone3!"
24elif test ! -f setup.bash ; then
25 echo "You must source the script from within the Greenstone home directory"
26else
27 GSDL3HOME=`pwd`
28 export GSDL3HOME
29 GSDL3OS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
30 # check for running bash under cygwin
31 if test "`echo $GSDL3OS | sed 's/cygwin//'`" != "$GSDL3OS" ;
32 then
33 GSDL3OS=windows
34 fi
35 export GSDL3OS
36
37 PATH=$PATH:$GSDL3HOME/bin/script:$GSDL3HOME/bin/$GSDL3OS
38 export PATH
39 MANPATH=$MANPATH:$GSDL3HOME/doc/man
40 export MANPATH
41
42 CLASSPATH=$GSDL3HOME/resources/java:$GSDL3HOME/src/java:$GSDL3HOME/comms/tomcat/jakarta/common/lib/servlet.jar
43 for JARFILE in $GSDL3HOME/lib/java/*; do
44 CLASSPATH=$CLASSPATH:$JARFILE
45 done
46 export CLASSPATH
47
48 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSDL3HOME/lib
49 export LD_LIBRARY_PATH
50
51 #set up java - should this be done here?
52 JAVA_HOME=/usr/local/share/j2sdk1.4.0/
53 export JAVA_HOME
54 PATH=/usr/local/share/j2sdk1.4.0/bin:$PATH
55 export PATH
56
57
58 echo "Your environment has successfully been set up to run Greenstone3"
59fi
60unset gsdl_not_sourced
61
62
63
64
65
Note: See TracBrowser for help on using the repository browser.