summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac2
-rwxr-xr-xgit-version-gen20
3 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 4a61e83..6c48faf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,11 @@ ACLOCAL_AMFLAGS = -I m4
3SUBDIRS = src include tools udev 3SUBDIRS = src include tools udev
4 4
5EXTRA_DIST = \ 5EXTRA_DIST = \
6 README.md 6 README.md \
7 git-version-gen
8
9dist-hook:
10 echo $(VERSION) > $(distdir)/.tarball-version
7 11
8DISTCHECK_CONFIGURE_FLAGS = \ 12DISTCHECK_CONFIGURE_FLAGS = \
9 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) 13 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)
diff --git a/configure.ac b/configure.ac
index e844956..aa4f7aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
2# Process this file with autoconf to produce a configure script. 2# Process this file with autoconf to produce a configure script.
3 3
4AC_PREREQ(2.68) 4AC_PREREQ(2.68)
5AC_INIT([libirecovery], [1.0.1], [https://github.com/libimobiledevice/libirecovery/issues],, [https://libimobiledevice.org]) 5AC_INIT([libirecovery], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/libirecovery/issues], [], [https://libimobiledevice.org])
6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news]) 6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) 7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
8AC_CONFIG_SRCDIR([src/]) 8AC_CONFIG_SRCDIR([src/])
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 0000000..d868952
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,20 @@
1#!/bin/sh
2SRCDIR=`dirname $0`
3if test -n "$1"; then
4 VER=$1
5else
6 if test -r "${SRCDIR}/.git" && test -x "`which git`" ; then
7 git update-index -q --refresh
8 if ! VER=`git describe --tags --dirty 2>/dev/null`; then
9 COMMIT=`git rev-parse --short HEAD`
10 DIRTY=`git diff --quiet HEAD || echo "-dirty"`
11 VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY}
12 fi
13 else
14 if test -f "${SRCDIR}/.tarball-version"; then
15 VER=`cat "${SRCDIR}/.tarball-version"`
16 fi
17 fi
18fi
19VER=`printf %s "$VER" | head -n1`
20printf %s "$VER"