export CVS_RSH=ssh
export VN=0.46
export VER=klamav-$VN
export TAG=v0_46
cd ..
TOPDIR=$PWD
cd Releases
INSTALLDIR=$PWD
mkdir -p "$VER/First Install/klamav"
mkdir -p "$VER/First Install/$VER-installer"
mkdir -p "$VER/First Install/$VER-source"
mkdir -p "$VER/Source Update"

#create installer package
cd "$VER/First Install/klamav"
cvs -z3 -d:ext:hoganrobert@klamav.cvs.sourceforge.net:/cvsroot/klamav export -r $TAG klamav
mv klamav $VER
cd $VER
make -f Makefile.cvs
rm -rf autom4te.cache
cd ..
cp -R "$TOPDIR"/InstallStuff/* .
cp -R "$TOPDIR"/dazuko* .
cp -R "$TOPDIR"/arkollon* .
cd ..
makeself "$PWD"/klamav DoubleClickOrExecuteMeToInstallKlamaAV-$VN "KlamAV" ./install.sh
cp DoubleClickOrExecuteMeToInstallKlamaAV-$VN $VER-installer/
cp "$INSTALLDIR"/INSTALL $VER-installer
tar zcvf $VER-installer.tar.gz $VER-installer

#create source package
cd "$INSTALLDIR"
cd "$VER/First Install/$VER-source"
cp -R "$TOPDIR"/dazuko* .
cp -R ../klamav/$VER .
cp "$INSTALLDIR"/README .
cd ..
tar zcvf $VER-source.tar.gz $VER-source

#create source update package
cd "$INSTALLDIR"
cp -R ""$INSTALLDIR"/$VER/First Install/$VER-source/$VER" ""$INSTALLDIR"/$VER/Source Update/"
cd ""$VER"/Source Update"
tar jcvf $VER.tar.bz2 $VER