]>
Commit | Line | Data |
---|---|---|
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 | |
3 | @@ -183,6 +183,10 @@ | |
4 | #define _PATH_HRSW_directory "/var/db/pkg" | |
5 | #endif | |
6 | ||
7 | +#if defined(RPM_HRMIB_PATH) | |
8 | +#define _PATH_HRSW_directory RPM_HRMIB_PATH | |
9 | +#endif | |
10 | + | |
11 | void | |
12 | init_hr_swinst(void) | |
13 | { | |
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 | |
16 | @@ -11,18 +11,33 @@ | |
17 | # RPM checks | |
18 | # | |
19 | ## | |
20 | -AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) | |
21 | ||
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) | |
24 | - | |
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]) | |
28 | - else | |
29 | - with_rpm=no | |
30 | - fi | |
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 | |
35 | + changequote(, ) | |
36 | + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,') | |
37 | + changequote([, ]) | |
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]) | |
40 | + fi | |
41 | + fi | |
42 | fi | |
43 | +# otherwise try binary linkin | |
44 | +if test -z "$RPM_HRMIB_PATH"; then | |
45 | + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) | |
46 | + | |
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) | |
49 | + | |
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]) | |
53 | + else | |
54 | + with_rpm=no | |
55 | + fi | |
56 | + fi | |
57 | ||
58 | # | |
59 | # rpm libraries only needed for the host resources mib software | |
60 | @@ -46,6 +61,12 @@ | |
61 | NETSNMP_SEARCH_LIBS(headerGet,, [ | |
62 | AC_DEFINE(HAVE_HEADERGET, 1, | |
63 | [Define to 1 if you have the headerGet function.])],, $LMIBLIBS) | |
64 | + | |
65 | + OLDLIBS=$LIBS | |
66 | + LIBS=$LMIBLIBS | |
67 | + AC_CHECK_FUNCS([rpmGetPath]) | |
68 | + LIBS=$OLDLIBS | |
69 | +fi | |
70 | fi | |
71 | ||
72 | # | |
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 | |
75 | @@ -114,15 +114,6 @@ | |
76 | # (Agent) | |
77 | ## | |
78 | ||
79 | -# rpmGetPath check needs clean LIBS environment (Linux) | |
80 | -# | |
81 | -if test "x$with_rpm" != "xno"; then | |
82 | - OLDLIBS=$LIBS | |
83 | - LIBS=$LMIBLIBS | |
84 | - AC_CHECK_FUNCS(rpmGetPath) | |
85 | - LIBS=$OLDLIBS | |
86 | -fi | |
87 | - | |
88 | # statfs( char *, struct fs_data* ) (Ultrix) | |
89 | # | |
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 | |
93 | @@ -52,6 +52,8 @@ | |
94 | { | |
95 | #if defined(PKGLOC) | |
96 | snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC ); | |
97 | +#elif defined(RPM_HRMIB_PATH) | |
98 | + snprintf( pkg_directory, SNMP_MAXPATH, "%s", RPM_HRMIB_PATH); | |
99 | #elif defined(hpux9) | |
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 | |
104 | @@ -11,6 +11,10 @@ | |
105 | #ifndef NETSNMP_ACCESS_SWINST_CONFIG_H | |
106 | #define NETSNMP_ACCESS_SWINST_CONFIG_H | |
107 | ||
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" | |
110 | + | |
111 | + | |
112 | /* | |
113 | * all platforms use this generic code | |
114 | */ | |
115 | @@ -29,7 +29,7 @@ | |
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) | |
122 | #else | |
123 | config_warning(This platform does not yet support hrSWInstalledTable rewrites) |