summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.am')
-rw-r--r--scripts/Makefile.am9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 3185a476..e6c051b0 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -18,13 +18,20 @@ EXTRA_DIST = \
# Files that should be removed, but which Automake does not know.
MOSTLYCLEANFILES = $(bin_SCRIPTS) *.tmp
+if USE_GIT_VERSION
+GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
+REAL_PACKAGE_VERSION = $(GIT_VERSION)
+else
+REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
+endif
+
#### Taken from the autoconf scripts Makefile.am ####
edit = sed \
-e 's|@localedir[@]|$(localedir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \
- -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
+ -e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
-e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@DBEXT[@]|$(DBEXT)|g' \