#!/bin/sh -e

VERSION=$2
TAR=../animal-sniffer_$VERSION.orig.tar.xz
DIR=animal-sniffer-$VERSION
TAG=animal-sniffer-parent-$VERSION

svn export https://svn.codehaus.org/mojo/tags/$TAG $DIR
XZ_OPT=--best tar -c -J -f $TAR --exclude '*.jar' $DIR
rm -rf $DIR ../$TAG $3

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