#!/bin/sh
PKGS=`cat /etc/party.conf | awk '{printf "%s ", $1;}'`
while [ -n "$1" ] ; do
case "$1" in
--clean) CLEAN=1 ;;
--conf) CONF=1 ;;
--noinst) NONIST=1 ;;
--from-club) FROMCLUB=$2 ; shift ;;
--to-club) TOCLUB=$2 ; shift ;;
--add-club) EXTRA="$EXTRA $2" ; shift ;;
--skip-club) SKIP="$SKIP $2" ; shift ;;
--bounce) PKGS= ;;
--xerces) XERCESCROOT=$2 ; shift ;;
--sdu) EXTRA="SDU UWS $EXTRA" ;;
--raw) PARAMS="$PARAMS $2" ; shift ;;
*) echo "Don't know $1" ; exit 1 ;;
esac
shift
done
if [ -z "$XERCESCROOT" ] ; then
for cand in `tcsh -c "echo ~root/xer*"` ; do
XERCESCROOT=$cand
export XERCESCROOT
break
done
fi
for pkg in $PKGS $EXTRA ; do
if [ ! -d "$pkg" ]; then
continue
fi
if [ -n "$FROMCLUB" ] && [ "$FROMCLUB" != "$pkg" ] ; then
continue
fi
FROMCLUB=
FLAG=1
for s in $SKIP ; do
if [ "$s" = "$pkg" ] ; then
FLAG=
break
fi
done
if [ -z "$FLAG" ] ; then
continue
fi
cd $pkg || continue
if [ -n "$CONF" ] ; then
if [ -f "acsite.m4" ] ; then
/bin/rm -f acsite.m4
ln -s ../acsite.m4 .
fi
/bin/rm -f config.log config.cache
CLEAN=1
autogc
aclocal
/bin/rm -f configure Makefile.in
automake --foreign -a -c
autoconf
./configure --with-gnu --with-defaults $PARAMS
fi
if [ -n "$CLEAN" ] ; then
make clean
fi
make || exit 1
if [ -z "$NOINST" ] ; then
make install || exit 1
fi
cd ..
if [ -n "$TOCLUB" ] && [ "$TOCLUB" = "$pkg" ] ; then
exit
fi
done