From 2be75d54a4e7e14b6ad0a5bc0051efb3339a064b Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 19 Dec 2009 20:25:34 +0200 Subject: [PATCH] Automatic version generation Signed-off-by: Felipe Contreras --- Makefile.am | 3 +++ build-aux/git-version-gen | 10 ++++++++++ configure.ac | 20 +------------------- 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100755 build-aux/git-version-gen diff --git a/Makefile.am b/Makefile.am index ca6f644..1829b48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,3 +3,6 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = tools src data m4 tests EXTRA_DIST = autogen.sh + +dist-hook: + echo $(VERSION) > $(distdir)/.version diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen new file mode 100755 index 0000000..0472f86 --- /dev/null +++ b/build-aux/git-version-gen @@ -0,0 +1,10 @@ +#!/bin/sh + +if test -f .version; then + v=`cat .version` +else + v=`git describe --tags | sed 's/^telepathy-haze-//'` +fi + +# for m4_esyscmd +echo "$v" | tr -d '\012' diff --git a/configure.ac b/configure.ac index 130fbde..f73eb39 100644 --- a/configure.ac +++ b/configure.ac @@ -1,24 +1,6 @@ AC_PREREQ([2.59]) -# Making releases: -# set the new version number -# set nano_version to 0 -# make the release, tag it -# set nano_version to 1 - -m4_define([haze_major_version], [0]) -m4_define([haze_minor_version], [3]) -m4_define([haze_micro_version], [2]) -m4_define([haze_nano_version], [1]) - -m4_define([haze_base_version], - [haze_major_version.haze_minor_version.haze_micro_version]) -m4_define([haze_version], - [m4_if(haze_nano_version, 0, - [haze_base_version], - [haze_base_version].[haze_nano_version])]) - -AC_INIT([telepathy-haze], [haze_version], +AC_INIT([telepathy-haze], m4_esyscmd([build-aux/git-version-gen]), [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=telepathy-haze]) AC_CONFIG_MACRO_DIR([m4]) -- 1.6.6