2009-06-02 17:36:58 +04:00
|
|
|
dnl @synopsis MC_VERSION
|
|
|
|
dnl
|
2009-12-29 19:23:29 +03:00
|
|
|
dnl Get current version of Midnight Commander from git tags
|
2009-06-02 17:36:58 +04:00
|
|
|
dnl
|
|
|
|
dnl @author Slava Zanko <slavazanko@gmail.com>
|
2009-12-29 19:23:29 +03:00
|
|
|
dnl @version 2009-12-30
|
2009-06-02 17:36:58 +04:00
|
|
|
dnl @license GPL
|
|
|
|
dnl @copyright Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
AC_DEFUN([MC_VERSION],[
|
|
|
|
if test ! -f ${srcdir}/version.h; then
|
2013-04-09 15:51:24 +04:00
|
|
|
${srcdir}/maint/utils/version.sh ${srcdir}
|
2009-06-02 17:36:58 +04:00
|
|
|
fi
|
|
|
|
if test -f ${srcdir}/version.h; then
|
2009-07-06 13:19:58 +04:00
|
|
|
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/')
|
2009-06-02 17:36:58 +04:00
|
|
|
else
|
|
|
|
VERSION="unknown"
|
|
|
|
fi
|
|
|
|
AC_SUBST(VERSION)
|
2009-12-29 19:23:29 +03:00
|
|
|
|
|
|
|
dnl Version and Release without dashes for the distro packages
|
|
|
|
DISTR_VERSION=`echo $VERSION | sed 's/^\([[^\-]]*\).*/\1/'`
|
|
|
|
DISTR_RELEASE=`echo $VERSION | sed 's/^[[^\-]]*\-\(.*\)/\1/' | sed 's/-/./g'`
|
|
|
|
|
2010-01-06 20:27:57 +03:00
|
|
|
if test `echo $VERSION | grep -c '\-pre'` -ne 0; then
|
2009-12-29 19:23:29 +03:00
|
|
|
DISTR_RELEASE="0.$DISTR_RELEASE"
|
|
|
|
else
|
|
|
|
if test `echo $VERSION | grep -c '\-'` -eq 0; then
|
|
|
|
DISTR_RELEASE=1
|
|
|
|
else
|
|
|
|
DISTR_RELEASE="2.$DISTR_RELEASE"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(DISTR_VERSION)
|
|
|
|
AC_SUBST(DISTR_RELEASE)
|
|
|
|
|
2009-06-02 17:36:58 +04:00
|
|
|
])
|