#!/bin/bash -e

PORTFILE="packaging/macports/Portfile"

VERSION=`head -n1 packaging/debian/changelog | sed 's/.*(\([^-]*\)-.*/\1/'`
MD5=`md5sum monkeysphere_${VERSION}.orig.tar.gz | awk '{ print $1 }'`

sed -i~ 's/^version.*$/version             '"$VERSION"/ "$PORTFILE"
sed -i~ 's/^checksums.*$/checksums           md5 '"$MD5"/ "$PORTFILE"