#!/bin/sh -e

VERSION=$2
TAR=../libjasper-java_$VERSION.orig.tar.gz
DIR=libjasper-java-$VERSION
TAG=$(echo "TOMCAT_$VERSION" | sed -re's,\.,_,g')

svn export http://svn.apache.org/repos/asf/tomcat/tc5.5.x/tags/${TAG}/jasper $DIR
tar -c -z -f $TAR $DIR
rm -rf $DIR ../$TAG

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