#!/bin/sh

PKGTAR=cryst-4.1.32.tar

# remove old archive
rm -f $PKGTAR*

# rebuild documentation
(cd .. && gap -A -q --quitonbreak makedoc.g)

# make the package archive
mkdir -p cryst/doc cryst/gap cryst/grp cryst/tst
grep -v svg ../README.md > cryst/README
cp -p ../*.g ../Changelog ../COPYING cryst/
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 cryst/doc/
cp -p ../gap/*.g[di] cryst/gap/
cp -p ../grp/spacegrp.* cryst/grp/
cp -p ../tst/*.tst ../tst/testall.g cryst/tst/
chmod -R a+rX cryst
tar cvf $PKGTAR cryst
chmod a+r $PKGTAR
gzip $PKGTAR

# cleanup
rm -rf cryst
