#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
VERSION=$2
TAR=../joda-convert_$VERSION.orig.tar.gz
DIR=joda-convert-$VERSION

# clean up the upstream tarball
tar -zxf $3
GZIP=--best tar -zcvf $TAR --exclude '*.jar' $DIR
rm -rf $DIR

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
    . .svn/deb-layout
    mv $TAR $origDir
    echo "moved $TAR to $origDir"
fi
