File: mc-version.m4

package info (click to toggle)
mc 3%3A4.8.22-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,044 kB
  • sloc: ansic: 129,315; sh: 8,278; perl: 3,022; makefile: 2,138; yacc: 291; cs: 44; lisp: 44; sed: 16
file content (38 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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/utils/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 test `echo $VERSION | grep -c '\-pre'` -ne 0; 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)

])