diff options
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | scripts/Makefile.am | 2 | ||||
-rwxr-xr-x | scripts/version.sh | 15 |
5 files changed, 24 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am index e9113c2..4a3ead6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,8 @@ SUBDIRS = \ etc \ docs \ m4macros \ - tests + tests \ + scripts # tools want this on a single line ACLOCAL_AMFLAGS = -I m4macros @@ -20,7 +21,8 @@ dist_doc_DATA = \ EXTRA_DIST = \ autogen.sh \ tinyproxy-indent.sh \ - TODO + TODO \ + VERSION test: all ./tests/scripts/run_tests.sh @@ -0,0 +1 @@ +1.10.0 diff --git a/configure.ac b/configure.ac index 48ee0b2..1e71e35 100644 --- a/configure.ac +++ b/configure.ac @@ -3,15 +3,7 @@ AC_PREREQ(2.54) -m4_define([tinyproxy_major_version], [1]) -m4_define([tinyproxy_minor_version], [10]) -m4_define([tinyproxy_micro_version], [0]) -m4_define([tinyproxy_real_version], - [tinyproxy_major_version.tinyproxy_minor_version.tinyproxy_micro_version]) -m4_define([tinyproxy_version], [tinyproxy_real_version]) - -# For overriding the version string. Comment out if not needed. -# m4_define([tinyproxy_version], [1.10.0]) +m4_define([tinyproxy_version], esyscmd(sh scripts/version.sh | tr -d '\n')) AC_INIT([Tinyproxy], [tinyproxy_version], [https://tinyproxy.github.io/], @@ -227,6 +219,7 @@ docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile +scripts/Makefile ]) AC_OUTPUT diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..4876c5d --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + version.sh diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100755 index 0000000..9a965dc --- /dev/null +++ b/scripts/version.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)" +GIT_DIR="${SCRIPT_DIR}/../.git" + +if test -d "${GIT_DIR}" ; then + if type git >/dev/null 2>&1 ; then + git describe --match '[0-9]*.[0-9]*.[0-9]*' 2>/dev/null \ + | sed -e 's/-/-git-/' + else + sed 's/$/-git/' < VERSION + fi +else + cat VERSION +fi |