#!/bin/sh 

# called with '--upstream-version' <version> <file>
VERSION=$2
TAR=../cdi-api_$VERSION.orig.tar.gz
DIR=cdi-api-$VERSION

mkdir -p $DIR/src/
(cd $DIR/src/ && echo `pwd` && jar xvf ../../$3)

GZIP=--best tar -c -z -f $TAR --exclude '*.jar' --exclude '*.class' $DIR
rm -rf $DIR $3
