diff --git a/configure.ac b/configure.ac index ac9759a..000f0a3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ AC_PREREQ([2.65]) -AC_INIT([glorytun], [0.0.12], [https://github.com/angt/glorytun/issues], - [glorytun], [https://github.com/angt/glorytun]) +AC_INIT([glorytun], + [m4_esyscmd([./version.sh])], + [https://github.com/angt/glorytun/issues], + [glorytun], + [https://github.com/angt/glorytun]) AC_CONFIG_SRCDIR([src/common.h]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.9 -Wall -Werror foreign tar-ustar subdir-objects]) diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..434230e --- /dev/null +++ b/version.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +[ -z "${VERSION}" ] && VERSION=`git describe --tags --always 2>/dev/null` \ + && VERSION=${VERSION#v} + +[ -z "${VERSION}" ] && VERSION=`basename \`pwd\`` \ + && VERSION=${VERSION#*-} + +echo -n ${VERSION}