source: gs2-extensions/tdb/trunk/setup.bash@ 30271

Last change on this file since 30271 was 30266, checked in by jmt12, 9 years ago

Altered a test for Greenstone version so it doesn't (incorrectly) set GS3 to 2 as well since it also sets a GSDLHOME

File size: 1.5 KB
Line 
1
2extdesc="TDB Database support"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir="${full_setup%/*}"
6fulldir="${fulldir%/.}"
7
8GSDLVER=0
9
10# Test for one of the homes, otherwise we need to source a top-level setup
11if [ "${GSDL3HOME}x" != "x" ]
12then
13 GSDLVER=3
14else
15 if [ "${GSDLHOME}x" != "x" ]
16 then
17 GSDLVER=2
18 fi
19fi
20
21if [ "$GSDLVER" == "0" ] ; then
22 export gsopt_noexts=1
23 CWD=`pwd`
24 cd ../..
25 if [ -f "./gs3-setup.sh" ] ; then
26 source ./gs3-setup.sh
27 GSDLVER=3
28 else
29 source ./setup.bash
30 GSDLVER=2
31 fi
32 cd "${CWD}"
33 unset gsopt_noexts
34fi
35
36if [ "x$GEXTTDBEDIT" = "x" ] ; then
37
38 export TDBEDITOS=`uname -s | tr '[A-Z]' '[a-z]' | sed 's/\([0-9]\+\)\?_.*$//'`
39 export GEXTTDBEDIT="${fulldir}"
40 export GEXTTDBEDIT_INSTALLED="${GEXTTDBEDIT}/${GSDLOS}"
41
42 export PATH="${GEXTTDBEDIT_INSTALLED}/bin:${fulldir}/bin/script:${PATH}"
43
44 if [ "x$LD_LIBRARY_PATH" = "x" ] ; then
45 export LD_LIBRARY_PATH="${GEXTTDBEDIT_INSTALLED}/lib"
46 else
47 export LD_LIBRARY_PATH="${GEXTTDBEDIT_INSTALLED}/lib:${LD_LIBRARY_PATH}"
48 fi
49
50 extdir="${GEXTTDBEDIT##*/}"
51
52 if [ "${GSDLVER}" = "3" ] ; then
53 if [ "x${GSDL3EXTS}" = "x" ] ; then
54 export GSDL3EXTS="${extdir}"
55 else
56 export GSDL3EXTS="${GSDL3EXTS}:${extdir}"
57 fi
58 else
59 if [ "x${GSDLEXTS}" = "x" ] ; then
60 export GSDLEXTS="${extdir}"
61 else
62 export GSDLEXTS="${GSDLEXTS}:${extdir}"
63 fi
64 fi
65
66
67
68 echo "+Your environment is now setup for $extdesc for Greenstone${GSDLVER}"
69else
70 echo "+Your environment is already setup for $extdesc for Greenstone${GSDLVER}"
71fi
72
73
Note: See TracBrowser for help on using the repository browser.