# TODO
# - make noarch -n mibs-net-snmp package (need separate .spec then)
# - FHS: #define NETSNMP_AGENTX_SOCKET "/var/agentx/master"
-# - php-snmp (and likely other bindings) use only %{_libdir}/libnetsnmp.so.*, move other libs back to main (daemon) package?
#
# Conditional build:
%bcond_without autodeps # don't BR packages only for deps resolving
%bcond_without python # don't include Python modules
%bcond_without static_libs # don't build static library
-%ifnarch %{ix86} %{x8664}
+%ifnarch %{ix86} %{x8664} x32
%undefine with_lm_sensors
%endif
Summary(ru.UTF-8): Набор утилит для протокола SNMP от UC-Davis
Summary(uk.UTF-8): Набір утиліт для протоколу SNMP від UC-Davis
Name: net-snmp
-Version: 5.7.2
-Release: 2
+# NOTE: 5.7.x is LTS version
+Version: 5.7.3
+Release: 9
License: BSD-like
Group: Networking/Daemons
Source0: http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
-# Source0-md5: 5bddd02e2f82b62daa79f82717737a14
+# Source0-md5: d4a3459e1577d0efa8d96ca70a885e53
Source1: %{name}d.init
Source2: %{name}d.conf
Source3: %{name}d.sysconfig
Source6: %{name}trapd.sysconfig
Source7: ucd-ipchains.tar.gz
# Source7-md5: 29949f1008f1a04d6efefd5b3ea607da
-Source8: snmpd.upstart
+Source9: snmpd.logrotate
Patch0: %{name}-acfix.patch
Patch1: %{name}-rpm-implicit-libs.patch
Patch2: %{name}-config-noflags.patch
Patch5: %{name}-llinterfaces.patch
Patch6: %{name}-kernel_headers.patch
Patch7: %{name}-rpmpath.patch
-Patch8: %{name}-snmpksm.patch
+Patch8: swinst_apt.patch
Patch9: %{name}-python.patch
Patch10: %{name}-lvalue.patch
Patch11: %{name}-defaultconfig.patch
Patch12: %{name}-use-rpm-hrmib.patch
Patch13: %{name}-TCP_STATS_CACHE_TIMEOUT.patch
-Patch14: %{name}-libnl.patch
-Patch15: %{name}-libpci-init.patch
Patch17: %{name}-logging.patch
URL: http://www.net-snmp.org/
%endif
BuildRequires: rpmbuild(macros) >= 1.527
Requires(post,preun): /sbin/chkconfig
+Requires: %{name}-agent-libs = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: /usr/bin/setsid
Requires: mibs-%{name} = %{version}-%{release}
-Requires: pciutils >= 3.1.7-5
Requires: rc-scripts >= 0.4.3.0
Provides: snmpd
Obsoletes: cmu-snmp
Obsoletes: snmpd
Obsoletes: ucd-snmp
+Conflicts: pciutils < 3.1.7-5
Conflicts: rpm < 4.4.9-43.11
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description libs -l pl.UTF-8
Biblioteki SNMP.
+%package agent-libs
+Summary: The NET-SNMP runtime agent libraries
+Group: Libraries
+Requires: %{name}-libs = %{version}-%{release}
+
+%description agent-libs
+The net-snmp-agent-libs package contains the runtime agent libraries
+for shared binaries and applications.
+
%package devel
Summary: The development environment for the net-snmp project
Summary(es.UTF-8): Archivos de inclusión y bibliotecas para desarrollo en el SNMP de la UCD
Summary(ru.UTF-8): Среда разработки для проекта UCD-SNMP
Summary(uk.UTF-8): Середовище розробки для проекту UCD-SNMP
Group: Development/Libraries
+Requires: %{name}-agent-libs = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: elfutils-devel
%{?with_kerberos5:Requires: heimdal-devel}
Requires: libwrap-devel
%{?with_lm_sensors:Requires: lm_sensors-devel >= 3.0.1}
Requires: openssl-devel >= 0.9.7c
+Requires: pciutils-devel
Obsoletes: ucd-snmp-devel
%description devel
Requires: mibs-dirs
Obsoletes: net-snmp-mibs
Conflicts: ucd-snmp-libs
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description -n mibs-net-snmp
Net-SNMP provided MIBs (Management Information Base).
Summary(uk.UTF-8): Утиліти керування мережею по SNMP з проекту NET-SNMP
Group: Applications/System
Requires: %{name}-libs = %{version}-%{release}
+Requires: %{name}-agent-libs = %{version}-%{release}
Suggests: mibs-%{name} = %{version}-%{release}
Obsoletes: cmu-snmp-utils
Obsoletes: ucd-snmp-utils
Summary: SNMP and NetSNMP::* Perl modules
Summary(pl.UTF-8): Moduły Perla SNMP oraz NetSNMP::*
Group: Development/Languages/Perl
+Requires: %{name}-agent-libs = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Conflicts: ucd-snmp-utils-perl
%patch5 -p1
%patch6 -p1
%patch7 -p1
-%patch8 -p1
+
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
-%patch14 -p1
-%patch15 -p1
%patch17 -p1
# usm is always enabled
%configure \
ac_cv_path_DPKG_QUERY_PATH= \
- --disable-debugging \
--enable-as-needed \
%{__disable static_libs static} \
--with-cflags="%{rpmcflags} %{rpmcppflags} -I/usr/include/et" \
%{__with_without perl perl-modules} \
%{__with_without python python-modules} \
--enable-local-smux \
- --with-mibdirs='$HOME/.snmp/mibs:/usr/share/mibs:%{_datadir}/snmp/mibs' \
+ --with-mibdirs='$HOME/.snmp/mibs:/usr/share/mibs' \
--with-mib-modules="$MIBS" \
--with-security-modules="%{?with_kerberos5:ksm }tsm" \
--with-sys-contact="root@localhost" \
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,snmp},/var/log,/var/lib/net-snmp,%{_libdir}/snmp/dlmod}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,logrotate.d,sysconfig,snmp},/var/log,/var/lib/net-snmp,%{_libdir}/snmp/dlmod}
%{__make} -j1 install \
mibdir=%{_datadir}/mibs \
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmptrapd.conf
cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd
-install -d $RPM_BUILD_ROOT/etc/init
-cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/snmpd.conf
+cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/snmpd
cd perl
%{__make} -j1 install \
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+%post agent-libs -p /sbin/ldconfig
+%postun agent-libs -p /sbin/ldconfig
+
%triggerpostun -- ucd-snmp
/sbin/chkconfig --add snmpd
%attr(754,root,root) /etc/rc.d/init.d/snmpd
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmpd
-%config(noreplace) %verify(not md5 mtime size) /etc/init/snmpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/snmpd
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmpd.conf
%attr(640,root,root) %config(missingok,noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmpd.local.conf
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libnetsnmp.so.*.*.*
-%attr(755,root,root) %{_libdir}/libnetsnmpagent.so.*.*.*
-%attr(755,root,root) %{_libdir}/libnetsnmphelpers.so.*.*.*
-%attr(755,root,root) %{_libdir}/libnetsnmpmibs.so.*.*.*
-%attr(755,root,root) %{_libdir}/libnetsnmptrapd.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libnetsnmp.so.%{so_version}
+%dir %{_sysconfdir}/snmp
+%dir %{_datadir}/snmp
+
+%files agent-libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libnetsnmpagent.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libnetsnmpagent.so.%{so_version}
+%attr(755,root,root) %{_libdir}/libnetsnmphelpers.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libnetsnmphelpers.so.%{so_version}
+%attr(755,root,root) %{_libdir}/libnetsnmpmibs.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libnetsnmpmibs.so.%{so_version}
+%attr(755,root,root) %{_libdir}/libnetsnmptrapd.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libnetsnmptrapd.so.%{so_version}
-%dir %{_sysconfdir}/snmp
-%dir %{_datadir}/snmp
%files devel
%defattr(644,root,root,755)
%{perl_vendorarch}/NetSNMP
%dir %{perl_vendorarch}/auto/SNMP
%{perl_vendorarch}/auto/SNMP/autosplit.ix
-%{perl_vendorarch}/auto/SNMP/SNMP.bs
%attr(755,root,root) %{perl_vendorarch}/auto/SNMP/SNMP.so
%dir %{perl_vendorarch}/auto/NetSNMP
%dir %{perl_vendorarch}/auto/NetSNMP/*
%{perl_vendorarch}/auto/NetSNMP/*/autosplit.ix
-%{perl_vendorarch}/auto/NetSNMP/*/*.bs
%attr(755,root,root) %{perl_vendorarch}/auto/NetSNMP/*/*.so
%dir %{perl_vendorarch}/auto/NetSNMP/agent/default_store
%{perl_vendorarch}/auto/NetSNMP/agent/default_store/autosplit.ix
-%{perl_vendorarch}/auto/NetSNMP/agent/default_store/default_store.bs
%attr(755,root,root) %{perl_vendorarch}/auto/NetSNMP/agent/default_store/default_store.so
%{_mandir}/man3/NetSNMP::*.3*
%{_mandir}/man3/SNMP.3*