#!/bin/sh -e

VERSION=$2
TAR=../surefire_$VERSION.orig.tar.xz
DIR=surefire-$VERSION
TAG=$(echo surefire-$VERSION | sed s/~RC/-RC/ )

rm $3

git clone http://git.apache.org/maven-surefire.git $DIR
cd $DIR
git checkout tags/$TAG
cd ..
rm -Rf $DIR/.git

XZ_OPT=--best tar -c -J -f $TAR $DIR
rm -rf $DIR ../$TAG
