#!/bin/sh
#
# Ganymede server jar build script
#
# Version: $Revision: 1.18 $
# Date: $Date: 2001/04/23 05:06:55 $
#
############################################################

currentdir=`pwd`

# Change to the directory where this build script is

prog=$0
builddir=`echo $prog|sed 's%/[^/][^/]*$%%'`
test "x$builddir" = "x$builddir" && builddir=.
cd $builddir

# Load configuration information

. ./config.sh

# And do the build

echo "Building server jar"

cd $TARGETDIR

mv -f ganymedeServer.jar ganymedeServer.jar.old > /dev/null 2>&1

cd server_classes

# We need the Util package for lots of things

cd arlut/csd
rm -f Util
ln -s $TARGETDIR/arlut/csd/Util .
cd ../..

# We need the arlut.csd.crypto package for our Samba support

cd arlut/csd
rm -f crypto
ln -s $TARGETDIR/arlut/csd/crypto .
cd ../..

# We need one thing from JDataComponent

rm -rf arlut/csd/JDataComponent
mkdir arlut/csd/JDataComponent

cd arlut/csd/JDataComponent
rm -f listHandle.class
ln -s $TARGETDIR/arlut/csd/JDataComponent/listHandle.class .
cd ../../..

# And we need the JDialog package for the serializable
# dialog objects

cd arlut/csd
rm -f JDialog
ln -s $TARGETDIR/arlut/csd/JDialog .
cd ../..

# we're in the server_classes directory

rm -f jcrypt.class
ln -s ../jcrypt.class .

rm -f Qsmtp.class
ln -s ../Qsmtp.class .

rm -f messageObject.class
ln -s ../messageObject.class .

rm -f MD5.class
ln -s ../MD5.class .

rm -f MD5InputStream.class
ln -s ../MD5InputStream.class .

rm -f MD5OutputStream.class
ln -s ../MD5OutputStream.class .

rm -f MD5State.class
ln -s ../MD5State.class .

rm -f MD5Crypt.class
ln -s ../MD5Crypt.class .

echo "Syncing main server tree"

./sync_tree

echo "Syncing gnu regexp subtree"

./sync_tree.gnu

echo "Syncing xml subtree"

rm -f com
ln -s ../com .

rm -f org
ln -s ../org .

$JAVADIR/jar -cf ../ganymedeServer.jar arlut gnu jcrypt.class Qsmtp.class messageObject.class MD5*.class com org

cd ..

echo "Done building server jar"

