#!/bin/sh

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

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

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

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

# make the distribution archive
cd $parent 
echo "making archive..."
mv gretl-git ${versiondir}
rm -f $tarfile
tar cvJfX $tarfile tar_exclude ${versiondir}
mv ${versiondir} gretl-git

