#!/bin/sh
set -e

VERSION=$2
DIR=libparanamer-java-${VERSION}
TAR=../libparanamer-java_${VERSION}.orig.tar.xz

mkdir $DIR
tar -xf $3 --strip-components=1 -C $DIR
rm $3
XZ_OPT=--best tar -c -v -J -f $TAR \
    --exclude '*.svnignore' \
    --exclude 'show_ads.js' \
    --exclude 'paranamer/src/resources/javadocs/*' \
    $DIR
rm -Rf $DIR
