#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
TAR=../liblastfm-java_$2.orig.tar.gz
DIR=liblastfm-java-$2.orig

# clean up the upstream tarball
mkdir $DIR
(cd $DIR; unzip ../$3)
GZIP=--best tar -c -z -f $TAR --exclude '*.jar' --exclude 'doc*' $DIR
rm -rf $3 $DIR

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