#!/bin/sh -e

VERSION=$2
PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
TARBALL=../${PACKAGE}_${VERSION}.orig.tar.gz
DIR=${PACKAGE}-${VERSION}
TAG=$(echo ${VERSION} | sed -e's,\.,_,g')

## objenesis-${VERSION}-bin.zip contains objenesis-${VERSION}-sources.jar
svn export http://objenesis.googlecode.com/svn/tags/${TAG} ${DIR}
tar -zcvf $TARBALL $DIR
rm -rf $DIR ../$VERSION
