]>
Commit | Line | Data |
---|---|---|
aa008d13 AM |
1 | diff -urNp -x '*.orig' net-snmp-5.9.org/agent/mibgroup/host/data_access/swinst.h net-snmp-5.9/agent/mibgroup/host/data_access/swinst.h |
2 | --- net-snmp-5.9.org/agent/mibgroup/host/data_access/swinst.h 2020-08-14 23:41:47.000000000 +0200 | |
3 | +++ net-snmp-5.9/agent/mibgroup/host/data_access/swinst.h 2021-02-28 14:29:14.950860864 +0100 | |
4 | @@ -11,6 +11,10 @@ | |
5 | #ifndef NETSNMP_ACCESS_SWINST_CONFIG_H | |
6 | #define NETSNMP_ACCESS_SWINST_CONFIG_H | |
7 | ||
8 | +// quick fix: this file is consulted before RPM_HRMIB_PATH check is made in configure, hardcode a define for now | |
9 | +#define RPM_HRMIB_PATH "/var/cache/hrmib" | |
10 | + | |
11 | + | |
12 | /* | |
13 | * all platforms use this generic code | |
14 | */ | |
15 | @@ -25,7 +29,7 @@ config_exclude(host/hr_swinst) | |
16 | config_require(host/data_access/swinst_apt) | |
17 | #elif defined( HAVE_LIBRPM ) && defined( linux ) | |
18 | config_require(host/data_access/swinst_rpm) | |
19 | -#elif defined( HAVE_PKGLOCS_H ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) || defined( openbsd ) | |
20 | +#elif defined( HAVE_PKGLOCS_H ) || defined( RPM_HRMIB_PATH ) || defined( hpux9 ) || defined( hpux10 ) || defined( hpux11 ) || defined( freebsd2 ) || defined( linux ) || defined( openbsd ) | |
21 | config_require(host/data_access/swinst_pkginfo) | |
22 | #else | |
23 | config_warning(This platform does not yet support hrSWInstalledTable rewrites) | |
24 | diff -urNp -x '*.orig' net-snmp-5.9.org/agent/mibgroup/host/data_access/swinst_pkginfo.c net-snmp-5.9/agent/mibgroup/host/data_access/swinst_pkginfo.c | |
25 | --- net-snmp-5.9.org/agent/mibgroup/host/data_access/swinst_pkginfo.c 2020-08-14 23:41:47.000000000 +0200 | |
26 | +++ net-snmp-5.9/agent/mibgroup/host/data_access/swinst_pkginfo.c 2021-02-28 14:29:14.950860864 +0100 | |
27 | @@ -61,6 +61,8 @@ netsnmp_swinst_arch_init(void) | |
28 | { | |
29 | #if defined(PKGLOC) | |
30 | snprintf( pkg_directory, SNMP_MAXPATH, "%s", PKGLOC ); | |
31 | +#elif defined(RPM_HRMIB_PATH) | |
32 | + snprintf( pkg_directory, SNMP_MAXPATH, "%s", RPM_HRMIB_PATH); | |
33 | #elif defined(hpux9) | |
34 | snprintf( pkg_directory, SNMP_MAXPATH, "/system" ); | |
35 | #elif defined(hpux10) || defined(hpux11) | |
36 | diff -urNp -x '*.orig' net-snmp-5.9.org/agent/mibgroup/host/hr_swinst.c net-snmp-5.9/agent/mibgroup/host/hr_swinst.c | |
37 | --- net-snmp-5.9.org/agent/mibgroup/host/hr_swinst.c 2021-02-28 14:29:14.640851176 +0100 | |
38 | +++ net-snmp-5.9/agent/mibgroup/host/hr_swinst.c 2021-02-28 14:29:14.950860864 +0100 | |
39 | @@ -196,6 +196,10 @@ oid hrswinst_variables_oid[] | |
40 | #define _PATH_HRSW_directory "/var/cache/hrmib" | |
5131293d ER |
41 | #endif |
42 | ||
5431ee70 ER |
43 | +#if defined(RPM_HRMIB_PATH) |
44 | +#define _PATH_HRSW_directory RPM_HRMIB_PATH | |
45 | +#endif | |
5131293d ER |
46 | + |
47 | void | |
48 | init_hr_swinst(void) | |
49 | { | |
aa008d13 AM |
50 | diff -urNp -x '*.orig' net-snmp-5.9.org/configure.d/config_os_functions net-snmp-5.9/configure.d/config_os_functions |
51 | --- net-snmp-5.9.org/configure.d/config_os_functions 2020-08-14 23:41:47.000000000 +0200 | |
52 | +++ net-snmp-5.9/configure.d/config_os_functions 2021-02-28 14:29:14.950860864 +0100 | |
53 | @@ -188,15 +188,6 @@ AC_CHECK_FUNCS([if_freenameindex | |
54 | # (Agent) | |
55 | ## | |
56 | ||
57 | -# rpmGetPath check needs clean LIBS environment (Linux) | |
58 | -# | |
59 | -if test "x$with_rpm" != "xno"; then | |
60 | - OLDLIBS=$LIBS | |
61 | - LIBS=$LMIBLIBS | |
62 | - AC_CHECK_FUNCS(rpmGetPath) | |
63 | - LIBS=$OLDLIBS | |
64 | -fi | |
65 | - | |
66 | # statfs( char *, struct fs_data* ) (Ultrix) | |
67 | # | |
68 | AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]]) | |
69 | diff -urNp -x '*.orig' net-snmp-5.9.org/configure.d/config_os_libs1 net-snmp-5.9/configure.d/config_os_libs1 | |
70 | --- net-snmp-5.9.org/configure.d/config_os_libs1 2021-02-28 14:29:14.630850863 +0100 | |
71 | +++ net-snmp-5.9/configure.d/config_os_libs1 2021-02-28 14:29:14.950860864 +0100 | |
4d301018 | 72 | @@ -11,18 +11,33 @@ |
849c236b AM |
73 | # RPM checks |
74 | # | |
75 | ## | |
5431ee70 | 76 | -AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) |
4d301018 | 77 | |
5431ee70 ER |
78 | -AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no) |
79 | -AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no) | |
80 | - | |
81 | -if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then | |
82 | - if test "x$with_rpm" = "xyes" ; then | |
83 | - AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support]) | |
84 | - else | |
85 | - with_rpm=no | |
86 | - fi | |
afbe2a1a JB |
87 | +# check if we can use rpm hrmib export |
88 | +if test "$with_rpm" != "no" ; then | |
89 | + AC_PATH_PROG([RPM], rpm) | |
90 | + if test -n "$RPM"; then | |
91 | + changequote(, ) | |
92 | + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,') | |
93 | + changequote([, ]) | |
94 | + if test -n "$RPM_HRMIB_PATH"; then | |
95 | + AC_DEFINE_UNQUOTED([RPM_HRMIB_PATH], ["$RPM_HRMIB_PATH"], [Directory where RPM exports packages hrmib information]) | |
96 | + fi | |
97 | + fi | |
98 | fi | |
99 | +# otherwise try binary linkin | |
100 | +if test -z "$RPM_HRMIB_PATH"; then | |
101 | + AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h) | |
849c236b | 102 | + |
afbe2a1a JB |
103 | + AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no) |
104 | + AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no) | |
105 | + | |
106 | + if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then | |
107 | + if test "x$with_rpm" = "xyes" ; then | |
108 | + AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support]) | |
109 | + else | |
110 | + with_rpm=no | |
111 | + fi | |
112 | + fi | |
113 | ||
5431ee70 | 114 | # |
4d301018 | 115 | # rpm libraries only needed for the host resources mib software |
aa008d13 | 116 | @@ -46,6 +61,12 @@ if test "x$with_rpm" != "xno"; then |
4d301018 JB |
117 | NETSNMP_SEARCH_LIBS(headerGet,, [ |
118 | AC_DEFINE(HAVE_HEADERGET, 1, | |
119 | [Define to 1 if you have the headerGet function.])],, $LMIBLIBS) | |
849c236b | 120 | + |
afbe2a1a JB |
121 | + OLDLIBS=$LIBS |
122 | + LIBS=$LMIBLIBS | |
123 | + AC_CHECK_FUNCS([rpmGetPath]) | |
124 | + LIBS=$OLDLIBS | |
4d301018 | 125 | +fi |
afbe2a1a | 126 | fi |
5431ee70 | 127 | |
4d301018 | 128 | # |