#!/bin/sh -e

VERSION=$2
DIR=jogl-v$VERSION
TAR=libjogl2-java_$VERSION.orig.tar.bz2

# clean up the upstream tarball
p7zip -d $3
tar xvf jogl-v$VERSION.tar
cd $DIR*
rm -rf .gitignore .htaccess make/lib/ www/
cd ..
tar jcvf ../$TAR $DIR
rm -rf $DIR jogl-v$VERSION.tar

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
    . .svn/deb-layout
    mv $TAR $origDir
    echo "moved $TAR to $origDir"
fi

exit 0
