#!/bin/sh

# the jars from the tomcat common dir
DIRLIBS=${CATALINA_HOME}/common/lib/*.jar
for i in ${DIRLIBS}
do
    # if the directory is empty, then it will return the input string
    # this is stupid, so case for it
    if [ "$i" != "${DIRLIBS}" ] ; then
        CLASSPATH="$i":$CLASSPATH
    fi
done

# the jars from the OGSA dir
DIRLIBS=${CATALINA_HOME}/webapps/ogsa/WEB-INF/lib/*.jar
for i in ${DIRLIBS}
do
    # if the directory is empty, then it will return the input string
    # this is stupid, so case for it
    if [ "$i" != "${DIRLIBS}" ] ; then
        CLASSPATH="$i":$CLASSPATH
    fi
done

OGSA_DAI_HOME=`pwd`
export OGSA_DAI_HOME
DIRLIBS=${OGSA_DAI_HOME}/lib/*.jar
for i in ${DIRLIBS}
do
    # if the directory is empty, then it will return the input string
    # this is stupid, so case for it
    if [ "$i" != "${DIRLIBS}" ] ; then
      if [ -z "$CLASSPATH" ] ; then
        CLASSPATH=$i
      else
        CLASSPATH="$i":$CLASSPATH
      fi
    fi
done
CLASSPATH=.:${OGSA_DAI_HOME}/build:$CLASSPATH

export CLASSPATH
