#!/bin/sh -e

PACKAGE=$(dpkg-parsechangelog -S Source)
VERSION=$2
DIR=${PACKAGE}-${VERSION}
TAR=../${PACKAGE}_${VERSION}.orig.tar.xz

svn export http://svn.svnkit.com/repos/3rdparty/de.regnis.q.sequence/tags/$VERSION $DIR
tar -c -J -f $TAR \
    --exclude '*.jar' \
    --exclude '.settings' \
    --exclude 'gradle' \
    --exclude 'gradlew*' \
    $DIR
rm -rf $DIR $3
