File: declare_versions.m4

package info (click to toggle)
libneo4j-client 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 3,444 kB
  • ctags: 2,333
  • sloc: ansic: 24,977; sh: 4,261; makefile: 206
file content (33 lines) | stat: -rw-r--r-- 1,359 bytes parent folder | download | duplicates (2)
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
AC_DEFUN([DECLARE_VERSIONS],
[
  if ! echo $VERSION | grep -Eq '^[[0-9]]+\.[[0-9]]+\.[[0-9]](~[[a-zA-Z0-9_]]+)?$'; then
    AC_MSG_ERROR([[Invalid version "$VERSION" specified in configure.ac. Must follow <major>.<minor>.<patch>[~<devel>] format.]])
  fi

  PACKAGE_MAJOR_VERSION=$(echo $VERSION | awk -F. '{print $[1]}')
  AC_DEFINE_UNQUOTED([PACKAGE_MAJOR_VERSION], $PACKAGE_MAJOR_VERSION,
    [Define to the major version of this package])
  AC_SUBST([PACKAGE_MAJOR_VERSION])

  PACKAGE_MINOR_VERSION=$(echo $VERSION | awk -F. '{print $[2]}')
  AC_DEFINE_UNQUOTED([PACKAGE_MINOR_VERSION], $PACKAGE_MINOR_VERSION,
    [Define to the minor version of this package])
  AC_SUBST([PACKAGE_MINOR_VERSION])

  PACKAGE_PATCH_VERSION=$(echo $VERSION | awk -F'[[.~]]' '{print $[3]}')
  AC_DEFINE_UNQUOTED([PACKAGE_PATCH_VERSION], $PACKAGE_PATCH_VERSION,
    [Define to the patch version of this package])
  AC_SUBST([PACKAGE_PATCH_VERSION])

  PACKAGE_DEVELOPMENT_VERSION=$(echo $VERSION | awk -F~ '{print $[2]}')
  AC_DEFINE_UNQUOTED([PACKAGE_DEVELOPMENT_VERSION], ["]$PACKAGE_DEVELOPMENT_VERSION["],
    [Define to the development version of this package])
  AC_SUBST([PACKAGE_DEVELOPMENT_VERSION])

  if test "X$PACKAGE_DEVELOPMENT_VERSION" = "X"; then
    PACKAGE_STATUS_VERSION=0
  else
    PACKAGE_STATUS_VERSION=1
  fi
  AC_SUBST([PACKAGE_STATUS_VERSION])
])