From: Jakub Narebski Date: Fri, 22 Jun 2007 21:39:42 +0000 (+0200) Subject: Simplify naming (versioning) of non-release tig tarball and rpm file X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=276346b0d0f2797e971dcca8f4912dc78dc3ff87;p=tig.git Simplify naming (versioning) of non-release tig tarball and rpm file Use the tag part of git-describe output, with `tig-' prefix stripped off, as version number. Use number of commits since given tag as release number, using 0 if we are at tagged version, and adding '.dirty' suffix if working directory is dirty. Do not use 'g' part of git-describe output. For example, when git-describe output was tig-0.7-8-g26d0386, before this commit tarball was named tig-0.7.8.g26d0386.tar.gz and rpm was named tig-0.7.8.g26d0386-1.src.rpm (for dirty tree tarball was tig-0.7.8.g26d0386.dirty.tar.gz), now tarball is named tig-0.7-8.tar.gz and rpm is named tig-0.7-8.src.rpm (for dirty tree tarball is tig-0.7-8.dirty.tar.gz). [ Simplify the version extraction a bit. --jonas ] Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca --- diff --git a/Makefile b/Makefile index 4caba6c..ba42a90 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,11 @@ ifdef DIST_VERSION VERSION = $(DIST_VERSION) endif -RPM_VERSION = $(subst -,.,$(VERSION)) +# Split the version "TAG-OFFSET-gSHA1-DIRTY" into "TAG OFFSET" +# and append 0 as a fallback offset for "exact" tagged versions. +RPM_VERLIST = $(filter-out g% dirty,$(subst -, ,$(VERSION))) 0 +RPM_VERSION = $(word 1,$(RPM_VERLIST)) +RPM_RELEASE = $(word 2,$(RPM_VERLIST))$(if $(WTDIRTY),.dirty) LDLIBS = -lcurses CFLAGS = -Wall -O2 @@ -26,7 +30,7 @@ PROGS = tig MANDOC = tig.1 tigrc.5 HTMLDOC = tig.1.html tigrc.5.html manual.html README.html ALLDOC = $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf -TARNAME = tig-$(RPM_VERSION) +TARNAME = tig-$(RPM_VERSION)-$(RPM_RELEASE) override CFLAGS += '-DVERSION="$(VERSION)"' @@ -106,7 +110,8 @@ release-dist: release-doc install-doc-man install-doc-html clean spell-check dist rpm tig.spec: contrib/tig.spec.in - sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@ + sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' \ + -e 's/@@RELEASE@@/$(RPM_RELEASE)/g' < $< > $@ tig: tig.c diff --git a/contrib/tig.spec.in b/contrib/tig.spec.in index d613870..9a75a8f 100644 --- a/contrib/tig.spec.in +++ b/contrib/tig.spec.in @@ -4,7 +4,7 @@ Summary: Tig: text-mode interface for git Name: tig Version: @@VERSION@@ -Release: 1%{?dist} +Release: @@RELEASE@@%{?dist} License: GPL Group: Development/Tools Vendor: Jonas Fonseca