From 482c0f775e2e10e43bd7cca9905f40d9002419ea Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 11 Mar 2012 21:36:30 +0100 Subject: [PATCH] tag version --- buildsrpm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 buildsrpm 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 +