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.6/configure.d/config_os_libs1.orig 2010-10-24 10:37:25.527741043 +0200
15 +++ net-snmp-5.6/configure.d/config_os_libs1 2010-10-24 10:40:56.519744396 +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])
32 +# check if we can use rpm hrmib export
33 +if test "$with_rpm" != "no" ; then
34 + AC_PATH_PROG([RPM], rpm)
35 + if test -n "$RPM"; then
37 + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,')
39 + if test -n "$RPM_HRMIB_PATH"; then
40 + AC_DEFINE_UNQUOTED([RPM_HRMIB_PATH], ["$RPM_HRMIB_PATH"], [Directory where RPM exports packages hrmib information])
44 +# otherwise try binary linkin
45 +if test -z "$RPM_HRMIB_PATH"; then
46 + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
48 + AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
49 + AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
51 + if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
52 + if test "x$with_rpm" = "xyes" ; then
53 + AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
60 # rpm libraries only needed for the host resources mib software
61 # installed tables (on linux in particular)
64 AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]),
65 [[#include <rpm/rpmlib.h>]]
70 + AC_CHECK_FUNCS([rpmGetPath])
76 --- net-snmp-5.5/configure.d/config_os_functions~ 2009-07-26 20:20:55.000000000 +0200
77 +++ net-snmp-5.5/configure.d/config_os_functions 2010-05-12 14:35:39.421276242 +0200
82 -# rpmGetPath check needs clean LIBS environment (Linux)
84 -if test "x$with_rpm" != "xno"; then
87 - AC_CHECK_FUNCS(rpmGetPath)
91 # statfs( char *, struct fs_data* ) (Ultrix)
93 AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
94 --- net-snmp-5.6/agent/mibgroup/host/data_access/swinst_pkginfo.c~ 2010-01-26 23:24:14.000000000 +0200
95 +++ net-snmp-5.6/agent/mibgroup/host/data_access/swinst_pkginfo.c 2010-12-16 00:13:22.027247692 +0200
99 snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC );
100 +#elif defined(RPM_HRMIB_PATH)
101 + snprintf( pkg_directory, SNMP_MAXPATH, "%s", RPM_HRMIB_PATH);
103 snprintf( pkg_directory, SNMP_MAXPATH, "/system" );
104 #elif defined(hpux10) || defined(hpux11)
105 --- net-snmp-5.6/agent/mibgroup/host/data_access/swinst.h 2010-12-16 00:14:13.634392176 +0200
106 +++ net-snmp-5.6/agent/mibgroup/host/data_access/swinst.h 2010-12-16 01:27:48.195543278 +0200
108 #ifndef NETSNMP_ACCESS_SWINST_CONFIG_H
109 #define NETSNMP_ACCESS_SWINST_CONFIG_H
111 +// quick fix: this file is consulted before RPM_HRMIB_PATH check is made in configure, hardcode a define for now
112 +#define RPM_HRMIB_PATH "/var/cache/hrmib"
116 * all platforms use this generic code
119 config_require(host/data_access/swinst_darwin)
120 #elif defined( HAVE_LIBRPM ) && defined( linux )
121 config_require(host/data_access/swinst_rpm)
122 -#elif defined( HAVE_PKGLOCS_H ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 )
123 +#elif defined( HAVE_PKGLOCS_H ) || defined( RPM_HRMIB_PATH ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 )
124 config_require(host/data_access/swinst_pkginfo)
126 config_warning(This platform does not yet support hrSWInstalledTable rewrites)