#! /bin/sh

# $Id: makedist 25869 2008-10-14 10:02:42Z joostvb $
# $URL: https://infix.uvt.nl/its-id/trunk/sources/zip-fetch/makedist $

# Don't call this script directly, but call ./bootstrap.
#
# Usage:
#
#  % svn export . /tmp/src
#  % sh ./makedist /tmp/

set -ex

cd "$1/src"

#
#  aclocal
#  autoconf
#  automake --add-missing
#
# or
#
#  AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf --install \
#       --symlink --make
#
# or
#
#  autoreconf --install --symlink --make
#

autoreconf --install --symlink

sh configure
make -s distcheck

echo print-archives: >>Makefile
echo '	@echo $(DIST_ARCHIVES)' >>Makefile
mv $(make -s print-archives) "$1/"

cd "$1"

rm -rf src

