#! /bin/sh

# $Id: makedist 222 2011-12-02 10:43:23Z wsl $
# $URL: https://svn.fair.uvt.nl/branches/0.5/makedist $

set -e

fgrep -q 07a5df0c8272a05f39a554ecbdb80bc91f524099 makedist

tmp=$(mktemp -d)
trap 'chmod -R u+rwX -- "$tmp";rm -rf -- "$tmp"' EXIT INT

svn export . $tmp/svn
svn2cl -o $tmp/svn/ChangeLog

(
cd $tmp/svn

autoreconf -fsi
sh configure

make -s distcheck

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

mv -v "$tmp"/out/* .
