| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# find the directory above the gretl source tree |
| 4 |
thisdir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) |
| 5 |
parent="$(dirname "$thisdir")" |
| 6 |
srcdir="$(realpath "$parent")" |
| 7 |
target="$(dirname "$srcdir")" |
| 8 |
echo "gretl source directory: $srcdir" |
| 9 |
echo "target dir for tarfile: $target" |
| 10 |
|
| 11 |
version=$(grep GRETL_VERSION[^_] ${srcdir}/lib/src/version.h | \ |
| 12 |
awk '{ print $NF}' | sed s/[\"\;]//g) |
| 13 |
versiondir=gretl-${version} |
| 14 |
tarfile="${versiondir}.tar.xz" |
| 15 |
|
| 16 |
echo "making dist file for gretl $version using filename $tarfile" |
| 17 |
|
| 18 |
# make the distribution archive |
| 19 |
cd $target |
| 20 |
echo "making archive..." |
| 21 |
|
| 22 |
# copy across pre-built helpfiles |
| 23 |
cp gretl-git/build/doc/commands/gretl_*ref.* gretl-git/share |
| 24 |
cp gretl-git/build/doc/commands/gretlhelp.refs gretl-git/share |
| 25 |
mv gretl-git ${versiondir} |
| 26 |
rm -f ${tarfile} |
| 27 |
tar cvJfX $tarfile tar_exclude ${versiondir} |
| 28 |
|
| 29 |
# restore local git tree |
| 30 |
mv ${versiondir} gretl-git |
| 31 |
# remove pre-built helpfiles from git area |
| 32 |
rm -f ${srcdir}/share/gretl_*ref.* |
| 33 |
rm -f ${srcdir}/share/gretlhelp.refs |
| 34 |
|