[32228] | 1 | # GEXT: XPDFTOOLS
|
---|
[32227] | 2 |
|
---|
| 3 | extdesc="the Xpdf-Tools Extension"
|
---|
| 4 |
|
---|
| 5 | full_setup=`pwd`/${BASH_SOURCE}
|
---|
| 6 | fulldir=${full_setup%/*}
|
---|
| 7 | fulldir=${fulldir%/.}
|
---|
| 8 |
|
---|
| 9 | if [ "x$GSDLHOME" = "x" ] ; then
|
---|
| 10 | if [ -e ../../setup.bash ] ; then
|
---|
| 11 | export gsopt_noexts=1 && pushd ../.. && source setup.bash && popd
|
---|
| 12 | export gsopt_noexts=
|
---|
| 13 | elif [ -e ../../gs3-setup.sh ] ; then
|
---|
| 14 | export gsopt_noexts=1 && pushd ../.. && source gs3-setup.sh && popd
|
---|
| 15 | export gsopt_noexts=
|
---|
| 16 | fi
|
---|
| 17 | fi
|
---|
| 18 |
|
---|
| 19 | if test -z $GSDLOS ; then
|
---|
| 20 | GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
|
---|
| 21 | # check for running bash under Cygwin
|
---|
| 22 | if [ test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ] ; then
|
---|
| 23 | GSDLOS=windows
|
---|
| 24 | fi
|
---|
| 25 | # check for running bash under MinGW/MSys
|
---|
| 26 | if [ test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ] ; then
|
---|
| 27 | GSDLOS=windows
|
---|
| 28 | fi
|
---|
| 29 | echo "GSDLOS was not set. Setting it to '$GSDLOS'"
|
---|
| 30 | export GSDLOS
|
---|
| 31 | fi
|
---|
| 32 |
|
---|
| 33 | if [ "x$GEXT_XPDFTOOLS" = "x" ] ; then
|
---|
| 34 | export GEXT_XPDFTOOLS=`pwd`
|
---|
| 35 | export GEXTXPDFTOOLS_INSTALLED=$GEXT_XPDFTOOLS/$GSDLOS
|
---|
| 36 |
|
---|
| 37 | if [ -d "$GEXTXPDFTOOLS_INSTALLED/bin/script" ] ; then
|
---|
| 38 | export PATH=$GEXTXPDFTOOLS_INSTALLED/bin/script:$PATH
|
---|
| 39 | fi
|
---|
| 40 |
|
---|
| 41 | if [ -d "$GEXTXPDFTOOLS_INSTALLED/bin" ] ; then
|
---|
| 42 | export PATH=$GEXTXPDFTOOLS_INSTALLED/bin:$PATH
|
---|
| 43 | fi
|
---|
| 44 |
|
---|
| 45 | if [ -d "$GEXTXPDFTOOLS_INSTALLED/lib" ] ; then
|
---|
| 46 | if [ "$GSDLOS" = "linux" ] ; then
|
---|
| 47 | export LD_LIBRARY_PATH=$GEXTXPDFTOOLS_INSTALLED/lib:$LD_LIBRARY_PATH
|
---|
| 48 | elif [ "$GSDLOS" = "darwin" ] ; then
|
---|
| 49 | export DYLD_LIBRARY_PATH=$GEXTXPDFTOOLS_INSTALLED/lib:$DYLD_LIBRARY_PATH
|
---|
| 50 | fi
|
---|
| 51 | fi
|
---|
| 52 |
|
---|
| 53 | extdir=${GEXT_XPDFTOOLS##*/}
|
---|
| 54 |
|
---|
| 55 | if [ "x$GSDLEXTS" = "x" ] ; then
|
---|
| 56 | export GSDLEXTS=$extdir
|
---|
| 57 | else
|
---|
| 58 | export GSDLEXTS=$GSDLEXTS:$extdir
|
---|
| 59 | fi
|
---|
[32228] | 60 | if [ "x$1" != "xsilent" ] ; then
|
---|
| 61 | echo "+Your environment is now setup for $extdesc in Greenstone"
|
---|
| 62 | fi
|
---|
[32227] | 63 | else
|
---|
[32228] | 64 | if [ "x$1" != "xsilent" ] ; then
|
---|
| 65 | echo "+Your environment is already setup for $extdesc in Greenstone"
|
---|
| 66 | fi
|
---|
[32227] | 67 | fi
|
---|
| 68 |
|
---|
[32238] | 69 | # XPDFTOOLS is a GS2 extension, as it should be common to GS2 and GS3.
|
---|
| 70 | # This becomes circular if done in a GS2 extension.
|
---|
| 71 | # But in a GS3 extension, devel.bash should source gs3-setup.sh which doesn't source devel.bash
|
---|
[32228] | 72 | # From http://trac.greenstone.org/browser/other-projects/trunk/realistic-books/setup.bash
|
---|
[32238] | 73 | #if [ -e devel.sh ] ; then
|
---|
| 74 | # source devel.sh $*
|
---|
| 75 | #fi
|
---|