#!/bin/sh
# Make a hyperbole distribution

# Copyright (C) 2006  Free Software Foundation, Inc.
#
# This file is part of Hyperbole
#
# Hyperbole is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Hyperbole is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Hyperbole; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

# Usage; make-dist version
#
# Description: Requires a corresponding tag. version=X.Y.Z tag=X_Y_Z

echo "Create a Hyperbole dist ..."

VERSION=$1

if [ "$1" = "HEAD" ]
then
    TAG=$1
else
    TAG=hypb-`echo $VERSION | sed 's/\./_/g'`
fi
HYPERBOLE=hyperbole-$VERSION
DIST=DIST-$HYPERBOLE

# Get the source ...
mkdir $DIST
cd $DIST
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hyperbole export -r $TAG -d $HYPERBOLE hyperbole

# Configure ,,,
cd $HYPERBOLE
aclocal
automake --add-missing --copy
autoconf

# Package ...
cd ..
tar -cvzf $HYPERBOLE.tar.gz $HYPERBOLE

# Sign
gpg -b $HYPERBOLE.tar.gz
gpg --clearsign $HYPERBOLE.tar.gz
