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