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.4.1/configure.in 2008-05-15 13:05:07.559306690 +0300
15 +++ net-snmp-5.4.1.hrmib/configure.in 2008-05-15 13:04:24.684830570 +0300
16 @@ -2768,25 +2768,41 @@
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])
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
36 + RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,')
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])
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])
59 # rpm libraries only needed for the host resources mib software
60 # installed tables (on linux in particular)
62 if test "x$with_rpm" != "xno" && \
63 echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
65 # ARG. RPM is a real pain.
66 # FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
68 @@ -2835,7 +2851,14 @@
69 CFLAGS="$CFLAGS -I/usr/include/rpm"
75 + AC_CHECK_FUNCS(rpmGetPath)
82 AC_CHECK_LIB(kvm, kvm_read, [_libkvm="-lkvm"])
83 @@ -3406,12 +3429,6 @@
84 # table_array helper support
85 AC_CHECK_HEADERS(search.h)
87 -# RPM subdirectory path (sigh)
88 -if test "x$with_rpm" != "xno" && \
89 - echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
90 - AC_CHECK_HEADERS(rpm/rpmdb.h)
93 # OpenBSD 2.6 needs netinet/in.h before netinet/in_pcb.h
94 AC_MSG_CHECKING([[for netinet/in_pcb.h]])
95 AC_CACHE_VAL(cv_have_netinet_in_pcb_h,
96 @@ -3633,13 +3650,6 @@
97 AC_CHECK_FUNCS(random lrand48 rand)
98 AC_CHECK_FUNCS(execv system fork getpid strncasecmp sigalrm)
99 AC_CHECK_FUNCS(lseek64 pread64)
100 -if test "x$with_rpm" != "xno" && \
101 - echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
104 - AC_CHECK_FUNCS(rpmGetPath)
108 AC_CHECK_FUNCS(getloadavg)
109 AC_CHECK_FUNCS(getaddrinfo getipnodebyname gai_strerror)