From bdbb0834a093868a817e1a38e676e470b1aa8685 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 https://bugs.freedesktop.org/show_bug.cgi?id=26120 --- build-aux/git-version-gen | 10 ++++++++++ configure.ac | 22 +++------------------- tools/telepathy.am | 1 + 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100755 build-aux/git-version-gen 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 c751e5f..c0f2923 100644 --- a/configure.ac +++ b/configure.ac @@ -1,23 +1,7 @@ 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], [5]) -m4_define([haze_micro_version], [0]) -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])]) - +m4_define([haze_version], m4_esyscmd([build-aux/git-version-gen])) +m4_define([haze_version_extra], m4_bregexp(haze_version, [-g[0-9a-f]+$])) AC_INIT([telepathy-haze], [haze_version], [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=haze]) @@ -47,7 +31,7 @@ COMPILER_OPTIMISATIONS COMPILER_COVERAGE LINKER_OPTIMISATIONS -ifelse(haze_nano_version, 0, [release=yes], [release=no]) +ifelse(haze_version_extra, -1, [release=yes], [release=no]) TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test x$release = xno], [all \ extra \ diff --git a/tools/telepathy.am b/tools/telepathy.am index 9715026..8e416e9 100644 --- a/tools/telepathy.am +++ b/tools/telepathy.am @@ -5,6 +5,7 @@ dist-hook: if test -d ${top_srcdir}/.git; then \ git log --date=iso $(CHANGELOG_RANGE) > ${distdir}/ChangeLog; \ fi + echo $(VERSION) > $(distdir)/.version distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ -- 1.7.7.1