# # spec file for package net-snmp (Version 5.4.1) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: net-snmp Version: 5.4.1 Release: 31 # License: BSD 3-Clause; X11/MIT Group: Productivity/Networking/Other # %define pkg_name net-snmp %ifnarch s390 s390x %define with_sensors 1 %endif %define netsnmp_logfile /var/log/net-snmpd.log %define netsnmp_agentx_socket_dir_fhs /var/run/agentx %define netsnmp_agentx_socket_dir_rfc /var/agentx # BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: openssl-devel rpm-devel tcpd-devel %if 0%{?with_sensors} BuildRequires: libsensors3-devel %endif Requires: perl-TermReadKey logrotate PreReq: %insserv_prereq %fillup_prereq /sbin/chkconfig Provides: snmp ucdsnmp Obsoletes: snmp ucdsnmp # Url: http://sourceforge.net/projects/net-snmp Source: %{pkg_name}-%{version}.tar.bz2 Source1: rc.net-snmp Source2: snmpd.conf Source3: README.SuSE Source4: rc.snmptrapd Source5: net-snmp.logrotate Source6: test_installed Source7: net-snmp.sysconfig Source8: net-snmp-rpmlintrc Patch: net-snmp-5.3.0.1-audit.diff Patch1: net-snmp-5.4.1-autoconf.diff # unused patch atm Patch2: net-snmp-5.2.1-socket_path.diff Patch3: net-snmp-5.4.rc2-versinfo.diff Patch4: net-snmp-5.2.1-overflow.diff Patch5: net-snmp-5.2.1.testing.empty_arptable.patch Patch6: net-snmp-5.1.1-pie.patch Patch7: net-snmp-5.3_vendorperl.patch Patch8: net-snmp-5.4_net-snmp-config_headercheck.patch # Summary: SNMP Daemon %description This package was originally based on the CMU 2.1.2.1 snmp code. It has been greatly modified, restructured, enhanced, and fixed. It hardly looks the same as anything that CMU has ever released. It was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from ucd-snmp to net-snmp in November 2000. Authors: -------- Wes Hardaker %package devel Group: Development/Libraries/C and C++ Requires: %{pkg_name} = %{version} Requires: openssl-devel rpm-devel tcpd-devel perl %if 0%{?with_sensors} Requires: libsensors3-devel %endif # Summary: SNMP Daemon %description devel This package was originally based on the CMU 2.1.2.1 snmp code. It has been greatly modified, restructured, enhanced, and fixed. It hardly looks the same as anything that CMU has ever released. It was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from ucd-snmp to net-snmp in November 2000. Authors: -------- Wes Hardaker %package -n libsnmp15 Group: Productivity/Networking/Other Requires: snmp-mibs = %{version} # Summary: Shared Libraries from net-snmp %description -n libsnmp15 This package was originally based on the CMU 2.1.2.1 snmp code. It has been greatly modified, restructured, enhanced, and fixed. It hardly looks the same as anything that CMU has ever released. It was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from ucd-snmp to net-snmp in November 2000. This package holds the shared libraries from the net-snmp package. Authors: -------- Wes Hardaker %package -n snmp-mibs Group: Productivity/Networking/Other # Summary: MIB files from net-snmp %description -n snmp-mibs This package was originally based on the CMU 2.1.2.1 snmp code. It has been greatly modified, restructured, enhanced, and fixed. It hardly looks the same as anything that CMU has ever released. It was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from ucd-snmp to net-snmp in November 2000. This package holds the MIB files from the net-snmp package. Authors: -------- Wes Hardaker %package -n perl-SNMP Group: Development/Libraries/Perl Requires: %{pkg_name} = %{version} %if 0%{?suse_version} > 1020 Requires: perl-base = %{perl_version} %else Requires: perl = %{perl_version} %endif # Summary: Perl-SNMP %description -n perl-SNMP The Perl5 'SNMP' Extension Module v3.1.0 for the UCD SNMPv3 library. Authors: -------- G.S. Marzot %prep %setup -q -n %{pkg_name}-%{version} %patch0 %patch1 %patch2 %patch3 %patch4 %patch5 %patch6 %patch7 %patch8 find -name "CVS" -type d | xargs -r %{__rm} -rfv find -name ".cvsignore" | xargs -r %{__rm} -fv find -name "*.orig" | xargs -r %{__rm} -fv %build #autoconf # possibly add later # --with-python-modules \ => need python-setuptools # ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable export CFLAGS="%{optflags} -fno-strict-aliasing -DNETSNMP_NO_INLINE" export CFLAGS="%{optflags} -fno-strict-aliasing" %if 0%{?suse_version} > 1000 export CFLAGS="$CFLAGS -fstack-protector-all" %endif %configure \ --with-sys-contact="root@localhost" \ --with-mib-modules="misc/ipfwacc \ ucd-snmp/diskio \ %if 0%{?with_sensors} ucd-snmp/lmSensors \ %endif smux" \ --with-persistent-directory=/var/lib/net-snmp \ --with-agentx-socket=%{netsnmp_agentx_socket_dir_fhs}/master \ --with-sys-location="unknown" \ --with-logfile=%{netsnmp_logfile} \ --with-libwrap=%{_prefix} \ --with-defaults \ --enable-shared \ --disable-static \ --enable-as-needed \ --without-root-access \ --enable-local-smux \ --enable-ipv6 \ --enable-ucd-snmp-compatibility %{__make} all %check %ifnarch %arm ulimit -c unlimited %{__make} test ||: %{__make} test TESTOPTS='-P tcp' ||: %endif %{__make} perlmodules ||: LD_RUN_PATH="$PWD/snmplib/.libs" LD_LIBRARY_PATH="${PWD}/snmplib/.libs:${PWD}/agent/.libs:${PWD}/agent/helpers/.libs" %{__make} perltest ||: %install %makeinstall INSTALL_PREFIX=%{buildroot} %{__install} -Dd %{buildroot}/var/log %{buildroot}/var/lib/net-snmp %{buildroot}/usr/lib/net-snmp/agents %{buildroot}%{netsnmp_agentx_socket_dir_fhs} %{__install} -D -m 0755 %{SOURCE1} %{buildroot}/etc/init.d/snmpd %{__install} -D -m 0600 %{SOURCE2} %{buildroot}/etc/snmp/snmpd.conf %{__install} -m 0644 %{SOURCE3} . %{__install} -m 0644 %{SOURCE4} . %{__install} -D -m 0644 %{SOURCE5} %{buildroot}/etc/logrotate.d/net-snmp %{__install} -m 0744 %{SOURCE6} testing/ %{__ln_s} -f /etc/init.d/snmpd %{buildroot}%{_sbindir}/rcsnmpd %{__install} -m 0644 /dev/null %{buildroot}%{netsnmp_logfile} pushd perl %perl_make_install %perl_process_packlist %{__rm} -f %{buildroot}/%{perl_vendorarch}/Bundle/Makefile.subs.pl popd %{__grep} -v "^#define PACKAGE" %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h > \ %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h.new %{__mv} %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h{.new,} %{__install} -D -m 0644 %{S:7} \ %{buildroot}/var/adm/fillup-templates/sysconfig.%{pkg_name} # %{__ln_s} -f %{netsnmp_agentx_socket_dir_fhs} %{buildroot}%{netsnmp_agentx_socket_dir_rfc} # %clean %{__rm} -rf %{buildroot} %preun %stop_on_removal snmpd %post # if we are upgrading from older distros the config should be moved # to the new place CONFD="/etc/snmp" OCONF="/etc/snmpd.conf" NCONF="${CONFD}/snmpd.conf" NCONFB="${CONFD}/snmpd.conf.rpmsave" if [ -e "$OCONF" ] ; then # # in worst case we will get: # /etc/snmp/snmpd.conf - the old /etc/snmpd.conf # /etc/snmp/snmpd.conf.rpmnew - the config of the newly installed package. # /etc/snmp/snmpd.conf.rpmsave - the old /etc/snmp/snmpd.conf # if [ ! -d "$CONFD" ] ; then mkdir "$CONFD" fi # # we dont need to handle the case that /etc/snmp/snmpd.conf # exists. rpm does that for us. # it creates /etc/snmp/snmpd.conf.rpmnew # if [ -e "$NCONF" ] ; then mv "$NCONF" "$NCONFB" echo "warning: /etc/snmp/snmpd.conf backed up as /etc/snmp/snmpd.conf.rpmsave" >&2 fi echo "warning: /etc/snmpd.conf moved to /etc/snmp/snmpd.conf" >&2 mv "$OCONF" "$NCONF" fi # we might be updating from ucdsnmp soon /sbin/chkconfig -c snmpd 2> /dev/null && FIRST_ARG=2 %{fillup_and_insserv snmpd} %postun %restart_on_update snmpd %{insserv_cleanup} %post -n libsnmp15 -p /sbin/ldconfig %postun -n libsnmp15 -p /sbin/ldconfig %files %defattr(-,root,root) %doc AGENT.txt COPYING EXAMPLE.conf EXAMPLE.conf.def %doc FAQ NEWS TODO rc.snmptrapd %doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 README.thread %dir /etc/snmp %config(noreplace) /etc/snmp/snmpd.conf %config /etc/init.d/snmpd %{_bindir}/encode_keychange %{_bindir}/fixproc %{_bindir}/ipf-mod.pl %{_bindir}/net-snmp-config %{_bindir}/snmpbulkget %{_bindir}/snmpbulkwalk %{_bindir}/snmpcheck %{_bindir}/snmpconf %{_bindir}/snmpdelta %{_bindir}/snmpdf %{_bindir}/snmpget %{_bindir}/snmpgetnext %{_bindir}/snmpinform %{_bindir}/snmpnetstat %{_bindir}/snmpset %{_bindir}/snmpstatus %{_bindir}/snmptable %{_bindir}/snmptest %{_bindir}/snmptranslate %{_bindir}/snmptrap %{_bindir}/snmpusm %{_bindir}/snmpvacm %{_bindir}/snmpwalk %{_bindir}/traptoemail %dir %{_prefix}/lib/net-snmp %dir %{_prefix}/lib/net-snmp/agents %{_mandir}/man[158]/* %{_sbindir}/* /var/lib/net-snmp %dir %attr(700,root,root) %{netsnmp_agentx_socket_dir_fhs} %ghost %{netsnmp_logfile} %config(noreplace) /etc/logrotate.d/net-snmp /var/adm/fillup-templates/sysconfig.%{pkg_name} %{netsnmp_agentx_socket_dir_rfc} %files -n snmp-mibs %defattr(-,root,root) %{_datadir}/snmp %files -n libsnmp15 %defattr(-,root,root) %{_libdir}/libsnmp*.so.* %{_libdir}/libnetsnmp*.so.* %files devel %defattr(-,root,root) %doc ChangeLog PORTING %{_mandir}/man3/* %{_includedir}/ucd-snmp %{_includedir}/net-snmp %{_libdir}/libsnmp*.la %{_libdir}/libsnmp*.so %{_libdir}/libnetsnmp*.la %{_libdir}/libnetsnmp*.so %files -n perl-SNMP %defattr(-,root,root) %{perl_vendorarch}/auto/SNMP %{perl_vendorarch}/auto/NetSNMP %{perl_vendorarch}/auto/Bundle %{perl_vendorarch}/SNMP.pm %{perl_vendorarch}/NetSNMP /var/adm/perl-modules/%{name} %{_bindir}/tkmib %{_bindir}/mib2c %{_bindir}/mib2c-update %changelog * Fri Nov 02 2007 - jdelvare@suse.de - libsensors is in a separate package now. * Thu Aug 02 2007 - mrueckert@suse.de - update to 5.4.1 many small fixes. the highlights: - link only needed libraries - memleaks fixed - python bindings (not yet packaged) - rediffed net-snmp-5.4.rc1-autoconf.diff new name net-snmp-5.4.1-autoconf.diff - no longer build against lm_sensors on s390 - split out new packages: libsnmp15, snmp-mibs * Mon Nov 13 2006 - mrueckert@suse.de - update to 5.4.rc2: tons of bugfixes, and new features. just to name a few: - enabled embedded perl - new MIB table to manage net-snmp access control extensions - hal to abstract os specific aspects of the systems - tree matching support for snmptrapd - reworked transport creation in snmplib - using the incoming ip for outgoing packets if possible. - ipv6 aware tcp/udp mibs - removed patches: (all of them are either upstream or obsolete) net-snmp-5.2.1-acinclude.diff net-snmp-5.2.1-acquotation.patch net-snmp-5.2.1-compat.patch net-snmp-5.2.1-localperl.diff net-snmp-5.2.1-perl.diff net-snmp-5.3.0.1-64bit.diff net-snmp-5.3.0.1_agentx_socket_path_doc.patch net-snmp-5.3.0.1_deprecated_sysctl_retrans_time.patch net-snmp-5.3.0.1_disman_mib_crash.patch net-snmp-5.3.0.1_ethtool.patch net-snmp-5.3.0.1_linux_types_header.patch net-snmp-5.3.0.1_missing_ifNumber.patch net-snmp-5.3.0.1_netsnmp_register_mib_crash.patch net-snmp-5.3.0.1_perl_ld_run_path.patch net-snmp-5.3.0.1_sighup_vacm.patch net-snmp-5.3.0.1-smux-trap.diff net-snmp-5.3.0.1.tar.bz2 net-snmp-5.3.0.1_tcpwrapper_log_severity.patch net-snmp-5.3.0.1_testsuite_no_smux.patch net-snmp-5.3.0.1_tunnel_compilation.patch net-snmp-5.3_perl_agent.xs-pointersize.patch net-snmp-5.3_perl-printf.patch net-snmp-5.4_default_store_return_value.patch oid-names2_5.3.patch - added net-snmp-5.4_net-snmp-config_headercheck.patch: warn if net-snmp-config is used but development files are missing. - updated net-snmp-5.2.1-autoconf.diff to apply cleanly against 5.4 new name: net-snmp-5.4.rc1-autoconf.diff - updated net-snmp-5.2.1-versinfo.diff to apply cleanly against 5.4 new name: net-snmp-5.4.rc2-versinfo.diff - added net-snmp-5.4.rc2_perl_SNMP_size_t.patch: dont use int if you want size_t. fixes failures in the perl test suite. * Thu Oct 19 2006 - mrueckert@suse.de - added net-snmp-5.4_default_store_return_value.patch: backport my patch from 5.4 so we can get rid of the build errors. the patch removes/disables dead code. * Fri Aug 04 2006 - mrueckert@suse.de - added net-snmp-5.3.0.1_perl_ld_run_path.patch: the old perl replacement line broke linking of the SNMP libraries into the perl modules. the patch sets the LD_RUN_PATH for the build process to LIBDIR. (#180888) * Thu May 04 2006 - mrueckert@suse.de - added net-snmp-5.3.0.1_sighup_vacm.patch: The snmp agent was broken on SIGHUP. It lost all its MIB informations. (upstream bug: #1473289) - added net-snmp-5.3.0.1_deprecated_sysctl_retrans_time.patch: The snmpd used a deprecated sysctl to get the retransmit time from the kernel. We didnt use this module but the mib library triggered the sysctl. The patch uses retrans_time_ms when available and corrects the correction factor for the old sysctl. (bug: #170140, upstream: #1437287) - reenabled the lmsensors support. was disabled for testing and never reenabled. * Thu Apr 20 2006 - mrueckert@suse.de - net-snmp-5.3.0.1_missing_ifNumber.patch: The 5.3 agent on Linux systems did not implement the 'ifNumber' MIB object. (#159501) * Wed Apr 19 2006 - mrueckert@suse.de - logrotate does not like if the postrotate script returns with a non zero returncode. - add missing "-e" in echo line * Mon Apr 03 2006 - mrueckert@suse.de - dont call "/etc/init.d/snmpd restart". this could start the daemon unconditionally (too large log file). switched to "/etc/init.d/snmpd try-restart" * Mon Apr 03 2006 - mrueckert@suse.de - run logrotate on startup if the logfile is too large. (#131072) * Tue Mar 28 2006 - mrueckert@suse.de - fix compilation with ethtool support. (#155709) - added option to ignore accepted connections (#86634) net-snmp-5.3.0.1_tcpwrapper_log_severity.patch new sysconfig option: SNMPD_LOG_SUCCESSFUL_CONNECTIONS - pass the correct path to configure to set the desired log file - make smux listen to localhost by default. (#116742) - remove confpath patch. (#147808,#159768) * Mon Mar 27 2006 - mrueckert@suse.de - updated and reenabled the audit patch * Fri Mar 17 2006 - mrueckert@suse.de - ported sysconfig options from sles9 SNMPD_LOGLEVEL -> SPECIFY the log level for the snmpd SNMPD_USE_SMUX -> disable SMUX socket * Fri Mar 10 2006 - mrueckert@suse.de - disable embedded perl for now. * Wed Mar 08 2006 - mrueckert@suse.de - added net-snmp-5.3.0.1_agentx_socket_path_doc.patch: fixes: net-snmp snmpd.conf(5) manpage gives wrong default for AgentXSocket (#129437) - ported fix for bug #129923 from sles9 - suppress the error message in the ucd-snmp upgrade script * Wed Feb 22 2006 - mrueckert@suse.de - we move the configs into /etc/snmp [#77935] - removed debugging packages from the build requires. * Thu Feb 16 2006 - mrueckert@suse.de - added net-snmp-5.3.0.1-smux-trap.diff dont loose the value of string variables via smux traps [#150091] * Fri Feb 03 2006 - mrueckert@suse.de - added net-snmp-5.3.0.1_disman_mib_crash.patch o fixes a crash in the disman mib loading - net-snmp-5.3.0.1_netsnmp_register_mib_crash.patch o dont crash while registering mibs - net-snmp-5.3_perl_agent.xs-pointersize.patch o dont use int if you mean intptr_t(IV) - net-snmp-5.3_perl-printf.patch o unused format specifier in printf - net-snmp-5.3_vendorperl.patch o do make install_vendor * Wed Jan 25 2006 - mrueckert@suse.de - removed net-snmp-5.2.1-cmdline.diff better solution from upstream * Wed Jan 25 2006 - mls@suse.de - converted neededforbuild to BuildRequires * Mon Jan 23 2006 - mrueckert@suse.de - update to version 5.3.0.1 - removed patches that got applied upstream or superseeded by upstream fixes: net-snmp-5.2.1-uptime.diff net-snmp-5.2.1-typeclash.diff net-snmp-5.2.1-gcc.diff net-snmp-5.2.1-dlopen-conf.diff net-snmp-5.2.1-enomedium.diff net-snmp-5.2.1-mktemp.diff net-snmp-5.2.1-close-all-fds.diff net-snmp-5.2.1-more-cpus.diff net-snmp-5.2.1-nowraplibs.patch net-snmp-5.2.1.set-var-value.patch - added 4 new patches: net-snmp-5.3_perl_agent.xs-pointersize.patch - fixes some casts of pointers to ints -> segfaults in the test suite net-snmp-5.3_perl-printf.patch - fixes a printf warning net-snmp-5.3_vendorperl.patch - call perl modules install with install_vendor net-snmp-5.1.1-pie.patch - build snmpd and snmptrapd with pie * Tue Nov 15 2005 - uli@suse.de - no point in running the test suite in QEMU * Wed Sep 07 2005 - mrueckert@suse.de - Added rpm-devel to the requires of the -devel package * Fri Jun 17 2005 - mrueckert@suse.de - added disman/event-mib to the mib list (Bug #91039) - replaced patch25 (asn1 handling fix) with patch from the upstream. (Bug #73804) - build snmpd and snmptrap with with -fpie/-pie * Fri Jun 10 2005 - mrueckert@suse.de - Fixed test suite for boxes with empty arp tables. * Tue May 17 2005 - hvogel@suse.de - Include the right header for compat mode (Bug #64074) - Fix length for type ASN_UNSIGNED (Bug #73804) - Get rid of WRAPLIBS in net-snmp-config (Bug #75879) - Fix ac quotation * Tue Feb 22 2005 - meissner@suse.de - moved tkmib and mib2c* to perl subpackage, since they require it. #63992 * Wed Feb 16 2005 - meissner@suse.de - Multiple non Intel CPU detection added. * Sun Feb 06 2005 - meissner@suse.de - Upgraded to 5.1.2 release. (lots of bugfixes as usual) * Wed Feb 02 2005 - meissner@suse.de - overflow counter32 and gauge32 on 64bit systems correctly. #50384 * Fri Nov 26 2004 - meissner@suse.de - close all non standard filedescriptors on start. * Thu Nov 25 2004 - meissner@suse.de - Upgraded to 5.2 final. * Mon Oct 25 2004 - meissner@suse.de - Upgraded to 5.2.1rc2. Dropped merged patches, rediffed old ones. * Tue Aug 17 2004 - coolo@suse.de - fixing pre-requires * Thu Aug 12 2004 - meissner@suse.de - Upgrade to 5.1.2 final. * Thu Jul 29 2004 - meissner@suse.de - Upgraded to upstream 5.1.2.rc2. * Fri Jul 23 2004 - meissner@suse.de - Upgraded to 5.1.2.rc1. - Dropped some old patches / parts of old patches. - Fixed problem on little endian 64bit machines. * Thu Jul 15 2004 - meissner@suse.de - removed double free on failure in netsnmp_register_old_api(). (bug #42580) - do not specify -c /etc/snmpd.conf (since it is already built in). (bug #41706) - require openssl-devel in -devel package. * Tue Jul 06 2004 - meissner@suse.de - replaced undefined C construct (x[n] = y[n++]) which caused the testsuite to fail on i386. * Mon Jul 05 2004 - uli@suse.de - sleep .3 s before starting agents (bug #42588) * Wed Jun 30 2004 - meissner@suse.de - Fixed 2 places of file descriptor leakage which lead to segfaults during readdir/fgets. #33958 * Fri Mar 19 2004 - meissner@suse.de - remove the #define PACKAGE_ from the included autoconf generated config.h file. #36355 * Fri Mar 19 2004 - ro@suse.de - use stop_on_removal and restart_on_update macros (#36306) - package /var/log/net-snmp as %%ghost (#36435) * Tue Mar 16 2004 - ro@suse.de - use mktemp in fixproc (#36103) * Mon Mar 15 2004 - ro@suse.de - avoid segfault in version-info (limit to 300 bytes) - open devices with NONBLOCK, don't wait for cdrom - avoid segfault in proc-cmdline output * Mon Feb 16 2004 - ro@suse.de - previous 64-bit fix went just one bit too far, fixed * Wed Feb 11 2004 - ro@suse.de - added smux mib (for quagga) * Mon Feb 09 2004 - ro@suse.de - fix dlopen detection in configure * Wed Feb 04 2004 - ro@suse.de - added requires for perl-TermReadKey * Tue Jan 20 2004 - ro@suse.de - try to fix at least some 64bit issues (eg. #33958) * Thu Jan 15 2004 - ro@suse.de - update arguments in rc-script * Fri Jan 09 2004 - kukuk@suse.de - Fix some 64bit critical compiler warnings * Fri Dec 12 2003 - hare@suse.de - Fixed includes for build with evlog. * Fri Nov 14 2003 - ro@suse.de - update to 5.1 * Fri Nov 14 2003 - ro@suse.de - build perl module as perl-SNMP * Fri Nov 14 2003 - ro@suse.de - enable ucd-snmp compatibility * Thu Oct 23 2003 - ro@suse.de - update to 5.1.pre2 * Thu Oct 23 2003 - ro@suse.de - revised audit patch - branched devel subpackage - added rpm support * Wed Oct 22 2003 - ro@suse.de - created package and ported patches from ucd-snmp