#!/bin/bash

WEBDIR=$HOME/spamassassin.taint.org

vers=`build/get_version`

build/update_devel

# build/mkrpm

rm -rf $WEBDIR/doc
tar cf - --exclude=CVS --exclude='.#*' doc | ( cd $WEBDIR ; tar xf - )

for ext in tar.bz2 tar.gz zip ; do
  cp $WEBDIR/devel/Mail-SpamAssassin-$vers.$ext.asc \
	$WEBDIR/released/Mail-SpamAssassin-$vers.$ext.asc
  cp $WEBDIR/devel/Mail-SpamAssassin-$vers.$ext.md5 \
	$WEBDIR/released/Mail-SpamAssassin-$vers.$ext.md5
  cp $WEBDIR/devel/Mail-SpamAssassin-$vers.$ext.sha1 \
	$WEBDIR/released/Mail-SpamAssassin-$vers.$ext.sha1

  cp $WEBDIR/devel/Mail-SpamAssassin-$vers.$ext \
	$WEBDIR/released/Mail-SpamAssassin-$vers.$ext

  # gpgsign=$HOME/bin/gpgsign
  # rm -f Mail-SpamAssassin-$vers.$ext.asc
  # $gpgsign Mail-SpamAssassin-$vers.$ext
  # mv Mail-SpamAssassin-$vers.$ext.asc $WEBDIR/released/Mail-SpamAssassin-$vers.$ext.asc
done


# cp WebMake-${vers}-1.noarch.rpm WebMake-${vers}-1.src.rpm $WEBDIR/released
( cd $WEBDIR/released && cvs add -kb *SpamAssassin* )

echo "md5sum of archive files:"
cat $WEBDIR/released/Mail-SpamAssassin-$vers.tar.gz.md5 \
 $WEBDIR/released/Mail-SpamAssassin-$vers.tar.bz2.md5 \
 $WEBDIR/released/Mail-SpamAssassin-$vers.zip.md5

echo "sha1sum of archive files:"
cat $WEBDIR/released/Mail-SpamAssassin-$vers.tar.gz.sha1 \
 $WEBDIR/released/Mail-SpamAssassin-$vers.tar.bz2.sha1 \
 $WEBDIR/released/Mail-SpamAssassin-$vers.zip.sha1

