From 7f4f0cb660ead3c3a549aea793bfb65a2daed829 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 29 Dec 2009 18:23:29 +0200 Subject: [PATCH] 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 Signed-off-by: Andrew Borodin --- configure.ac | 4 ---- contrib/dist/redhat/mc.spec.in | 11 ++++++++--- m4.include/mc-version.m4 | 22 ++++++++++++++++++++-- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index a5a996337..661836c0b 100644 --- a/configure.ac +++ b/configure.ac @@ -544,10 +544,6 @@ AC_SUBST(LIBS) dnl Libraries used only when building the mc binary AC_SUBST(MCLIBS) -dnl Version for the RedHat package, without dashes -RPM_VERSION=`echo $VERSION | sed 's/-/./g'` -AC_SUBST(RPM_VERSION) - if test -n "$use_smbfs"; then AC_CONFIG_SUBDIRS([vfs/samba]) fi diff --git a/contrib/dist/redhat/mc.spec.in b/contrib/dist/redhat/mc.spec.in index eb81f8099..e6edf724c 100644 --- a/contrib/dist/redhat/mc.spec.in +++ b/contrib/dist/redhat/mc.spec.in @@ -11,14 +11,15 @@ %define _with_screen --with-screen=slang %endif -%define mc_version @RPM_VERSION@ +%define mc_version @DISTR_VERSION@ +%define mc_release @DISTR_RELEASE@ %define mc_tarball @VERSION@ Summary: User-friendly text console file manager and visual shell Name: mc Version: %{mc_version} -Release: 1%{?dist} -Epoch: 2 +Release: %{mc_release}%{?dist} +Epoch: 3 License: GPLv2 Group: System Environment/Shells Source0: %{name}-%{mc_tarball}.tar.gz @@ -152,6 +153,10 @@ rm -rf $RPM_BUILD_ROOT %dir %{_libexecdir}/mc %changelog +* Wed Dec 30 2009 Yury V. Zaytsev +- Bumped the epoch again and changed the versioning scheme. +- Thanks to Slava Zanko for all his hard work on m4 vodoo! + * Fri Dec 25 2009 Yury V. Zaytsev - Had to bump the epoch because of the braindead versioning scheme used. diff --git a/m4.include/mc-version.m4 b/m4.include/mc-version.m4 index 206d85bf2..475ac72f3 100644 --- a/m4.include/mc-version.m4 +++ b/m4.include/mc-version.m4 @@ -1,9 +1,9 @@ dnl @synopsis MC_VERSION dnl -dnl get current version of Midnight Commander from git tags +dnl Get current version of Midnight Commander from git tags dnl dnl @author Slava Zanko -dnl @version 2009-06-02 +dnl @version 2009-12-30 dnl @license GPL dnl @copyright Free Software Foundation, Inc. @@ -17,4 +17,22 @@ AC_DEFUN([MC_VERSION],[ 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) + ])