SOURCES: net-snmp-use-rpm-hrmib.patch - update autofoo not to link with rpm...
glen
glen at pld-linux.org
Thu May 15 12:09:30 CEST 2008
Author: glen Date: Thu May 15 10:09:30 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- update autofoo not to link with rpm at all if using hrmib export from rpm
---- Files affected:
SOURCES:
net-snmp-use-rpm-hrmib.patch (1.1 -> 1.2)
---- Diffs:
================================================================
Index: SOURCES/net-snmp-use-rpm-hrmib.patch
diff -u SOURCES/net-snmp-use-rpm-hrmib.patch:1.1 SOURCES/net-snmp-use-rpm-hrmib.patch:1.2
--- SOURCES/net-snmp-use-rpm-hrmib.patch:1.1 Wed Feb 20 20:28:17 2008
+++ SOURCES/net-snmp-use-rpm-hrmib.patch Thu May 15 12:09:24 2008
@@ -1,21 +1,109 @@
---- net-snmp-5.4.1/agent/mibgroup/host/hr_swinst.c~ 2008-02-20 20:14:05.000000000 +0200
-+++ net-snmp-5.4.1/agent/mibgroup/host/hr_swinst.c 2008-02-20 20:19:07.078169853 +0200
-@@ -5,6 +5,8 @@
-
- #include <net-snmp/net-snmp-config.h>
-
-+#undef HAVE_LIBRPM
-+
- #if HAVE_SYS_PARAM_H
- #include <sys/param.h>
- #endif
-@@ -183,6 +185,9 @@
+--- net-snmp-5.4.1/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:05:07.575307614 +0300
++++ net-snmp-5.4.1.hrmib/agent/mibgroup/host/hr_swinst.c 2008-05-15 13:04:24.676830108 +0300
+@@ -183,6 +183,10 @@
#define _PATH_HRSW_directory "/var/db/pkg"
#endif
-+#undef _PATH_HRSW_directory
-+#define _PATH_HRSW_directory "/var/cache/hrmib"
++#if defined(RPM_HRMIB_PATH)
++#define _PATH_HRSW_directory RPM_HRMIB_PATH
++#endif
+
void
init_hr_swinst(void)
{
+--- net-snmp-5.4.1/configure.in 2008-05-15 13:05:07.559306690 +0300
++++ net-snmp-5.4.1.hrmib/configure.in 2008-05-15 13:04:24.684830570 +0300
+@@ -2768,25 +2768,41 @@
+ fi
+ ])
+
+-AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
+
+-AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
+-AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
+-
+-if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
+- if test "x$with_rpm" = "xyes" ; then
+- AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
+- else
+- with_rpm=no
+- fi
++# check if we can use rpm hrmib export
++if test "$with_rpm" != "no" ; then
++ AC_PATH_PROG([RPM], rpm)
++ if test -n "$RPM"; then
++ changequote(, )
++ RPM_HRMIB_PATH=$($RPM -E %{_hrmib_path} | sed -e 's,/[^/]\+$,,')
++ changequote([, ])
++ if test -n "$RPM_HRMIB_PATH"; then
++ AC_DEFINE_UNQUOTED([RPM_HRMIB_PATH], ["$RPM_HRMIB_PATH"], [Directory where RPM exports packages hrmib information])
++ fi
++ fi
+ fi
+
++# otherwise try binary linkin
++if test -z "$RPM_HRMIB_PATH"; then
++ AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
++
++ AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
++ AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
++
++ if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
++ if test "x$with_rpm" = "xyes" ; then
++ AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
++ else
++ with_rpm=no
++ fi
++ fi
+ #
+ # rpm libraries only needed for the host resources mib software
+ # installed tables (on linux in particular)
+ #
+ if test "x$with_rpm" != "xno" && \
+ echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
++
+ # ARG. RPM is a real pain.
+ # FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
+ _rpmlibs=""
+@@ -2835,7 +2851,14 @@
+ CFLAGS="$CFLAGS -I/usr/include/rpm"
+ ],,-lrpm $_rpmlibs)
+ ])
++
++ OLDLIBS=$LIBS
++ LIBS=$LMIBLIBS
++ AC_CHECK_FUNCS(rpmGetPath)
++ LIBS=$OLDLIBS
+ fi
++
++fi # with rpmlib
+
+ # libkvm
+ AC_CHECK_LIB(kvm, kvm_read, [_libkvm="-lkvm"])
+@@ -3406,12 +3429,6 @@
+ # table_array helper support
+ AC_CHECK_HEADERS(search.h)
+
+-# RPM subdirectory path (sigh)
+-if test "x$with_rpm" != "xno" && \
+- echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
+- AC_CHECK_HEADERS(rpm/rpmdb.h)
+-fi
+-
+ # OpenBSD 2.6 needs netinet/in.h before netinet/in_pcb.h
+ AC_MSG_CHECKING([[for netinet/in_pcb.h]])
+ AC_CACHE_VAL(cv_have_netinet_in_pcb_h,
+@@ -3633,13 +3650,6 @@
+ AC_CHECK_FUNCS(random lrand48 rand)
+ AC_CHECK_FUNCS(execv system fork getpid strncasecmp sigalrm)
+ AC_CHECK_FUNCS(lseek64 pread64)
+-if test "x$with_rpm" != "xno" && \
+- echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
+- OLDLIBS=$LIBS
+- LIBS=$LMIBLIBS
+- AC_CHECK_FUNCS(rpmGetPath)
+- LIBS=$OLDLIBS
+-fi
+
+ AC_CHECK_FUNCS(getloadavg)
+ AC_CHECK_FUNCS(getaddrinfo getipnodebyname gai_strerror)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/net-snmp-use-rpm-hrmib.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list