#!/bin/sh -e
# See http://jdebp.uk./FGA/slashpackage.html
if test \! -d package || test \! -d source
then
	echo "You are not in the right directory." 1>&2
	exit 100
fi
cwd="`/bin/pwd`"
base_plus_version="`basename "${cwd}"`"
case "`uname`" in
Linux)	ext=bz2 ; opt=-j ;;
*BSD)	ext=gz  ; opt=-z ;;
esac
pax -w ${opt} > "${base_plus_version}.tar.${ext}.new" source package
mv "${base_plus_version}.tar.${ext}.new" "${base_plus_version}.tar.${ext}"
