#!/bin/sh
# Quick and dirty hack to create a .orig.tar.gz for udev to be used with dpkg-source
# TODO: integrate it in hg-buildpackage
if [ "${1}x" = "x" ]; then
	echo "Please specify a version number (e.g. 070)"
	exit
fi

UDEV_URL="http://www.ch.kernel.org/pub/linux/utils/kernel/hotplug/udev-${1}.tar.bz2"
TMPDIR="/tmp/udev-tmp/"
ORIG="udev_0.${1}.orig"
SRCDIR="${TMPDIR}/${ORIG}/upstream/tarballs"
TARBALL="${PWD}/../${ORIG}.tar.gz"

[ -d ${SRCDIR} ] || mkdir -p ${SRCDIR}
cd ${SRCDIR}

wget ${UDEV_URL}

cd ${TMPDIR}

tar czfv ${TARBALL} ${ORIG}
echo "orig.tar.gz is at ${TARBALL}"

rm -rf ${TMPDIR}

exit
