diff --git a/.gitignore b/.gitignore index d221326..600dd69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.6.tar.gz /net-snmp-5.6.1.tar.gz +/net-snmp-5.7.tar.gz diff --git a/net-snmp-5.5-perl-linking.patch b/net-snmp-5.5-perl-linking.patch index cbf36af..ceb6363 100644 --- a/net-snmp-5.5-perl-linking.patch +++ b/net-snmp-5.5-perl-linking.patch @@ -2,15 +2,15 @@ Remove rpath from net-snmp-config --agent-libs output. -diff -up net-snmp-5.5/net-snmp-config.in.jsaf net-snmp-5.5/net-snmp-config.in ---- net-snmp-5.5/net-snmp-config.in.jsaf 2009-04-04 12:07:39.000000000 +0200 -+++ net-snmp-5.5/net-snmp-config.in 2010-08-19 16:08:28.825276858 +0200 +diff -up net-snmp-5.7/net-snmp-config.in.perl-linking net-snmp-5.7/net-snmp-config.in +--- net-snmp-5.7/net-snmp-config.in.perl-linking 2011-07-02 00:35:46.000000000 +0200 ++++ net-snmp-5.7/net-snmp-config.in 2011-07-07 13:30:01.635798817 +0200 @@ -50,7 +50,7 @@ NSC_LDFLAGS="@LDFLAGS@" - NSC_INCLUDEDIR=${includedir} - NSC_LIBDIR=-L${libdir} + NSC_LIBS="@LIBS@" --NSC_AGENTLIBS="@AGENTLIBS@ @PERLLDOPTS_FOR_APPS@" -+NSC_AGENTLIBS="@AGENTLIBS@" - NSC_PREFIX=$prefix - NSC_EXEC_PREFIX=$exec_prefix - NSC_SRCDIR=@srcdir@ + NSC_LNETSNMPLIBS="@LNETSNMPLIBS@" +-NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@" ++NSC_LAGENTLIBS="@LAGENTLIBS@" + NSC_LMIBLIBS="@LMIBLIBS@" + + NSC_INCLUDEDIR=${includedir} diff --git a/net-snmp-5.6.1-find-librpm.patch b/net-snmp-5.6.1-find-librpm.patch deleted file mode 100644 index f043782..0000000 --- a/net-snmp-5.6.1-find-librpm.patch +++ /dev/null @@ -1,65 +0,0 @@ -From Panu Matilainen: update the code to work with rpm-4.9 -I've applied this patch also upstream. - -diff -up net-snmp-5.6.1/configure.rpm49 net-snmp-5.6.1/configure ---- net-snmp-5.6.1/configure.rpm49 2011-01-14 15:42:47.000000000 +0200 -+++ net-snmp-5.6.1/configure 2011-01-14 15:43:09.000000000 +0200 -@@ -27418,9 +27418,9 @@ $as_echo "$netsnmp_cv_func_rpmdbOpen__rp - - # now check for rpm using the appropriate libraries. - -- { $as_echo "$as_me:$LINENO: checking for library containing rpmGetFilesystemList" >&5 --$as_echo_n "checking for library containing rpmGetFilesystemList... " >&6; } --if test "${netsnmp_cv_func_rpmGetFilesystemList__rpmlibs+set}" = set; then -+ { $as_echo "$as_me:$LINENO: checking for library containing rpmReadConfigFiles" >&5 -+$as_echo_n "checking for library containing rpmReadConfigFiles... " >&6; } -+if test "${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs+set}" = set; then - $as_echo_n "(cached) " >&6 - else - netsnmp_func_search_save_LIBS="$LIBS" -@@ -27441,11 +27441,11 @@ cat >>conftest.$ac_ext <<_ACEOF - #ifdef __cplusplus - extern "C" - #endif --char rpmGetFilesystemList (); -+char rpmReadConfigFiles (); - int - main () - { --return rpmGetFilesystemList (); -+return rpmReadConfigFiles (); - ; - return 0; - } -@@ -27491,11 +27491,11 @@ cat >>conftest.$ac_ext <<_ACEOF - #ifdef __cplusplus - extern "C" - #endif --char rpmGetFilesystemList (); -+char rpmReadConfigFiles (); - int - main () - { --return rpmGetFilesystemList (); -+return rpmReadConfigFiles (); - ; - return 0; - } -@@ -27540,12 +27540,12 @@ rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="${netsnmp_func_search_save_LIBS}" -- netsnmp_cv_func_rpmGetFilesystemList__rpmlibs="${netsnmp_result}" -+ netsnmp_cv_func_rpmReadConfigFiles__rpmlibs="${netsnmp_result}" - fi --{ $as_echo "$as_me:$LINENO: result: $netsnmp_cv_func_rpmGetFilesystemList__rpmlibs" >&5 --$as_echo "$netsnmp_cv_func_rpmGetFilesystemList__rpmlibs" >&6; } -- if test "${netsnmp_cv_func_rpmGetFilesystemList__rpmlibs}" != "no" ; then -- if test "${netsnmp_cv_func_rpmGetFilesystemList__rpmlibs}" != "none required" ; then -+{ $as_echo "$as_me:$LINENO: result: $netsnmp_cv_func_rpmReadConfigFiles__rpmlibs" >&5 -+$as_echo "$netsnmp_cv_func_rpmReadConfigFiles__rpmlibs" >&6; } -+ if test "${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs}" != "no" ; then -+ if test "${netsnmp_cv_func_rpmReadConfigFiles__rpmlibs}" != "none required" ; then - _rpmlibs="${netsnmp_result} ${netsnmp_target_val}" - fi - diff --git a/net-snmp-5.6.1-rpm-modernize.patch b/net-snmp-5.6.1-rpm-modernize.patch deleted file mode 100644 index aadf289..0000000 --- a/net-snmp-5.6.1-rpm-modernize.patch +++ /dev/null @@ -1,114 +0,0 @@ -From Panu Matilainen: update the code to work with rpm-4.9 -I'm waiting for better version from Panu to work with all versions of rpm >= 4.1 -and then I'll post it upstream. - -diff -up net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c.rpm-sanity net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c ---- net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c.rpm-sanity 2010-11-05 12:00:21.000000000 +0200 -+++ net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c 2011-01-18 09:55:44.000000000 +0200 -@@ -34,6 +34,7 @@ - #endif - #ifdef HAVE_RPM_RPMDB_H - #include -+#include - #endif - - #include -@@ -64,14 +65,8 @@ netsnmp_swinst_arch_init(void) - rpmdbpath = rpmGetPath( "%{_dbpath}", NULL ); - dbpath = rpmdbpath; - #else --#ifdef RPMVAR_DBPATH -- rpmReadConfigFiles( NULL, NULL, NULL, 0 ); -- rpmdbpath = rpmGetVar( RPMVAR_DBPATH ); -- dbpath = rpmdbpath; --#else - dbpath = "/var/lib/rpm"; /* Most likely */ - #endif --#endif - - snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); - if (-1 == stat( pkg_directory, &stat_buf )) -@@ -96,32 +91,25 @@ netsnmp_swinst_arch_shutdown(void) - int - netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags) - { -- rpmdb db; -+ rpmts ts; - --#if defined(RPMDBI_PACKAGES) - rpmdbMatchIterator mi; --#else -- int offset; --#endif - Header h; -- char *n, *v, *r, *g; -- int32_t *t; -+ char *nvr; -+ const char *g; - time_t install_time; - size_t date_len; - int rc, i = 1; - netsnmp_swinst_entry *entry; - -- if (rpmdbOpen("", &db, O_RDONLY, 0644)) -- NETSNMP_LOGONCE((LOG_ERR, "rpmdbOpen() failed\n")); -+ ts = rpmtsCreate(); -+ rpmtsSetVSFlags( ts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS)); -+ -+ mi = rpmtsInitIterator( ts, RPMDBI_PACKAGES, NULL, 0); -+ if (mi == NULL) -+ NETSNMP_LOGONCE((LOG_ERR, "rpmdbOpen() failed\n")); - --#if defined(RPMDBI_PACKAGES) -- mi = rpmdbInitIterator( db, RPMDBI_PACKAGES, NULL, 0); - while (NULL != (h = rpmdbNextIterator( mi ))) --#else -- for (offset = rpmdbFirstRecNum( db ); -- offset != 0; -- offset = rpmdbNextRecNum( db, offset )) --#endif - { - - entry = netsnmp_swinst_entry_create( i++ ); -@@ -129,35 +117,27 @@ netsnmp_swinst_arch_load( netsnmp_contai - continue; /* error already logged by function */ - rc = CONTAINER_INSERT(container, entry); - --#if defined(RPMDBI_PACKAGES) - h = headerLink( h ); --#else -- h = rpmdbGetRecord( db, offset ); --#endif -- headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL); -- headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL); -- headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL); -- headerGetEntry( h, RPMTAG_GROUP, NULL, (void**)&g, NULL); -- headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL); -+ nvr = headerGetAsString( h, RPMTAG_NVR); -+ g = headerGetString( h, RPMTAG_GROUP); -+ install_time = headerGetNumber( h, RPMTAG_INSTALLTIME); - - entry->swName_len = snprintf( entry->swName, sizeof(entry->swName), -- "%s-%s-%s", n, v, r); -+ "%s", nvr); - if (entry->swName_len > sizeof(entry->swName)) - entry->swName_len = sizeof(entry->swName); - entry->swType = (NULL != strstr( g, "System Environment")) - ? 2 /* operatingSystem */ - : 4; /* application */ - -- install_time = *t; - entry->swDate_len = snprintf( entry->swDate, sizeof(entry->swDate), - "%s", date_n_time( &install_time, &date_len )); - - headerFree( h ); -+ free(nvr); - } --#if defined(RPMDBI_PACKAGES) - rpmdbFreeIterator( mi ); --#endif -- rpmdbClose( db ); -+ rpmtsFree( ts ); - - DEBUGMSGTL(("swinst:load:arch", "loaded %d entries\n", - (int)CONTAINER_SIZE(container))); diff --git a/net-snmp.spec b/net-snmp.spec index fc4efcb..f68841a 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,8 +10,8 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.6.1 -Release: 7%{?dist} +Version: 5.7 +Release: 1%{?dist} Epoch: 1 License: BSD @@ -34,9 +34,7 @@ Patch4: net-snmp-5.5-include-struct.patch Patch5: net-snmp-5.5-apsl-copying.patch Patch6: net-snmp-5.5-perl-linking.patch Patch7: net-snmp-5.6-test-debug.patch -Patch8: net-snmp-5.6.1-find-librpm.patch -Patch9: net-snmp-5.6.1-rpm-modernize.patch -Patch10: net-snmp-5.6.1-mysql.patch +Patch8: net-snmp-5.6.1-mysql.patch Requires(post): chkconfig Requires(preun): chkconfig @@ -168,10 +166,12 @@ Net-SNMP toolkit library. %patch4 -p1 -b .include-struct %patch5 -p1 -b .apsl %patch6 -p1 -b .perl-linking -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -b .mysql +# Following patch removes -Wl,-rpath,/usr/lib64/perl5/CORE from +# net-snmp-config --agent-libs output. As for Fedora 15, this +# rpath is needed to link subagents, because libperl.so is in +# non-default directory - so leave the rpath there. +#%patch7 -p1 +%patch8 -p1 -b .mysql %ifarch sparc64 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 @@ -421,6 +421,7 @@ rm -rf ${RPM_BUILD_ROOT} %attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1* %{perl_vendorarch}/*SNMP* %{perl_vendorarch}/auto/*SNMP* +%{perl_vendorarch}/auto/Bundle/*SNMP* %files python %defattr(-,root,root,-) @@ -441,6 +442,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_datadir}/snmp/mibs/* %changelog +* Thu Jul 7 2011 Jan Safranek - 1:5.7-1 +- updated to net-snmp-5.7 + * Wed Mar 23 2011 Jan Safranek - 1:5.6.1-7 - Rebuild against newer mysql diff --git a/sources b/sources index f06411b..29eade4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b4e30ead5783b0bb1d280172c6095ea4 net-snmp-5.6.1.tar.gz +1038e960d6d616c64c0979180daf0e19 net-snmp-5.7.tar.gz