#!/bin/sh -e

# $2 = version
# $3 = file
DIR=jasperreports-$2.orig
TAR=jasperreports_$2+dfsg.orig.tar.gz

# clean up the upstream tarball
tar zxf $3
mv jasperreports* $DIR
GZIP=--best tar czf $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR

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