#!/bin/sh

VERSION=$2
TAR=../libjna-java_$VERSION.orig.tar.xz
DIR=jna-$VERSION

tar -xf $3
rm $3

XZ_OPT=--best tar -c -J -v -f $TAR \
    --exclude '*.jar' \
    --exclude 'native/libffi' \
    --exclude '.gitignore' \
    --exclude '.classpath' \
    --exclude '.project' \
    --exclude '.settings' \
    --exclude '.travis.yml' \
    --exclude 'www/*' \
    --exclude 'dist/*' \
    --exclude 'w32ce-test.lnk' \
    $DIR

rm -Rf $DIR
