1
1
mc/m4.include/mc-version.m4
Slava Zanko 7f4f0cb660 Ticket #1905: Rework the versioning scheme.
We have a problem with the current mc-x.y.z-preW versioning scheme for
both Redhat and Debian. The problem is that

(1) mc-1:4.7.0-1.fc12.x86_64
(2) mc-1:4.7.0.pre4.231.g8cfffc5-1.fc12.x86_64

(1) is considered to be older than (2)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-30 22:22:53 +02:00

39 строки
1.1 KiB
Plaintext

dnl @synopsis MC_VERSION
dnl
dnl Get current version of Midnight Commander from git tags
dnl
dnl @author Slava Zanko <slavazanko@gmail.com>
dnl @version 2009-12-30
dnl @license GPL
dnl @copyright Free Software Foundation, Inc.
AC_DEFUN([MC_VERSION],[
if test ! -f ${srcdir}/version.h; then
${srcdir}/maint/version.sh ${srcdir}
fi
if test -f ${srcdir}/version.h; then
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/')
else
VERSION="unknown"
fi
AC_SUBST(VERSION)
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'`
if `echo $VERSION | grep -c '\-pre'`; then
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)
])