#!/bin/sh

REL=$(./version)
TAG="R"`echo $REL | tr -d .`"$2"

echo "Exporting release $REL (tag $TAG)"

rm -rf /var/tmp/fidogate-$REL
rm -rf /var/tmp/fidogate-*$REL.tar*

cd /var/tmp

cvs -d :ext:n0ll@cvs.fidogate.sourceforge.net:/cvsroot/fidogate \
    export -r $TAG -d fidogate-$REL fidogate || exit 1;

tar cvf fidogate-test-$REL.tar fidogate-$REL/test/
rm -rf fidogate-$REL/test
tar cvf fidogate-$REL.tar fidogate-$REL/
gzip -v9 fidogate-*.tar
