#!/bin/sh
# Creates a recent tarball.
# Assumes that the directory name is xaos-code/tools where we currently are.
# Be careful: this script will delete files without asking questions!

NAME=xaos-`cat ../configure.in | grep AC_INIT | cut -f2 -d, | sed s/"\["// | sed s/"\]"//`

test -x tarball || exit 1 # Sorry, this script should be run inside its directory.

./mkChangeLog
cd ..
autoconf
./configure
cd doc
make clean
make
cd ../help
make clean
make
cd ..
make clean
make distclean
rm -fR autom4te.cache
cd ..
rm -fR /tmp/xaos /tmp/$NAME /tmp/$NAME.tar.gz
cp -a xaos-code /tmp
cd /tmp
mv xaos-code $NAME
cd $NAME
find -name .svn | xargs rm -fR
cd ..
tar czf $NAME.tar.gz $NAME
