#!/bin/sh -e

VERSION=$2
TAR=../jackrabbit_$VERSION.orig.tar.gz
DIR=jackrabbit-$VERSION
TAG=$(echo "$VERSION" | sed -re's/~(alpha|beta)/-\1-/')

svn export http://svn.apache.org/repos/asf/jackrabbit/tags/${TAG}/ $DIR
GZIP=--best tar -c -z -f $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR
