#!/bin/sh -e

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

# clean up the upstream tarball
svn export http://anonsvn.jboss.org/repos/jbossremoting/remoting2/tags/$TAG $DIR
GZIP=--best tar -c -z -f $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR $TAG

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