X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=net-snmp.spec;h=2714e82f5cab5351f94c9fa371e4d0e7fa1721c0;hb=74870994fe578d147ecf5f827e09561134e36f7a;hp=780e60b1c98103ec00c73fb0d2b405321ce1e3ba;hpb=ee5235da003bcdc33bc011f0d7c85cc9757797f7;p=packages%2Fnet-snmp.git diff --git a/net-snmp.spec b/net-snmp.spec index 780e60b..2714e82 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -1,3 +1,6 @@ +# TODO +# - make noarch -n mibs-net-snmp package (need separate .spec then) +# - FHS: #define NETSNMP_AGENTX_SOCKET "/var/agentx/master" # # Conditional build: %bcond_without autodeps # don't BR packages only for deps resolving @@ -7,7 +10,12 @@ %bcond_without perl # don't include Perl modules and utils %bcond_without python # don't include Python modules %bcond_without static_libs # don't build static library -# + +%ifnarch %{ix86} %{x8664} x32 +%undefine with_lm_sensors +%endif + +%define so_version 30 %include /usr/lib/rpm/macros.perl Summary: A collection of SNMP protocol tools Summary(es.UTF-8): Agente SNMP de la UCD @@ -16,12 +24,13 @@ Summary(pt_BR.UTF-8): Agente SNMP da UCD Summary(ru.UTF-8): Набор утилит для протокола SNMP от UC-Davis Summary(uk.UTF-8): Набір утиліт для протоколу SNMP від UC-Davis Name: net-snmp -Version: 5.4.2.1 -Release: 11 +# NOTE: 5.7.x is LTS version +Version: 5.7.3 +Release: 9 License: BSD-like Group: Networking/Daemons -Source0: http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz -# Source0-md5: 984932520143f0c8bf7b7ce1fc9e1da1 +Source0: http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz +# Source0-md5: d4a3459e1577d0efa8d96ca70a885e53 Source1: %{name}d.init Source2: %{name}d.conf Source3: %{name}d.sysconfig @@ -30,6 +39,7 @@ Source5: %{name}trapd.conf Source6: %{name}trapd.sysconfig Source7: ucd-ipchains.tar.gz # Source7-md5: 29949f1008f1a04d6efefd5b3ea607da +Source9: snmpd.logrotate Patch0: %{name}-acfix.patch Patch1: %{name}-rpm-implicit-libs.patch Patch2: %{name}-config-noflags.patch @@ -38,26 +48,26 @@ Patch4: %{name}-link.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 -Patch14: %{name}-lm_sensors_3.patch -Patch15: %{name}-subcontainer.patch -Patch16: %{name}-netlink.patch -Patch17: %{name}-TCP_STATS_CACHE_TIMEOUT.patch -Patch18: %{name}-src-dst-confusion.patch +Patch13: %{name}-TCP_STATS_CACHE_TIMEOUT.patch + +Patch17: %{name}-logging.patch URL: http://www.net-snmp.org/ -BuildRequires: autoconf >= 2.61-3 +BuildRequires: autoconf >= 2.63 BuildRequires: automake BuildRequires: elfutils-devel %{?with_kerberos5:BuildRequires: heimdal-devel} -BuildRequires: libnl-devel >= 1:1.1 +BuildRequires: libnl-devel >= 1:3.2 +BuildRequires: libssh2-devel BuildRequires: libtool >= 1.4 BuildRequires: libwrap-devel %{?with_lm_sensors:BuildRequires: lm_sensors-devel >= 3.0.1} BuildRequires: openssl-devel >= 0.9.7d +BuildRequires: pciutils-devel %{?with_autodeps:BuildRequires: perl-Term-ReadKey} BuildRequires: perl-devel >= 1:5.8.0 %if %{with python} @@ -70,16 +80,18 @@ BuildRequires: rpm-pythonprov BuildRequires: rpm BuildRequires: rpm-perlprov >= 3.0.3-16 %endif -BuildRequires: rpmbuild(macros) >= 1.268 +BuildRequires: rpmbuild(macros) >= 1.527 Requires(post,preun): /sbin/chkconfig +Requires: %{name}-agent-libs = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} -Requires: %{name}-mibs = %{version}-%{release} Requires: /usr/bin/setsid -Requires: rc-scripts >= 0.2.0 +Requires: mibs-%{name} = %{version}-%{release} +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) @@ -137,7 +149,7 @@ SNMP, утиліти для запросу та встановлення інф Summary: NET SNMP libraries Summary(pl.UTF-8): Biblioteki SNMP Group: Libraries -Requires: %{name}-mibs +Suggests: mibs-%{name} Obsoletes: net-snmp-compat-libs Obsoletes: ucd-snmp-libs @@ -147,6 +159,15 @@ NET SNMP libraries. %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 @@ -155,12 +176,15 @@ Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolvimento n 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: libnl-devel >= 1:3.2 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 @@ -217,7 +241,7 @@ Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolvimento n Summary(ru.UTF-8): Среда разработки для проекта UCD-SNMP Summary(uk.UTF-8): Середовище розробки для проекту UCD-SNMP Group: Development/Libraries -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} Requires: openssl-devel >= 0.9.7d Obsoletes: cmu-snmp-devel Obsoletes: ucd-snmp-devel @@ -268,16 +292,21 @@ Statyczne biblioteki UCD-SNMP. %description compat-static -l pt_BR.UTF-8 Bibliotecas estáticas para desenvolvimento com ucd-snmp. -%package mibs -Summary: MIB database +%package -n mibs-net-snmp +Summary: Net-SNMP provided MIBs Summary(pl.UTF-8): Baza danych MIB Group: Applications/System +Requires: mibs-dirs +Obsoletes: net-snmp-mibs Conflicts: ucd-snmp-libs +%if "%{_rpmversion}" >= "5" +BuildArch: noarch +%endif -%description mibs -MIB database. +%description -n mibs-net-snmp +Net-SNMP provided MIBs (Management Information Base). -%description mibs -l pl.UTF-8 +%description -n mibs-net-snmp -l pl.UTF-8 Baza danych MIB. %package snmptrapd @@ -305,7 +334,8 @@ Summary(ru.UTF-8): Утилиты управления сетью по SNMP из Summary(uk.UTF-8): Утиліти керування мережею по SNMP з проекту NET-SNMP Group: Applications/System Requires: %{name}-libs = %{version}-%{release} -Requires: %{name}-mibs = %{version}-%{release} +Requires: %{name}-agent-libs = %{version}-%{release} +Suggests: mibs-%{name} = %{version}-%{release} Obsoletes: cmu-snmp-utils Obsoletes: ucd-snmp-utils @@ -337,6 +367,7 @@ como: snmpwalk, snmptest e outros. 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 @@ -406,7 +437,6 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1). %prep %setup -q -a7 -%patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 @@ -414,110 +444,119 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1). %patch5 -p1 %patch6 -p1 %patch7 -p1 -%patch8 -p1 + %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 -%patch14 -p0 -%patch15 -p1 -%patch16 -p1 +%patch13 -p1 + %patch17 -p1 -%patch18 -p3 %build %{__libtoolize} -%{__aclocal} +%{__aclocal} -I m4 %{__autoconf} %{__autoheader} cp -f /usr/share/automake/config.sub . + +MIBS="\ +host agentx smux \ +mibII/mta_sendmail \ +disman/event disman/schedule \ +ucd-snmp/diskio \ +target \ +misc/ipfwacc \ +" + +%if %{with lm_sensors} +MIBS="$MIBS ucd-snmp/lmsensorsMib" +%endif + +# ksm must be first in --with-security-modules +# usm is always enabled %configure \ - --disable-debugging \ + ac_cv_path_DPKG_QUERY_PATH= \ --enable-as-needed \ - %{!?with_static_libs:--disable-static} \ - --with-cflags="%{rpmcflags} -I/usr/include/et" \ + %{__disable static_libs static} \ + --with-cflags="%{rpmcflags} %{rpmcppflags} -I/usr/include/et" \ --with-ldflags="%{rpmldflags}" \ --with-defaults \ --with-default-snmp-version=3 \ - %{?with_kerberos5:--with-krb5=%{_prefix}} \ - %{!?with_kerberos5:--without-krb5} \ - --with-openssl=%{_prefix} \ - --with-libwrap=%{_prefix} \ - --with-logfile="%{logfile}" \ - --with-zlib=%{_prefix} \ - --with-bzip2=%{_prefix} \ - --with%{!?with_perl:out}-perl-modules \ - --with%{!?with_python:out}-python-modules \ + %{__with_without kerberos5 krb5} \ + --with-openssl \ + --with-libwrap \ + --with-logfile=%{logfile} \ + --with-zlib\ + --with-bzip2 \ + --with-nl \ + %{__with_without perl perl-modules} \ + %{__with_without python python-modules} \ --enable-local-smux \ - --with-mib-modules="host agentx smux mibII/mta_sendmail \ -%ifarch %{ix86} %{x8664} -%if %{with lm_sensors} - ucd-snmp/lmsensorsMib \ -%endif -%endif - disman/event disman/schedule ucd-snmp/diskio \ - target misc/ipfwacc" \ - %{?with_kerberos5:--with-security-modules="ksm"} \ + --with-mibdirs='$HOME/.snmp/mibs:/usr/share/mibs' \ + --with-mib-modules="$MIBS" \ + --with-security-modules="%{?with_kerberos5:ksm }tsm" \ --with-sys-contact="root@localhost" \ --with-sys-location="Unknown" \ - --with-transports="UDP UDPIPv6 TCP TCPIPv6 Unix Callback" \ + --with-transports="UDP UDPIPv6 TCP TCPIPv6 Unix Callback Alias DTLSUDP TLSTCP SSH" \ --with-persistent-directory="/var/lib/net-snmp" \ --enable-ucd-snmp-compatibility \ --enable-ipv6 \ - --with%{!?with_rpm:out}-rpm + %{!?debug:--disable-debugging} \ + %{__with_without rpm} %{__make} -j1 cd perl - %{__perl} Makefile.PL \ -NET-SNMP-IN-SOURCE=true \ INSTALLDIRS=vendor \ - OPTIMIZE="%{rpmcflags}" \ + OPTIMIZE="%{rpmcflags} %{rpmcppflags}" \ $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.local.conf :> $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmp.conf :> $RPM_BUILD_ROOT%{logfile} -install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd -install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf -install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/snmpd +install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd +cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf +cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/snmpd -install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmptrapd -install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmptrapd.conf -install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd +install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmptrapd +cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmptrapd.conf +cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd -#install agent/mibgroup/ipfwchains/IPFWCHAINS-MIB.txt \ -# $RPM_BUILD_ROOT%{_datadir}/snmp/mibs +cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/snmpd cd perl %{__make} -j1 install \ DESTDIR=$RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version} -install SNMP/examples/*.pl $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version} +install -p SNMP/examples/*.pl $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version} cd .. # IP-Filter (non-Linux) -rm -f $RPM_BUILD_ROOT%{_bindir}/ipf-mod.pl +%{__rm} $RPM_BUILD_ROOT%{_bindir}/ipf-mod.pl +%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Bundle/Makefile.subs.pl rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod -rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/Bundle/Makefile.subs.pl rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Bundle/NetSNMP/.packlist %if %{with static_libs} @@ -534,7 +573,7 @@ for a in $RPM_BUILD_ROOT%{_libdir}/libnet*.a; do fi done %else -rm -f $RPM_BUILD_ROOT%{_libdir}/libsnmp.a +%{__rm} $RPM_BUILD_ROOT%{_libdir}/libsnmp.a %endif %if %{with python} @@ -542,8 +581,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libsnmp.a %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/*.py %endif -touch $RPM_BUILD_ROOT%{_datadir}/snmp/mibs/.index - %clean rm -rf $RPM_BUILD_ROOT @@ -562,6 +599,9 @@ fi %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 @@ -582,21 +622,22 @@ fi %files %defattr(644,root,root,755) -%doc README local -%doc ChangeLog EXAMPLE.conf.def EXAMPLE.conf -%doc FAQ NEWS PORTING README.snmpv3 TODO AGENT.txt +%doc AGENT.txt CHANGES COPYING ChangeLog EXAMPLE.conf{,.def} FAQ NEWS README{,.agent-mibs,.agentx,.snmpv3,.sql,.thread} TODO local %attr(754,root,root) /etc/rc.d/init.d/snmpd %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmpd +%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 %attr(755,root,root) %{_sbindir}/snmpd - +%attr(755,root,root) %{_bindir}/net-snmp-create-v3-user +%attr(755,root,root) %{_bindir}/sshtosnmp %dir %{_libdir}/snmp %dir %{_libdir}/snmp/dlmod - +%attr(755,root,root) %{_datadir}/snmp/snmp_perl.pl +%{_mandir}/man1/net-snmp-create-v3-user.1* %{_mandir}/man5/snmpd.conf.5* %{_mandir}/man5/snmpd.examples.5* %{_mandir}/man5/snmpd.internal.5* @@ -609,17 +650,21 @@ fi %files libs %defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libnetsnmp.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libnetsnmp.so.%{so_version} %dir %{_sysconfdir}/snmp -%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.15 -%attr(755,root,root) %ghost %{_libdir}/libnetsnmpagent.so.15 -%attr(755,root,root) %ghost %{_libdir}/libnetsnmphelpers.so.15 -%attr(755,root,root) %ghost %{_libdir}/libnetsnmpmibs.so.15 -%attr(755,root,root) %ghost %{_libdir}/libnetsnmptrapd.so.15 +%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} %files devel %defattr(644,root,root,755) @@ -647,7 +692,11 @@ fi %if %{with static_libs} %files static %defattr(644,root,root,755) -%{_libdir}/libnet*.a +%{_libdir}/libnetsnmp.a +%{_libdir}/libnetsnmpagent.a +%{_libdir}/libnetsnmphelpers.a +%{_libdir}/libnetsnmpmibs.a +%{_libdir}/libnetsnmptrapd.a %endif %files compat-devel @@ -662,11 +711,9 @@ fi %{_libdir}/libsnmp.a %endif -%files mibs +%files -n mibs-net-snmp %defattr(644,root,root,755) -%dir %{_datadir}/snmp -%{_datadir}/snmp/mibs/*.txt -%ghost %{_datadir}/snmp/mibs/.index +%{_datadir}/mibs/*.txt %files snmptrapd %defattr(644,root,root,755) @@ -682,6 +729,7 @@ fi %files utils %defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/agentxtrap %attr(755,root,root) %{_bindir}/encode_keychange %attr(755,root,root) %{_bindir}/snmpbulkget %attr(755,root,root) %{_bindir}/snmpbulkwalk @@ -695,11 +743,13 @@ fi %attr(755,root,root) %{_bindir}/snmpstatus %attr(755,root,root) %{_bindir}/snmptable %attr(755,root,root) %{_bindir}/snmptest +%attr(755,root,root) %{_bindir}/snmptls %attr(755,root,root) %{_bindir}/snmptranslate %attr(755,root,root) %{_bindir}/snmptrap %attr(755,root,root) %{_bindir}/snmpusm %attr(755,root,root) %{_bindir}/snmpvacm %attr(755,root,root) %{_bindir}/snmpwalk +%{_mandir}/man1/agentxtrap.1* %{_mandir}/man1/encode_keychange.1* %{_mandir}/man1/snmpbulkget.1* %{_mandir}/man1/snmpbulkwalk.1* @@ -732,16 +782,13 @@ fi %{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* @@ -750,9 +797,12 @@ fi %files utils-perl %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/fixproc +%attr(755,root,root) %{_bindir}/net-snmp-cert +%attr(755,root,root) %{_bindir}/snmp-bridge-mib %attr(755,root,root) %{_bindir}/snmpcheck %attr(755,root,root) %{_bindir}/traptoemail %{_mandir}/man1/fixproc.1* +%{_mandir}/man1/snmp-bridge-mib.1* %{_mandir}/man1/traptoemail.1* %endif