#!/bin/sh
VERSION_AUTOTOOLS=$(grep ^AC_INIT configure.ac | sed -r 's/[^[]+\[([^]]+)\].+/\1/')
VERSION_DEB=`head -n 1 debian/changelog  | sed -re 's/.+\(([^)]+).+/\1/'`
VERSION="$VERSION_AUTOTOOLS"

if [ "$VERSION_AUTOTOOLS" != "$VERSION_DEB" ]
then
	echo "Version mismatch between autotools ($VERSION_AUTOTOOLS) and debian/changelog ($VERSION_DEB)" >&2
	exit 1
fi

exit 0
