#!/bin/sh -e

# $1 = version
DIR=liblaf-plugin-java-$1
ZIP=laf-plugin-all.zip
TAR=../liblaf-plugin-java_$1.orig.tar.gz

# Download the sources
wget https://laf-plugin.dev.java.net/files/documents/4261/50297/$ZIP

# clean up the upstream tarball
unzip -d $DIR $ZIP
tar -c -z -f $TAR $DIR
rm -rf $DIR $ZIP

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

exit 0
