#!/bin/sh

HELP='Need arguments: <target> <version>'
if [ -z "$1" ];then
	echo $HELP
	exit
fi
if [ -z "$2" ];then
	echo $HELP
	exit
fi
TARGET=`basename "$1"`
VERSION=$2
DIR=${TARGET}-${VERSION}
PACK=${DIR}.tar.gz
ln -s $1 ${DIR}

echo ${PACK}
tar -czhvv --exclude='.*' --exclude="${DIR}/debian" -f "${PACK}" "${DIR}"
rm ${DIR}
echo Done to: ${PACK}

