#!/bin/sh

# the directory above the source tree
parent=/home/cottrell/stats/esl

version=$(grep GRETL_VERSION[^_] ${parent}/gretl/lib/src/version.h | \
          awk '{ print $NF}' | sed s/[\"\;]//g)
versiondir=gretl-${version}	  
tarfile="${versiondir}.tar.bz2"

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

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

# make the archive and remove the dist dir
cd $parent 
echo "making archive..."
mv gretl ${versiondir}
rm -f $tarfile 
tar cvjfX $tarfile tar_exclude ${versiondir}
mv ${versiondir} gretl



