#!/bin/sh -e

# $2 = version, $3 = file
TAR=../libjboss-cache3-java_$2.orig.tar.gz
SVN=http://anonsvn.jboss.org/repos/jbosscache/core/tags/
DIR=jbosscache-core-$2
TAG=$2

svn export $SVN/$TAG $DIR
tar -c -z -f $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR ../$2

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