#!/bin/sh

PREFIX=`dirname $0`
PREFIX=`cd "$PREFIX/.." ; pwd`
SUBDIR=`basename $PREFIX`

ARCHNAME=${SUBDIR}.tar.gz

RUNDIR=`pwd`

cd $PREFIX/.. || exit 1

PREFIX_BASE=`basename $PREFIX`

tar cvzf $ARCHNAME --exclude='*.svn'  \
                   --exclude='*.git'  \
                   --exclude='.*.swp' \
                   --exclude='build' \
                   --exclude='arch' \
                   --exclude=$ARCHNAME \
                   $PREFIX_BASE

mv $ARCHNAME $RUNDIR

cd $RUNDIR

