]>
Commit | Line | Data |
---|---|---|
5431ee70 ER |
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 @@ | |
5131293d ER |
4 | #define _PATH_HRSW_directory "/var/db/pkg" |
5 | #endif | |
6 | ||
5431ee70 ER |
7 | +#if defined(RPM_HRMIB_PATH) |
8 | +#define _PATH_HRSW_directory RPM_HRMIB_PATH | |
9 | +#endif | |
5131293d ER |
10 | + |
11 | void | |
12 | init_hr_swinst(void) | |
13 | { | |
39132f8f AM |
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 | |
afbe2a1a | 16 | @@ -425,20 +425,34 @@ |
849c236b AM |
17 | # RPM checks |
18 | # | |
19 | ## | |
5431ee70 | 20 | -AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) |
849c236b | 21 | - |
5431ee70 ER |
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 | |
afbe2a1a JB |
31 | +# |
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 | |
36 | + changequote(, ) | |
37 | + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,') | |
38 | + changequote([, ]) | |
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]) | |
41 | + fi | |
42 | + fi | |
43 | fi | |
44 | +# otherwise try binary linkin | |
45 | +if test -z "$RPM_HRMIB_PATH"; then | |
46 | + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) | |
849c236b | 47 | + |
afbe2a1a JB |
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) | |
50 | + | |
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]) | |
54 | + else | |
55 | + with_rpm=no | |
56 | + fi | |
57 | + fi | |
58 | ||
59 | -# | |
5431ee70 ER |
60 | # rpm libraries only needed for the host resources mib software |
61 | # installed tables (on linux in particular) | |
62 | # | |
afbe2a1a JB |
63 | @@ -490,6 +504,12 @@ |
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>]] | |
66 | ) | |
849c236b | 67 | + |
afbe2a1a JB |
68 | + OLDLIBS=$LIBS |
69 | + LIBS=$LMIBLIBS | |
70 | + AC_CHECK_FUNCS([rpmGetPath]) | |
71 | + LIBS=$OLDLIBS | |
849c236b | 72 | + fi |
afbe2a1a | 73 | fi |
5431ee70 | 74 | |
849c236b | 75 | ## |
849c236b AM |
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 | |
39132f8f | 78 | @@ -114,15 +114,6 @@ |
849c236b AM |
79 | # (Agent) |
80 | ## | |
81 | ||
82 | -# rpmGetPath check needs clean LIBS environment (Linux) | |
83 | -# | |
39132f8f | 84 | -if test "x$with_rpm" != "xno"; then |
849c236b AM |
85 | - OLDLIBS=$LIBS |
86 | - LIBS=$LMIBLIBS | |
87 | - AC_CHECK_FUNCS(rpmGetPath) | |
88 | - LIBS=$OLDLIBS | |
5431ee70 | 89 | -fi |
39132f8f | 90 | - |
849c236b AM |
91 | # statfs( char *, struct fs_data* ) (Ultrix) |
92 | # | |
39132f8f | 93 | AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]]) |
349110c7 ER |
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 | |
96 | @@ -52,6 +52,8 @@ | |
97 | { | |
98 | #if defined(PKGLOC) | |
99 | snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC ); | |
100 | +#elif defined(RPM_HRMIB_PATH) | |
101 | + snprintf( pkg_directory, SNMP_MAXPATH, "%s", RPM_HRMIB_PATH); | |
102 | #elif defined(hpux9) | |
103 | snprintf( pkg_directory, SNMP_MAXPATH, "/system" ); | |
104 | #elif defined(hpux10) || defined(hpux11) | |
b0de23ad ER |
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 | |
107 | @@ -11,6 +11,10 @@ | |
108 | #ifndef NETSNMP_ACCESS_SWINST_CONFIG_H | |
109 | #define NETSNMP_ACCESS_SWINST_CONFIG_H | |
110 | ||
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" | |
113 | + | |
114 | + | |
115 | /* | |
116 | * all platforms use this generic code | |
117 | */ | |
cd697e1b AM |
118 | @@ -29,7 +29,7 @@ |
119 | config_require(host/data_access/swinst_apt) | |
349110c7 ER |
120 | #elif defined( HAVE_LIBRPM ) && defined( linux ) |
121 | config_require(host/data_access/swinst_rpm) | |
cd697e1b AM |
122 | -#elif defined( HAVE_PKGLOCS_H ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) |
123 | +#elif defined( HAVE_PKGLOCS_H ) || defined( RPM_HRMIB_PATH ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) | |
349110c7 ER |
124 | config_require(host/data_access/swinst_pkginfo) |
125 | #else | |
126 | config_warning(This platform does not yet support hrSWInstalledTable rewrites) |