diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-06-30 13:24:01 +0200 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2017-09-19 12:15:30 +0000 |
commit | e5c78e1a42fc7988cdbadb52208655d46f41d314 (patch) | |
tree | da865735a76035fc7b74d89bda13bae0c7ab8b02 /.gitignore | |
parent | ffebf6c2c5ba0e369204d99a41cb250cacd8b591 (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 '.gitignore')
-rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -23,6 +23,7 @@ stamp-h1 *.spec gluster-blockd.service *.tar.gz +VERSION cscope.* tags |