]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
configure: fix RPM_RELEASE
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 23 Jan 2013 17:57:46 +0000 (18:57 +0100)
committerGary Lowell <glowell@inktank.com>
Sun, 27 Jan 2013 06:34:58 +0000 (22:34 -0800)
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>
configure.ac

index b67e5cd39c30b8dba1c4c754a8188bfa7f71df58..f87140fc20e67d40411c18dd3d9ccd8b6b060b2d 100644 (file)
@@ -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])