#!/bin/bash

WEBDIR=/home/jm/webmake.taint.org

vers=`build/get_version`

# delete old CVS files
find . -name '.#*' -print | xargs rm -f

make clean ; perl Makefile.PL ; make

echo "Building documentation..."
( cd doc ; ../webmake )
make distcheck

echo "Creating 'Changes' file from CVS change log..."
cvs2cl.pl -f Changes

rm -f HTML-WebMake-$vers.tar.gz HTML-WebMake-$vers.zip
make tardist
cp HTML-WebMake-$vers.tar.gz $WEBDIR/devel

make zipdist
cp HTML-WebMake-$vers.zip $WEBDIR/devel

echo $vers > $WEBDIR/latest_version

( cd $WEBDIR/devel ; cvs add *WebMake* )

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

ls -l $WEBDIR/devel

