#!/bin/bash # grep the spec file for version number VERSION=$( cat pybugz.spec | grep ^Version: | cut -d' ' -f 2- | tr -d ' ') BASE=pybugz-$VERSION TARBALL=$BASE.tar.gz DIR=$( mktemp -d ) GIT=https://github.com/williamh/pybugz.git REVISION=`echo $VERSION | sed 's/.*git//'` echo == preparing tarball for pybugz-$VERSION == pushd $DIR > /dev/null && \ git clone $GIT pybugz && \ cd pybugz && \ git archive --prefix pybugz-$VERSION/ $REVISION | gzip > $TARBALL && \ popd > /dev/null && \ cp $DIR/pybugz/$TARBALL . && \ echo == DONE == && \ rm -rf $DIR