#!/bin/sh

VERSION_AUTOTOOLS=`head configure.ac |grep AC_INIT | sed -re 's/.+\[([0-9]+[^]]+)\].+/\1/'`
VERSION_DEB=`head -n 1 debian/changelog  | sed -re 's/.+\(([^-]+).+/\1/'`
VERSION_DEBFULL=`head -n 1 debian/changelog  | sed -re 's/.+\((.+)\).+/\1/'`
VERSION="$VERSION_SRC"

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

echo "$VERSION_AUTOTOOLS"
exit 0
