#!/bin/sh

VERSION=$2
XPI=$3
PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
TAR=../${PACKAGE}_${VERSION}.orig.tar.gz
DIR=../${PACKAGE}-${VERSION}

/usr/bin/xpi-unpack $XPI $DIR

tar -zcf ../${PACKAGE}_${VERSION}+dfsg.orig.tar.gz --exclude *.exe $DIR

rm -rf $DIR
rm $XPI

