COMPSRPM=comps.rpm
WHERE=`pwd`
W1up=`dirname $WHERE`
W2up=`dirname $W1up`
W3up=`dirname $W2up`
BASEDIR=`dirname $W3up`
if [ -f  $WHERE/$COMPSRPM ] ; then
   BASEDIR=$WHERE
else
   if [ -f  $W1up/$COMPSRPM ] ; then
        BASEDIR=$W1up
   else
   	echo "Could not find $COMPSRPM"
	exit
   fi
fi
. $BASEDIR/scripts/locations.include
echo "making new comps.rpm"
rpmbuild -ba --quiet $BASEDIR/scripts/comps.spec
cp $BASEDIR/comps.rpm $BASEDIR/oldcomps/comps.rpm
DATE=`date +"%Y%m%d"`
cp -v /usr/src/redhat/RPMS/$ARCH/comps-$DEFAULT*$VERSION-0.$DATE.$ARCH.rpm $BASEDIR/comps.rpm
