#!/bin/sh
#
# Builds up the tar archives ready for distribution.
#
# It:
#	o Cleans the directories of unwanted files
#	o Builds .gz and .bz2 archives
#
VERSION=`PYTHONPATH=lib/python python -c 'import Config,string
print string.split(str(Config.version))[0]'`
echo "Building LHEx archives, release version $VERSION."
echo "--"
echo -n "Cleaning source directories...."
support/cleandist
echo "done."
echo -n "Building source archive...."
cd ..
tar -c -f LHEx-$VERSION.tar LHEx
echo "done."
echo -n "Compressing archive...."
gzip -c -9 LHEx-$VERSION.tar > LHEx-$VERSION.tar.gz
echo -n "half-done.."
bzip2 -c -9 LHEx-$VERSION.tar > LHEx-$VERSION.tar.bz2
echo "done."
echo "LHEx archives are complete:"
ls -l LHEx-$VERSION.tar*
echo -n "Removing uncompressed source archive...."
rm LHEx-$VERSION.tar
echo "done."
# End.
