#!/bin/sh
#
# Ganymede server jar build script
#
# Version: $Revision: 1.21 $
# Date: $Date: 2002/03/16 03:09:34 $
#
############################################################

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 -rf jcrypt
mkdir jcrypt
cd jcrypt
ln -s ../../jcrypt/* .
cd ..

rm -rf Qsmtp
mkdir Qsmtp
cd Qsmtp
ln -s ../../Qsmtp/* .
cd ..

rm -rf md5
mkdir md5
cd md5
ln -s ../../md5/* .
cd ..

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 Qsmtp md5 com org

cd ..

echo "Done building server jar"

