#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
VERSION=$2
TAR=../libmiglayout-java_$VERSION.orig.tar.xz

# clean up the upstream tarball
unzip $3
XZ_OPT=--best tar -c -J -f $TAR miglayout-*
rm -rf miglayout-* $3

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