From 923a335bf8613696d658448cd9c48a963924d436 Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Mon, 9 Mar 2009 11:52:25 -0700 Subject: Use git's version number for releases. This will allow more specific version numbers, while simplifying a proper release down to a tag and make dist. During development, ./version.sh needs to run periodically to update the version number. I'd recommend just adding a call to version.sh as a git post commit hook: % cat .git/hooks/post-commit echo "Updating version." ./version.sh (and make sure the file is executable) --- .gitignore | 3 ++- Makefile.am | 2 +- autogen.sh | 3 +++ configure.ac | 3 ++- version.sh | 8 ++++++++ 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 version.sh diff --git a/.gitignore b/.gitignore index 195b246..f3d6757 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ memcached-*.tar.gz doc/protocol-binary-range.txt doc/protocol-binary.txt /sizes -/internal_tests \ No newline at end of file +/internal_tests +/version.m4 diff --git a/Makefile.am b/Makefile.am index 4cf00b4..af41fe4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,7 @@ memcached_debug_dtrace.o: $(memcached_debug_OBJECTS) SUBDIRS = doc DIST_DIRS = scripts -EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d +EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d version.m4 MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov diff --git a/autogen.sh b/autogen.sh index 873f0a4..3db9801 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,6 +7,9 @@ # apt-get install automake1.7 autoconf # +# Get the initial version. +sh version.sh + echo "aclocal..." ACLOCAL=`which aclocal-1.10 || which aclocal-1.9 || which aclocal19 || which aclocal-1.7 || which aclocal17 || which aclocal-1.5 || which aclocal15 || which aclocal || exit 1` $ACLOCAL || exit 1 diff --git a/configure.ac b/configure.ac index 182b105..f3fa8b7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,6 @@ AC_PREREQ(2.52) -AC_INIT(memcached, 1.3.2, brad@danga.com) +m4_include([version.m4]) +AC_INIT(memcached, VERSION_NUMBER, brad@danga.com) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR(memcached.c) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..8a58aef --- /dev/null +++ b/version.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if git describe > version.tmp +then + echo "m4_define([VERSION_NUMBER], [`tr -d '\n' < version.tmp`])" \ + > version.m4 +fi +rm version.tmp -- cgit v1.2.1