summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-06-30 13:24:01 +0200
committerNiels de Vos <ndevos@redhat.com>2017-09-19 12:15:30 +0000
commite5c78e1a42fc7988cdbadb52208655d46f41d314 (patch)
treeda865735a76035fc7b74d89bda13bae0c7ab8b02 /configure.ac
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 ./autogen.sh is still needed to be run. ./autogen.sh 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 ./autogen.sh %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 <ndevos@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index d1168fa..f19d2aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl cases as published by the Free Software Foundation.
AC_PREREQ([2.69])
AC_INIT([gluster-block],
- 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'-')),
[pkalever@redhat.com],,
[https://github.com/gluster/gluster-block.git])