#!/bin/sh -e

VERSION=$2
TAR=../java-comment-preprocessor_$VERSION.orig.tar.xz
DIR=$VERSION

mkdir $DIR
tar zxf $3 -C $DIR
rm -f $3
XZ_OPT=--best tar cJf $TAR \
	--exclude '*.jar' \
	--exclude '*.class' \
	--exclude 'texts' \
	--exclude 'catalog.xml' \
	--exclude 'src/assemble' \
	--exclude '.hg*' \
	$DIR
rm -rf $DIR
