summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1b48a10)
raw | patch | inline | side by side (parent: 1b48a10)
author | Jakub Narebski <jnareb@gmail.com> | |
Fri, 22 Jun 2007 21:39:42 +0000 (23:39 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 22 Jun 2007 22:18:30 +0000 (00:18 +0200) |
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<sha 1>'
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 <jnareb@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
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<sha 1>'
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 <jnareb@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Makefile | patch | blob | history | |
contrib/tig.spec.in | patch | blob | history |
diff --git a/Makefile b/Makefile
index 4caba6c3922b7999be056180c43a6d6e98099562..ba42a900748c9355a7d0ce524933dcea9123c763 100644 (file)
--- a/Makefile
+++ b/Makefile
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
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)"'
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 d613870a8462320bca1b8e91a49e708b54f4d47a..9a75a8f5923dc57ad27065a3928cc4c3fb7c4561 100644 (file)
--- a/contrib/tig.spec.in
+++ b/contrib/tig.spec.in
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 <fonseca@diku.dk>