#!/bin/sh -e
# script to automate building of 030_autotools patch file

upstream_version=0.4c

rm -f debian/patches/030_autotools
dbs-edit-patch 030_autotools

#fakeroot debian/rules clean
#debian/rules stampdir/patch
#cd build-tree
#cp -a heimdal-$upstream_version heimdal-$upstream_version-old

cd $TMP/030_autotools/heimdal-$upstream_version

cat <<EOF >> acinclude.m4
dnl Hack to allow old CVS version of autoconf to work.
define([m4_ifval],[ifval])dnl
EOF

aclocal -I cf
libtoolize -c -f
autoconf
autoheader
automake
# configure fails to call libtool properly - manually hack it so it works
# vim configure
#rm configure.bak
cd ..

#diff -ruN heimdal-$upstream_version-old heimdal-$upstream_version > ../debian/patches/030_autotools
#fakeroot debian/rules clean

./dbs-update-patch
