#!/bin/sh

PKGTAR=crystcat-1.1.13.tar

# remove old archive
rm -f $PKGTAR*

# update documentation
(cd .. && gap -A -q --quitonbreak -c 'Read("makedoc.g" : relativePath:="../../..");')

# make the package archive
mkdir -p crystcat/doc crystcat/lib crystcat/grp crystcat/tst
cp -p ../*.g ../Changelog ../GPL crystcat/
tail +4 ../README.md > crystcat/README
cp -p ../doc/*.xml ../doc/*.bib ../doc/*.css ../doc/*.js \
  ../doc/chap*.html ../doc/chap*.txt ../doc/chooser.html \
  ../doc/manual.lab ../doc/manual.six ../doc/manual.pdf crystcat/doc/
cp -p ../lib/*.g[di] crystcat/lib/
cp -p ../grp/crystcat.grp crystcat/grp/
cp -p ../tst/*.tst ../tst/testall.g crystcat/tst/
chmod -R a+rX crystcat
tar cvf $PKGTAR crystcat
chmod a+r $PKGTAR
gzip $PKGTAR

# cleanup
rm -rf crystcat
