diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-18 17:45:50 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-22 02:47:37 +0200 |
commit | c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb (patch) | |
tree | 93ab3249dc521b846909a0fc763fd32c904331c8 | |
parent | cbd66b13b12d841f25711893709f19fb7905e6b3 (diff) | |
download | calcurse-c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb.zip |
Add Git version string support.
Introduce a script to auto-generate version strings. Use `git describe`
to create descriptive version strings when building from a Git checkout,
use ".version" files for release tarballs.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rwxr-xr-x | build-aux/git-version-gen | 24 | ||||
-rw-r--r-- | configure.ac | 4 |
4 files changed, 32 insertions, 1 deletions
@@ -11,6 +11,7 @@ depcomp install-sh missing stamp-h1 +.version autom4te.cache/ m4/ diff --git a/Makefile.am b/Makefile.am index b37844b..3052b72 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,3 +7,7 @@ SUBDIRS = doc po src EXTRA_DIST = \ INSTALL \ ABOUT-NLS + +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen new file mode 100755 index 0000000..2cc88fc --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ "$#" -ne 1 ] +then + echo "usage: git-version-gen <verfile>" >&2 + exit 1 +fi + +VERFILE="$1" + +if [ -d '.git' ] +then + VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty | sed 's/^v//'` + echo -n "$VERSION" > "$VERFILE" +fi + +if [ -f "$VERFILE" ] +then + cat "$VERFILE" +else + echo "git-version-gen: unknown version number." >&2 + exit 1 +fi + diff --git a/configure.ac b/configure.ac index 34121e4..f736d9f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,9 @@ # Init #------------------------------------------------------------------------------- AC_PREREQ(2.59) -AC_INIT(calcurse, 2.8, bugs@calcurse.org) +AC_INIT([calcurse], + m4_esyscmd([build-aux/git-version-gen .version]), + [bugs@calcurse.org]) AM_INIT_AUTOMAKE #m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AM_GNU_GETTEXT([external]) |