From c146ec099569eab9f38321a7170a37726b442a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Vok=C3=A1l?= Date: Tue, 28 Nov 2006 07:40:28 +0000 Subject: [PATCH] upgrade to 5.4, patch cleanup --- net-snmp-5.4-64bit.patch | 226 +++++++++++++++++++++++++++++++ net-snmp-5.4-config_libdir.patch | 100 ++++++++++++++ net-snmp.spec | 74 +++++----- 3 files changed, 357 insertions(+), 43 deletions(-) create mode 100644 net-snmp-5.4-64bit.patch create mode 100644 net-snmp-5.4-config_libdir.patch diff --git a/net-snmp-5.4-64bit.patch b/net-snmp-5.4-64bit.patch new file mode 100644 index 0000000..96b0610 --- /dev/null +++ b/net-snmp-5.4-64bit.patch @@ -0,0 +1,226 @@ +--- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c.64bit 2006-10-18 04:59:10.000000000 +0200 ++++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c 2006-11-27 13:56:30.000000000 +0100 +@@ -218,6 +218,7 @@ + oid newname[MAX_OID_LEN]; + int i, rtest, newlen; + static long long_ret; ++ static in_addr_t addr_ret; + char buf[SNMP_MAXBUF]; + static char buf2[SNMP_MAXBUF]; + static oid objid[MAX_OID_LEN]; +@@ -366,13 +367,13 @@ + *var_len = 0; + return (NULL); + } +- long_ret = ++ addr_ret = + (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) + + (objid[2] << 8) + objid[3]; +- long_ret = htonl(long_ret); +- *var_len = sizeof(long_ret); ++ addr_ret = htonl(addr_ret); ++ *var_len = sizeof(addr_ret); + vp->type = ASN_IPADDRESS; +- return ((unsigned char *) &long_ret); ++ return ((unsigned char *) &addr_ret); + } + } + *var_len = 0; +--- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c.64bit 2005-08-18 02:44:02.000000000 +0200 ++++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c 2006-11-27 13:56:30.000000000 +0100 +@@ -287,6 +287,7 @@ + oid newname[MAX_OID_LEN]; + int i, rtest, fd, newlen; + static long long_ret; ++ static in_addr_t addr_ret; + char buf[SNMP_MAXBUF]; + static char buf2[SNMP_MAXBUF]; + static oid objid[MAX_OID_LEN]; +@@ -412,13 +413,13 @@ + *var_len = 0; + return (NULL); + } +- long_ret = ++ addr_ret = + (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) + + (objid[2] << 8) + objid[3]; +- long_ret = htonl(long_ret); +- *var_len = sizeof(long_ret); ++ addr_ret = htonl(addr_ret); ++ *var_len = sizeof(addr_ret); + vp->type = ASN_IPADDRESS; +- return ((unsigned char *) &long_ret); ++ return ((unsigned char *) &addr_ret); + } + } + *var_len = 0; +--- net-snmp-5.4/agent/mibgroup/mibII/at.c.64bit 2006-11-07 00:43:27.000000000 +0100 ++++ net-snmp-5.4/agent/mibgroup/mibII/at.c 2006-11-27 13:59:46.000000000 +0100 +@@ -126,9 +126,9 @@ + #ifndef solaris2 + static void ARP_Scan_Init(void); + #ifdef ARP_SCAN_FOUR_ARGUMENTS +-static int ARP_Scan_Next(u_long *, char *, u_long *, u_short *); ++static int ARP_Scan_Next(u_int *, char *, u_long *, u_short *); + #else +-static int ARP_Scan_Next(u_long *, char *, u_long *); ++static int ARP_Scan_Next(u_int *, char *, u_long *); + #endif + #endif + #endif +@@ -204,7 +204,8 @@ + oid lowest[16]; + oid current[16]; + static char PhysAddr[6], LowPhysAddr[6]; +- u_long Addr, LowAddr, foundone; ++ u_int Addr, LowAddr, foundone; ++ static int addr_ret; + #ifdef ARP_SCAN_FOUR_ARGUMENTS + u_short ifIndex, lowIfIndex = 0; + #endif /* ARP_SCAN_FOUR_ARGUMENTS */ +@@ -314,9 +315,9 @@ + *var_len = sizeof(LowPhysAddr); + return (u_char *) LowPhysAddr; + case IPMEDIANETADDRESS: /* also ATNETADDRESS */ +- *var_len = sizeof(uint32_t); ++ *var_len = sizeof addr_ret; + long_return = LowAddr; +- return (u_char *) & long_return; ++ return (u_char *) & addr_ret; + case IPMEDIATYPE: + *var_len = sizeof long_return; + long_return = lowIfType; +@@ -707,11 +708,11 @@ + + #ifdef ARP_SCAN_FOUR_ARGUMENTS + static int +-ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType, ++ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType, + u_short * ifIndex) + #else + static int +-ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType) ++ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType) + #endif + { + #ifndef NETSNMP_CAN_USE_SYSCTL +--- net-snmp-5.4/agent/mibgroup/mibII/var_route.c.64bit 2006-11-07 00:43:27.000000000 +0100 ++++ net-snmp-5.4/agent/mibgroup/mibII/var_route.c 2006-11-27 14:13:13.000000000 +0100 +@@ -434,6 +434,7 @@ + static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN]; + u_char *cp; + oid *op; ++ static in_addr_t addr_ret; + #if NEED_KLGETSA + struct sockaddr_in *sa; + #endif +@@ -538,13 +539,13 @@ + + switch (vp->magic) { + case IPROUTEDEST: +- *var_len = sizeof(uint32_t); ++ *var_len = sizeof(addr_ret); + #if NEED_KLGETSA + sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst); + return (u_char *) & (sa->sin_addr.s_addr); + #elif defined(hpux11) +- long_return = rt[RtIndex].Dest; +- return (u_char *) & long_return; ++ addr_ret = rt[RtIndex].Dest; ++ return (u_char *) & addr_ret; + #else + return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]-> + rt_dst)->sin_addr.s_addr; +@@ -597,13 +598,13 @@ + long_return = -1; + return (u_char *) & long_return; + case IPROUTENEXTHOP: +- *var_len = sizeof(uint32_t); ++ *var_len = sizeof(addr_ret); + #if NEED_KLGETSA + sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_gateway); + return (u_char *) & (sa->sin_addr.s_addr); + #elif defined(hpux11) +- long_return = rt[RtIndex].NextHop; +- return (u_char *) & long_return; ++ addr_ret = rt[RtIndex].NextHop; ++ return (u_char *) & addr_ret; + #else + return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]-> + rt_gateway)->sin_addr.s_addr; +@@ -649,14 +650,14 @@ + #if NETSNMP_NO_DUMMY_VALUES + return NULL; + #endif +- long_return = 0; ++ addr_ret = 0; + #elif defined(hpux11) +- long_return = rt[RtIndex].Mask; +- return (u_char *) & long_return; ++ addr_ret = rt[RtIndex].Mask; ++ return (u_char *) & addr_ret; + #else /* !NEED_KLGETSA && !hpux11 */ + if (((struct sockaddr_in *) &rthead[RtIndex]->rt_dst)->sin_addr. + s_addr == 0) +- long_return = 0; /* Default route */ ++ addr_ret = 0; /* Default route */ + else { + #ifndef linux + if (!NETSNMP_KLOOKUP(rthead[RtIndex]->rt_ifp, +@@ -681,7 +682,7 @@ + #endif /* linux */ + } + #endif /* NEED_KLGETSA */ +- return (u_char *) & long_return; ++ return (u_char *) & addr_ret; + case IPROUTEINFO: + *var_len = nullOidLen; + return (u_char *) nullOid; +--- net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c.64bit 2003-02-22 05:19:51.000000000 +0100 ++++ net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c 2006-11-27 13:56:30.000000000 +0100 +@@ -22,6 +22,7 @@ + /** a global static we'll make use of a lot to map to the right + datatype to return (which for SNMP integer's is always a long). */ + static u_long long_ret; ++static in_addr_t addr_ret; + + + /* +@@ -32,18 +33,18 @@ + get_ipCidrRouteDest(void *data_context, size_t * ret_len) + { + RTENTRY *ourroute = (RTENTRY *) data_context; +- long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr; +- *ret_len = sizeof(long_ret); +- return &long_ret; ++ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr; ++ *ret_len = sizeof(addr_ret); ++ return &addr_ret; + } + + u_long * + get_ipCidrRouteMask(void *data_context, size_t * ret_len) + { + RTENTRY *ourroute = (RTENTRY *) data_context; +- long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr; +- *ret_len = sizeof(long_ret); +- return &long_ret; ++ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr; ++ *ret_len = sizeof(addr_ret); ++ return &addr_ret; + } + + long * +@@ -59,9 +60,9 @@ + get_ipCidrRouteNextHop(void *data_context, size_t * ret_len) + { + RTENTRY *ourroute = (RTENTRY *) data_context; +- long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr; +- *ret_len = sizeof(long_ret); +- return &long_ret; ++ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr; ++ *ret_len = sizeof(addr_ret); ++ return &addr_ret; + } + + long * diff --git a/net-snmp-5.4-config_libdir.patch b/net-snmp-5.4-config_libdir.patch new file mode 100644 index 0000000..d2a0d39 --- /dev/null +++ b/net-snmp-5.4-config_libdir.patch @@ -0,0 +1,100 @@ +--- net-snmp-5.4/configure.libdir 2006-11-27 14:27:52.000000000 +0100 ++++ net-snmp-5.4/configure 2006-11-27 14:31:34.000000000 +0100 +@@ -5161,7 +5161,7 @@ + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ++ lt_cv_file_magic_test_file=`echo $LIBDIR/libc.so.*` + ;; + esac + else +@@ -5178,15 +5178,15 @@ + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' +- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ++ lt_cv_file_magic_test_file=$LIBDIR/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' +- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ++ lt_cv_file_magic_test_file=$LIBDIR/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' +- lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ lt_cv_file_magic_test_file=$LIBDIR/libc.sl + ;; + esac + ;; +@@ -5222,7 +5222,7 @@ + newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libnls.so ++ lt_cv_file_magic_test_file=$LIBDIR/libnls.so + ;; + + nto-qnx*) +@@ -5249,7 +5249,7 @@ + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ++ lt_cv_file_magic_test_file=`echo $LIBDIR/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all +@@ -8761,13 +8761,13 @@ + fi + rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++if test -z "$aix_libpath"; then aix_libpath="$LIBDIR:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then +- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' ++ hardcode_libdir_flag_spec='${wl}-R $libdir:$LIBDIR:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else +@@ -8822,7 +8822,7 @@ + fi + rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++if test -z "$aix_libpath"; then aix_libpath="$LIBDIR:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -8936,7 +8936,7 @@ + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) +- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' ++ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags $LIBDIR/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9350,7 +9350,7 @@ + shlibpath_overrides_runpath=unknown + version_type=none + dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" ++sys_lib_dlsearch_path_spec="/lib $LIBDIR" + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then +@@ -9363,7 +9363,7 @@ + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + else +- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" ++ sys_lib_search_path_spec="/lib $LIBDIR /usr/local/lib" + fi + need_lib_prefix=unknown + hardcode_into_libs=no diff --git a/net-snmp.spec b/net-snmp.spec index d7e12d3..49022e8 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -2,12 +2,12 @@ # Arches on which we need to prevent arch conflicts on net-snmp-config.h %define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 -%define major_ver 5.3.1 +%define major_ver 5.4 Summary: A collection of SNMP protocol tools and libraries. Name: net-snmp Version: %{major_ver} -Release: 11%{?dist} +Release: 1%{?dist} Epoch: 1 License: BSDish @@ -22,28 +22,15 @@ Source5: ucd5820stat Source6: net-snmp-config.h Source7: net-snmp-config Patch1: ucd-snmp-4.2.4.pre3-mnttab.patch -Patch2: net-snmp-5.0.6-syslog.patch -Patch4: net-snmp-5.0.6-libtool.patch -Patch5: net-snmp-5.0.8-ipv6-sock-close.patch -Patch6: net-snmp-5.0.8-readonly.patch -Patch7: net-snmp-5.1-async-getnext.patch -Patch8: net-snmp-5.1.1-pie.patch -Patch9: net-snmp-5.3.1-64bit.patch -#kills virtual interfaces -#Patch10: net-snmp-5.1.1-ipAdEntIfIndex.patch -Patch12: net-snmp-5.1.2-dir-fix.patch -Patch19: net-snmp-5.2.1-file_offset.patch -Patch21: net-snmp-5.3.0.1-maxsensors.patch -Patch23: net-snmp-5.3-proc_if_inet6.patch -Patch24: net-snmp-5.3-size_t.patch -Patch26: net-snmp-5.3_vendorperl.patch -Patch27: net-snmp-5.3.1-multilib.patch -Patch28: net-snmp-5.3.1-retrans_time.patch -Patch29: net-snmp-5.3.1-config_libdir.patch -Patch30: net-snmp-5.3.1-lm_sensors.patch -Patch31: net-snmp-5.3.1-tcp-udp-mib-byteorder.patch -Patch32: net-snmp-5.3.1-local-addr.patch -Patch33: net-snmp-5.3.1-reachable_ms.patch +#Patch2: net-snmp-5.0.6-libtool.patch +Patch2: net-snmp-5.0.8-ipv6-sock-close.patch +Patch3: net-snmp-5.0.8-readonly.patch +Patch4: net-snmp-5.1.1-pie.patch +Patch5: net-snmp-5.4-64bit.patch +Patch6: net-snmp-5.1.2-dir-fix.patch +Patch7: net-snmp-5.2.1-file_offset.patch +Patch8: net-snmp-5.3.1-multilib.patch +Patch9: net-snmp-5.4-config_libdir.patch Prereq: /sbin/chkconfig Obsoletes: ucd-snmp @@ -130,29 +117,20 @@ and applications. %prep %setup -q -n %{name}-%{major_ver} %patch1 -p1 -b .mnttab -%patch2 -p1 -b .syslog -%patch4 -p1 -b .libtool -%patch5 -p1 -b .ipv6-sock-close -%patch6 -p1 -b .readonly -%patch7 -p1 -b .async-getnext +#default aclocal is ugly!!!! +#%patch2 -p1 -b .libtool +%patch2 -p1 -b .ipv6-sock-close +%patch3 -p1 -b .readonly %ifnarch ia64 -%patch8 -p1 -b .pie +%patch4 -p1 -b .pie %endif -%patch9 -b .64bit -%patch12 -p1 -b .dir-fix -%patch19 -p1 -b .file_offset -%patch21 -p1 -b .maxsensors -%patch23 -p1 -b .proc_if -%patch24 -p1 -b .size_t -%patch27 -p1 -b .multilib -%patch28 -p0 -b .retrans_ms -%patch29 -p1 -b .libdir -%patch30 -p1 -b .lm_sensors -%patch31 -p0 -b .byteorder -%patch32 -p1 -b .local-addr -%patch33 -p1 -b .reachable_ms +%patch5 -p1 -b .64bit +%patch6 -p1 -b .dir-fix +%patch7 -p1 -b .file_offset +%patch8 -p1 -b .multilib +%patch9 -p1 -b .libdir # Do this patch with a perl hack... perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh @@ -337,6 +315,11 @@ rm -rf ${RPM_BUILD_ROOT} %{_bindir}/traptoemail %{_bindir}/mib2c-update %attr(0644,root,root) %{_mandir}/man1/snmp*.1* +%attr(0644,root,root) %{_mandir}/man1/mib2c-update*.1* +%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* +%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1* +%attr(0644,root,root) %{_mandir}/man1/fixproc*.1* + %files devel %defattr(0644,root,root,0755) @@ -345,11 +328,13 @@ rm -rf ${RPM_BUILD_ROOT} /usr/include/* %attr(0644,root,root) %{_mandir}/man3/*.3.* %attr(0755,root,root) %{_bindir}/net-snmp-config* +%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* %files perl -f perl.lst %defattr(-,root,root) %{_bindir}/mib2c %attr(0644,root,root) %{_mandir}/man1/mib2c.1* +%attr(0644,root,root) %{_mandir}/man1/tkmib.1* %attr(0644,root,root) %{_mandir}/man3/*.3pm.* %files libs @@ -357,6 +342,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/lib*.so.* %changelog +* Mon Nov 27 2006 Radek Vokál - 5.4-1 +- upgrade to 5.4 +- patch cleanup - snmpd uses /var/run/snmpd.pid (#211264) * Sun Oct 01 2006 Jesse Keating - 5.3.1-11