1 --- net-snmp-5.4.1/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:05:07.575307614 +0300
2 +++ net-snmp-5.4.1.hrmib/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:04:24.676830108 +0300
4 #define _PATH_HRSW_directory "/var/db/pkg"
7 +#if defined(RPM_HRMIB_PATH)
8 +#define _PATH_HRSW_directory RPM_HRMIB_PATH
14 --- net-snmp-5.8/configure.d/config_os_libs1.orig 2018-08-25 22:50:35.841023154 +0200
15 +++ net-snmp-5.8/configure.d/config_os_libs1 2018-08-26 08:07:04.487308581 +0200
20 -AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
22 -AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
23 -AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
25 -if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
26 - if test "x$with_rpm" = "xyes" ; then
27 - AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
31 +# check if we can use rpm hrmib export
32 +if test "$with_rpm" != "no" ; then
33 + AC_PATH_PROG([RPM], rpm)
34 + if test -n "$RPM"; then
36 + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,')
38 + if test -n "$RPM_HRMIB_PATH"; then
39 + AC_DEFINE_UNQUOTED([RPM_HRMIB_PATH], ["$RPM_HRMIB_PATH"], [Directory where RPM exports packages hrmib information])
43 +# otherwise try binary linkin
44 +if test -z "$RPM_HRMIB_PATH"; then
45 + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
47 + AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
48 + AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
50 + if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
51 + if test "x$with_rpm" = "xyes" ; then
52 + AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
59 # rpm libraries only needed for the host resources mib software
61 NETSNMP_SEARCH_LIBS(headerGet,, [
62 AC_DEFINE(HAVE_HEADERGET, 1,
63 [Define to 1 if you have the headerGet function.])],, $LMIBLIBS)
67 + AC_CHECK_FUNCS([rpmGetPath])
73 --- net-snmp-5.5/configure.d/config_os_functions~ 2009-07-26 20:20:55.000000000 +0200
74 +++ net-snmp-5.5/configure.d/config_os_functions 2010-05-12 14:35:39.421276242 +0200
79 -# rpmGetPath check needs clean LIBS environment (Linux)
81 -if test "x$with_rpm" != "xno"; then
84 - AC_CHECK_FUNCS(rpmGetPath)
88 # statfs( char *, struct fs_data* ) (Ultrix)
90 AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
91 --- net-snmp-5.6/agent/mibgroup/host/data_access/swinst_pkginfo.c~ 2010-01-26 23:24:14.000000000 +0200
92 +++ net-snmp-5.6/agent/mibgroup/host/data_access/swinst_pkginfo.c 2010-12-16 00:13:22.027247692 +0200
96 snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC );
97 +#elif defined(RPM_HRMIB_PATH)
98 + snprintf( pkg_directory, SNMP_MAXPATH, "%s", RPM_HRMIB_PATH);
100 snprintf( pkg_directory, SNMP_MAXPATH, "/system" );
101 #elif defined(hpux10) || defined(hpux11)
102 --- net-snmp-5.6/agent/mibgroup/host/data_access/swinst.h 2010-12-16 00:14:13.634392176 +0200
103 +++ net-snmp-5.6/agent/mibgroup/host/data_access/swinst.h 2010-12-16 01:27:48.195543278 +0200
105 #ifndef NETSNMP_ACCESS_SWINST_CONFIG_H
106 #define NETSNMP_ACCESS_SWINST_CONFIG_H
108 +// quick fix: this file is consulted before RPM_HRMIB_PATH check is made in configure, hardcode a define for now
109 +#define RPM_HRMIB_PATH "/var/cache/hrmib"
113 * all platforms use this generic code
116 config_require(host/data_access/swinst_apt)
117 #elif defined( HAVE_LIBRPM ) && defined( linux )
118 config_require(host/data_access/swinst_rpm)
119 -#elif defined( HAVE_PKGLOCS_H ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) || defined( openbsd )
120 +#elif defined( HAVE_PKGLOCS_H ) || defined( RPM_HRMIB_PATH ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) || defined( openbsd )
121 config_require(host/data_access/swinst_pkginfo)
123 config_warning(This platform does not yet support hrSWInstalledTable rewrites)