#!/bin/sh

parent=/home/cottrell/stats/esl
WWW='allin@gretl.sourceforge.net:~/www/'

version=$(cat ${parent}/gretl/lib/src/version.h | grep version_ | \
     awk '{ print $NF}' | sed s/[\"\;]//g)
tarfile="gretl-${version}.tar.bz2"
topdir=/home/cottrell/stats/esl/gretl

echo "making dist file for gretl $version using filename $tarfile"

# make time stamp
cd ${topdir} && date > share/gretl.stamp

# make the archive and remove the dist dir
cd $parent 
echo "making archive..."
for f in `find gretl/gui -type l` ; do
   rm $f
done
mv gretl gretl-${version}
rm -f $tarfile 
tar cvjfX $tarfile tar_exclude gretl-${version}
mv gretl-${version} gretl

# scp gretl/doc/manual.pdf allin@gretl.sourceforge.net:~/www/
# scp gretl/doc/manual-a4.pdf allin@gretl.sourceforge.net:~/www/
# scp gretl/ChangeLog allin@gretl.sourceforge.net:~/www/


