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

Last change on this file since 30255 was 30252, checked in by jmt12, 9 years ago

Adding support for the extension living in Greenstone3, and make script more robust/secure against things like spaces in filepaths

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" ] ; then
12 GSDLVER=3
13fi
14if [ "${GSDLHOME}x" != "x" ] ; then
15 GSDLVER=2
16fi
17
18if [ "$GSDLVER" == "0" ] ; then
19 export gsopt_noexts=1
20 CWD=`pwd`
21 cd ../..
22 if [ -f "./gs3-setup.sh" ] ; then
23 source ./gs3-setup.sh
24 GSDLVER=3
25 else
26 source ./setup.bash
27 GSDLVER=2
28 fi
29 cd "${CWD}"
30 unset gsopt_noexts
31fi
32
33if [ "x$GEXTTDBEDIT" = "x" ] ; then
34
35 export TDBEDITOS=`uname -s | tr '[A-Z]' '[a-z]' | sed 's/\([0-9]\+\)\?_.*$//'`
36 export GEXTTDBEDIT="${fulldir}"
37 export GEXTTDBEDIT_INSTALLED="${GEXTTDBEDIT}/${GSDLOS}"
38
39 export PATH="${GEXTTDBEDIT_INSTALLED}/bin:${fulldir}/bin/script:${PATH}"
40
41 if [ "x$LD_LIBRARY_PATH" = "x" ] ; then
42 export LD_LIBRARY_PATH="${GEXTTDBEDIT_INSTALLED}/lib"
43 else
44 export LD_LIBRARY_PATH="${GEXTTDBEDIT_INSTALLED}/lib:${LD_LIBRARY_PATH}"
45 fi
46
47 extdir="${GEXTTDBEDIT##*/}"
48
49 if [ "${GSDLVER}" = "3" ] ; then
50 if [ "x${GSDL3EXTS}" = "x" ] ; then
51 export GSDL3EXTS="${extdir}"
52 else
53 export GSDL3EXTS="${GSDL3EXTS}:${extdir}"
54 fi
55 else
56 if [ "x${GSDLEXTS}" = "x" ] ; then
57 export GSDLEXTS="${extdir}"
58 else
59 export GSDLEXTS="${GSDLEXTS}:${extdir}"
60 fi
61 fi
62
63
64
65 echo "+Your environment is now setup for $extdesc for Greenstone${GSDLVER}"
66else
67 echo "+Your environment is already setup for $extdesc for Greenstone${GSDLVER}"
68fi
69
70
Note: See TracBrowser for help on using the repository browser.