#!/bin/sh -e

# $1 = version
TAR=../libjboss-vfs-java_$2.orig.tar.gz
DIR=libjboss-vfs-java-$2.orig
TAG=$(echo $2 | sed -e 's/~/./')

# clean up the upstream tarball
svn export http://anonsvn.jboss.org/repos/jbossas/projects/vfs/tags/$TAG $DIR
GZIP=--best tar -c -z -f $TAR $DIR
rm -rf $DIR
rm ../$TAG

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