#!/bin/bash

WEBDIR=/home/jm/ettext.taint.org
WEBMAKE=/home/jm/ftp/webmake

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/webmake )
make distcheck

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

rm -f Text-EtText-$vers.tar.gz Text-EtText-$vers.zip
make tardist
cp Text-EtText-$vers.tar.gz $WEBDIR/devel

make zipdist
cp Text-EtText-$vers.zip $WEBDIR/devel

echo $vers > $WEBDIR/latest_version

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

ls -l $WEBDIR/devel
