#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
TAR=javacc_$2.orig.tar.gz
DIR=javacc-$2.orig

# clean up the upstream tarball
tar xzf $3
mv javacc $DIR
tar -czf $TAR --exclude 'junit.jar' $DIR
rm -rf $3 $DIR
mv $TAR ..

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