path: root/
diff options
authorNiels de Vos <>2017-06-30 13:24:01 +0200
committerNiels de Vos <>2017-09-19 12:15:30 +0000
commite5c78e1a42fc7988cdbadb52208655d46f41d314 (patch)
treeda865735a76035fc7b74d89bda13bae0c7ab8b02 /
parentffebf6c2c5ba0e369204d99a41cb250cacd8b591 (diff)
build: do not require 'git' to find the version
While looking into packaging gluster-block for Fedora, I noticed that 'git' is used to determine the version. The downloads from GitHub are not archives that have been created with 'make dist', and hence ./ is still needed to be run. ./ generates all the needed bits, including the ./configure script that tries to figure out the version. If ./configure runs in a non-git directory, no version can be found. In order to solve this, I'm adding a VERSION file in the root of the project. If this file exists, it is used to fetch the version, instead of trying to run git. The basic usage for RPM packaging in distributions can then be: echo %{version} > VERSION ./ %configure Note that the VERSION file is not needed for building from a git repository. However, this file can get packaged in the 'make dist' tarball so that building from the tarball does not require git. Change-Id: Ied378c7071ee4a108a1e946dccbb7f223b7aeb9f Updates: #25 Signed-off-by: Niels de Vos <>
Diffstat (limited to '')
1 files changed, 1 insertions, 1 deletions
diff --git a/ b/
index d1168fa..f19d2aa 100644
--- a/
+++ b/
@@ -9,7 +9,7 @@ dnl cases as published by the Free Software Foundation.
- m4_esyscmd(echo -n $(git describe --always --tags | cut -f2 -d'v' | cut -f1 -d'-')),
+ m4_esyscmd(echo -n $(cat VERSION 2>/dev/null || git describe --always --tags | cut -f2 -d'v' | cut -f1 -d'-')),