#! /bin/sh
#
# Run this script.  This will generate a tarball in the parent
# directory (..).  
#

quit() {
   echo $@
   exit 1  
}
PACKAGE=sitecustomize
VERSION=`python -c 'import setup; print setup.VERSION'`
VPACKAGE=$PACKAGE-$VERSION
SVN=http://dev.zenoss.org/svn
SVNTRUNK=$SVN/trunk/$PACKAGE
SVNTAG=$SVN/tags/$VPACKAGE
svn cp -m"making release $VERSION" $SVNTRUNK $SVNTAG || quit cannot create tag
svn export $SVNTAG /tmp/$VPACKAGE || quit cannot create export tree
OLD=`pwd`
( 
  cd /tmp
  tar -czvf $OLD/../$VPACKAGE.tar.gz $VPACKAGE
  rm -rf $VPACKAGE
) || quit cannot create tarball
echo "Remember to move ../$VPACKAGE.tar.gz the Zenoss "
echo "inst/externallibs directory and check it in."
exit 0
