commit 482c0f775e2e10e43bd7cca9905f40d9002419ea Author: Daniel Berteaud Date: Sun Mar 11 21:36:30 2012 +0100 tag version diff --git a/buildsrpm b/buildsrpm new file mode 100755 index 0000000..4ca07ab --- /dev/null +++ b/buildsrpm @@ -0,0 +1,13 @@ +#!/bin/bash + +PACKAGE=$(basename $(pwd)) +VERSION=$(rpm -q --qf "%{version}" --specfile $PACKAGE.spec) + +if [ \! -e ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz ]; then + BRANCH=$(git branch | grep '*' | cut -d' ' -f2) + git tag $VERSION + git archive --format=tar.gz -o ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz $BRANCH +fi +rpmbuild -bs $PACKAGE.spec +rm -f ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz +