summaryrefslogtreecommitdiff
blob: c29585e369faea02d5956c57be522ca7724dcc12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Based on the upstream script but parts not relevant to Gentoo
# stripped away. We would not need this at all but better to make
# this behave as the upstream docs say and then also have all the 
# Gentoo goodies.
# https://bugs.gentoo.org/show_bug.cgi?id=176185

##------------------
THISDIR=`dirname $0`
# install layout is: script in /usr/bin/henplus and libs in /usr/share/henplus
HENPLUSDIR=$THISDIR/../share/henplus

# you may just throw your own jar files in this dir.
# (like additional JDBC-drivers, that are not in default
# classpath)
for f in $HENPLUSDIR/*.jar $HENPLUSDIR/*.zip ; do
    if [ -r "$f" ] ; then
        CLASSPATH=$CLASSPATH:$f
    fi
done

# starting at the current directory we look for additional
# JDBC-drivers in .henplus/lib-directories up the path. 
# if no directory like that has been found the one in the 
# home directory will be used
DIR=`pwd`
CUSTOM_HENPLUSDIR=""

while [ $DIR != "/" ] ; do
        if [ -d $DIR"/.henplus/lib" ]; then
            CUSTOM_HENPLUSDIR=$DIR"/.henplus/lib"
	    break
        fi
        DIR=`dirname $DIR`
done

if [ -z $CUSTOM_HENPLUSDIR ]; then
     if [ -d "/.henplus/lib" ]; then
         CUSTOM_HENPLUSDIR="/.henplus/lib"
     else
         CUSTOM_HENPLUSDIR=$HOME/.henplus/lib
     fi
fi

for f in $CUSTOM_HENPLUSDIR/*.jar $CUSTOM_HENPLUSDIR/*.zip ; do
    if [ -r "$f" ] ; then
        CLASSPATH=$CLASSPATH:$f
    fi
done

export CLASSPATH