Adds clamav-version.h generated header files to provide a hex-based numerical macro for evaluating the ClamAV, libclamav, and libfreshclam versions.

pull/111/head
Micah Snyder 6 years ago
parent ff31e5b486
commit d45d16b27e
  1. 2
      Makefile.am
  2. 2
      NEWS.md
  3. 68
      clamav-version.h.in
  4. 1
      configure.ac
  5. 13
      m4/reorganization/version.m4

@ -40,7 +40,7 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libclamav.pc
nodist_include_HEADERS = clamav-types.h
nodist_include_HEADERS = clamav-types.h clamav-version.h
# don't complain that configuration files and databases are not removed, this is intended
distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print

@ -96,6 +96,8 @@ changes.
assurance test suites and enables automatic testing of all proposed changes
to ClamAV, with customizable parameters to suit the testing needs of any
given code change.
- Added a new `clamav-version.h` generated header to provide version number
macros in text and numerical format for ClamAV, libclamav, and libfreshclam.
### Bug fixes

@ -0,0 +1,68 @@
/*
* Copyright (C) 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*
* Authors: Micah Snyder
*
* @GENERATE_WARNING@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef CLAMAV_VER_H
#define CLAMAV_VER_H
/**
* @macro
* Version number of the clamav package release
*/
#define CLAMAV_VERSION "@PACKAGE_VERSION@"
/**
* @macro
* Numerical representation of the version number of the clamav package
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define CLAMAV_VERSION_NUM @PACKAGE_VERSION_NUM@
/**
* @macro
* Version number of the clamav library release
*/
#define LIBCLAMAV_VERSION "@LIBCLAMAV_VERSION@"
/**
* @macro
* Numerical representation of the version number of the libclamav library
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define LIBCLAMAV_VERSION_NUM @LIBCLAMAV_VERSION_NUM@
/**
* @macro
* Version number of the clamav library release
*/
#define LIBFRESHCLAM_VERSION "@LIBFRESHCLAM_VERSION@"
/**
* @macro
* Numerical representation of the version number of the libfreshclam library
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define LIBFRESHCLAM_VERSION_NUM @LIBFRESHCLAM_VERSION_NUM@
#endif /* CLAMAV_VER_H */

@ -223,6 +223,7 @@ docs/man/sigtool.1
docs/man/clamdtop.1
docs/man/clamsubmit.1
clamav-types.h
clamav-version.h
])
AM_COND_IF([BUILD_CLAMONACC],

@ -2,6 +2,13 @@ dnl change this on a release
dnl VERSION="devel-`date +%Y%m%d`"
VERSION="0.102.0-beta"
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"`
AC_SUBST(PACKAGE_VERSION_NUM)
dnl libclamav version info
LC_CURRENT=9
LC_REVISION=4
@ -9,6 +16,9 @@ LC_AGE=0
LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE"
AC_SUBST([LIBCLAMAV_VERSION])
LIBCLAMAV_VERSION_NUM=`printf "0x%02x%02x%02x" "$LC_CURRENT" "$LC_REVISION" "$LC_AGE"`
AC_SUBST(LIBCLAMAV_VERSION_NUM)
LC_MAJOR=`expr $LC_CURRENT - $LC_AGE`
AC_DEFINE_UNQUOTED([LIBCLAMAV_FULLVER], "$LC_MAJOR.$LC_AGE.$LC_REVISION", ["Full clamav library version number"])
AC_DEFINE_UNQUOTED([LIBCLAMAV_MAJORVER], $LC_MAJOR, ["Major clamav library version number"])
@ -20,6 +30,9 @@ LFC_AGE=0
LIBFRESHCLAM_VERSION="$LFC_CURRENT":"$LFC_REVISION":"$LFC_AGE"
AC_SUBST([LIBFRESHCLAM_VERSION])
LIBFRESHCLAM_VERSION_NUM=`printf "0x%02x%02x%02x" "$LFC_CURRENT" "$LFC_REVISION" "$LFC_AGE"`
AC_SUBST(LIBFRESHCLAM_VERSION_NUM)
LFC_MAJOR=`expr $LFC_CURRENT - $LFC_AGE`
AC_DEFINE_UNQUOTED([LIBFRESHCLAM_FULLVER], "$LFC_MAJOR.$LFC_AGE.$LFC_REVISION", ["Full freshclam library version number"])
AC_DEFINE_UNQUOTED([LIBFRESHCLAM_MAJORVER], $LFC_MAJOR, ["Major freshclam library version number"])

Loading…
Cancel
Save