#!/bin/sh

# called by uscan with '--upstream-version' <version> <file>
DIR=jettison-$2
TAR=../libjettison-java_$2.orig.tar.gz
FILE=jettison-$2-sources.jar

# clean up the upstream tarball
wget http://repository.codehaus.org/org/codehaus/jettison/jettison/$2/$FILE
mkdir $DIR
(cd $DIR && jar xf ../$FILE)
tar -c -z -f $TAR $DIR
rm -rf $DIR ../$2 $FILE

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

