#!/bin/sh -e

# $2 version
# $3 original tarball
ZIP=$3
TAR=../uimaj_$2.orig.tar.xz
DIR=uimaj-$2

# clean up the upstream tarball
unzip $ZIP
XZ_OPT=--best tar -c -J -f $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR
rm $3

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

exit 0

