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 | gsdllang=en
|
---|
4 |
|
---|
5 | # make sure we are sourced, and not run
|
---|
6 |
|
---|
7 | if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then
|
---|
8 | # if $0 contains "setup.bash" we've been run... $0 is shellname if sourced.
|
---|
9 | # One exception is zsh has an option to set it temporarily to the script name
|
---|
10 | if test -z "$ZSH_NAME" ; then
|
---|
11 | # we aren't using zsh
|
---|
12 | gsdl_not_sourced=true
|
---|
13 | fi
|
---|
14 | fi
|
---|
15 |
|
---|
16 | if test -n "$gsdl_not_sourced" ; then
|
---|
17 | if [ "$gsdllang" == "fr" ]; then
|
---|
18 | echo "-- Still coming --"
|
---|
19 | else
|
---|
20 | echo " Error: Make sure you source this script, not execute it. Eg:"
|
---|
21 | echo " $ source setup.bash"
|
---|
22 | echo " or"
|
---|
23 | echo " $ . ./setup.bash"
|
---|
24 | echo " not"
|
---|
25 | echo " $ ./setup.bash"
|
---|
26 | fi
|
---|
27 | elif test -n "$GSDLHOME" ; then
|
---|
28 | if [ "$gsdllang" == "fr" ]; then
|
---|
29 | echo "Votre environnement est déjà préparé pour Greenstone!"
|
---|
30 | else
|
---|
31 | echo "Your environment is already set up for Greenstone!"
|
---|
32 | fi
|
---|
33 | elif test ! -f setup.bash ; then
|
---|
34 | if [ "$gsdllang" == "fr" ]; then
|
---|
35 | echo "Vous devez trouver la source du script dans le répertoire de base de Greenstone"
|
---|
36 | else
|
---|
37 | echo "You must source the script from within the Greenstone home directory"
|
---|
38 | fi
|
---|
39 | else
|
---|
40 | GSDLHOME=`pwd`
|
---|
41 | export GSDLHOME
|
---|
42 | GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
43 | # check for running bash under cygwin
|
---|
44 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
45 | then
|
---|
46 | GSDLOS=windows
|
---|
47 | fi
|
---|
48 | export GSDLOS
|
---|
49 |
|
---|
50 | PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS
|
---|
51 | export PATH
|
---|
52 | MANPATH=$MANPATH:$GSDLHOME/packages/mg/man
|
---|
53 | export MANPATH
|
---|
54 | if [ "$gsdllang" == "fr" ]; then
|
---|
55 | echo "Votre environnement a été configuére avec succès pour exécuter Greenstone"
|
---|
56 | else
|
---|
57 | echo "Your environment has successfully been set up to run Greenstone"
|
---|
58 | fi
|
---|
59 | fi
|
---|
60 | unset gsdl_not_sourced
|
---|