#! /bin/sh

# This simple script is called from the upstream makefile whenever someone
# calls "make deb".  It adds a changelog entry to the top of debian/changelog
# so that the version number is correct.

VERSION=`cat base/internal_version.h | grep SCUMMVM_VERSION | cut -d\" -f2`-`date +%Y%m%d`
USERNAME=`whoami`
GECOS=`getent passwd $USERNAME | awk '-F[,:]' '{print $5}'`
DOMAIN=`hostname --fqdn`
DATE=`date -R`

head -1 debian/changelog | grep -qF $VERSION && exit 0

TMP=`tempfile`

cat debian/changelog > $TMP

cat << __eof > debian/changelog
residualvm ($VERSION) experimental; urgency=low

  * GIT snapshot.

    Build-date: $DATE

    Please don't file bugs you find in this package in the Debian Bug Tracking
    system, use the ResidualVM team's own bug tracker instead.  You can find this
    tracker at <https://www.github.com/residualvm/residualvm/issues>.

 -- Pawel Kolodziejski <aquadran@residualvm.org>  $DATE

__eof

cat $TMP >> debian/changelog
rm -f $TMP
