#!/bin/sh

PKGTAR=cryst-4.1.31.tar

# remove old archive
rm -f $PKGTAR*

# rebuild documentation
(cd ../doc; ./make_doc;)

# make the package archive
mkdir -p cryst/doc cryst/gap cryst/grp cryst/htm cryst/tst
grep -v svg ../README.md > cryst/README
cp -p ../*.g ../Changelog ../COPYING cryst/
cp -p ../doc/manual.bbl ../doc/manual.six ../doc/manual.lab ../doc/manual.toc \
  ../doc/manual.mst ../doc/manual.pdf ../doc/*.tex ../doc/make_doc cryst/doc/
cp -p ../gap/*.g[di] cryst/gap/
cp -p ../grp/spacegrp.* cryst/grp/
cp -p ../tst/*.tst ../tst/testall.g cryst/tst/
cp -p ../htm/*.htm cryst/htm/
chmod -R a+rX cryst
tar cvf $PKGTAR cryst
chmod a+r $PKGTAR
gzip $PKGTAR

# cleanup
rm -rf cryst
