#!/bin/sh

DEB_VERSION=$(head -1 debian/changelog | sed -re 's/[^(]+\(([^)]+)\).+/\1/')
DEB_UPSTREAM_VERSION=$(echo $DEB_VERSION | sed -r 's/-.+//')
CMAKE_VERSION=$(grep '^set( *EPT_VERSION' CMakeLists.txt |sed -r 's/.+"([^"]+)".+/\1/')

if [ "$DEB_UPSTREAM_VERSION" != "$CMAKE_VERSION" ]
then
	echo "Version mismatch between ($DEB_UPSTREAM_VERSION) and CMakeLists.txt ($CMAKE_VERSION)" >&2
	exit 1
fi

#echo $DEB_VERSION
#echo $CMAKE_VERSION

exit 0
