diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-01-23 18:57:46 +0100 |
---|---|---|
committer | Gary Lowell <glowell@inktank.com> | 2013-01-26 22:34:58 -0800 |
commit | 32276e9afbe98c3da85c2b4322ee09556f3ee4fd (patch) | |
tree | ee854ce17309bf5ab9c8a8fbd261b05e3e1961fe /configure.ac | |
parent | 341e6760154510a703376032df74459e2abd7822 (diff) | |
download | ceph-32276e9afbe98c3da85c2b4322ee09556f3ee4fd.tar.gz |
configure: fix RPM_RELEASE
Use git to get RPM_RELEASE only if this is a git repo
clone and if the git command is available on the system.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index b67e5cd39c3..f87140fc20e 100644 --- a/configure.ac +++ b/configure.ac @@ -12,8 +12,15 @@ AC_PREREQ(2.59) AC_INIT([ceph], [0.56], [ceph-devel@vger.kernel.org]) # Create release string. Used with VERSION for RPMs. +RPM_RELEASE=0 AC_SUBST(RPM_RELEASE) -RPM_RELEASE=`if expr index $(git describe --always) '-' > /dev/null ; then git describe --always | cut -d- -f2- | tr '-' '.' ; else echo "0"; fi` +if test -d ".git" ; then + AC_CHECK_PROG(GIT_CHECK, git, yes) + if test x"$GIT_CHECK" = x"yes"; then + RPM_RELEASE=`if expr index $(git describe --always) '-' > /dev/null ; then git describe --always | cut -d- -f2- | tr '-' '.' ; else echo "0"; fi` + fi +fi +AC_MSG_NOTICE([RPM_RELEASE='$RPM_RELEASE']) AC_CONFIG_MACRO_DIR([m4]) |