]> git.pld-linux.org Git - packages/net-snmp.git/blame - net-snmp-use-rpm-hrmib.patch
- updated to 5.9 (new sonames)
[packages/net-snmp.git] / net-snmp-use-rpm-hrmib.patch
CommitLineData
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 {
4d301018
JB
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 @@
849c236b
AM
17 # RPM checks
18 #
19 ##
5431ee70 20-AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
4d301018 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+# 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)
849c236b 46+
afbe2a1a
JB
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
5431ee70 58 #
4d301018
JB
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)
849c236b 64+
afbe2a1a
JB
65+ OLDLIBS=$LIBS
66+ LIBS=$LMIBLIBS
67+ AC_CHECK_FUNCS([rpmGetPath])
68+ LIBS=$OLDLIBS
4d301018 69+fi
afbe2a1a 70 fi
5431ee70 71
4d301018 72 #
849c236b
AM
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
39132f8f 75@@ -114,15 +114,6 @@
849c236b
AM
76 # (Agent)
77 ##
78
79-# rpmGetPath check needs clean LIBS environment (Linux)
80-#
39132f8f 81-if test "x$with_rpm" != "xno"; then
849c236b
AM
82- OLDLIBS=$LIBS
83- LIBS=$LMIBLIBS
84- AC_CHECK_FUNCS(rpmGetPath)
85- LIBS=$OLDLIBS
5431ee70 86-fi
39132f8f 87-
849c236b
AM
88 # statfs( char *, struct fs_data* ) (Ultrix)
89 #
39132f8f 90 AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
349110c7
ER
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)
b0de23ad
ER
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 */
cd697e1b
AM
115@@ -29,7 +29,7 @@
116 config_require(host/data_access/swinst_apt)
349110c7
ER
117 #elif defined( HAVE_LIBRPM ) && defined( linux )
118 config_require(host/data_access/swinst_rpm)
b59aa974
AM
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 )
349110c7
ER
121 config_require(host/data_access/swinst_pkginfo)
122 #else
123 config_warning(This platform does not yet support hrSWInstalledTable rewrites)
This page took 0.094919 seconds and 4 git commands to generate.