]> git.pld-linux.org Git - packages/net-snmp.git/blobdiff - net-snmp.spec
- install Standard MIBs (Required by Juniper MIBs)
[packages/net-snmp.git] / net-snmp.spec
index c095ef34c1959a050fa5f251c50ddc4f9c8948a0..759ddbc7adacebc55493b68c6f24aa01096fc15f 100644 (file)
@@ -1,14 +1,3 @@
-# TODO:
-# - init scripts
-# - default configs
-# - review %%files (add missing)
-# - review Requires:
-# - review Obsoletes:
-# - review Provides:
-# - review ucd patches:
-# -- ia64
-# -- init_master-libwrap
-# - /usr/local/bin/perl fix
 #
 # Conditional build:
 %bcond_without autodeps        # don't BR packages only for deps resolving
@@ -21,12 +10,12 @@ Summary(pt_BR):     Agente SNMP da UCD
 Summary(ru):   îÁÂÏÒ ÕÔÉÌÉÔ ÄÌÑ ÐÒÏÔÏËÏÌÁ SNMP ÏÔ UC-Davis
 Summary(uk):   îÁ¦ҠÕÔÉ̦ԠÄÌÑ ÐÒÏÔÏËÏÌÕ SNMP ×¦Ä UC-Davis
 Name:          net-snmp
-Version:       5.1
-Release:       0.2
+Version:       5.2.1.2
+Release:       1.1
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
-# Source0-md5: 14217471edb2b805b0e28c4c3cfd8c75
+# Source0-md5: 34159770a7fe418d99fdd416a75358b1
 Source1:       %{name}d.init
 Source2:       %{name}d.conf
 Source3:       %{name}d.sysconfig
@@ -35,6 +24,8 @@ Source5:      %{name}trapd.conf
 Source6:       %{name}trapd.sysconfig
 Source7:       ftp://ucd-snmp.ucdavis.edu/contrib/ucd-ipchains.tar.gz
 # Source7-md5: 29949f1008f1a04d6efefd5b3ea607da
+Source8:       http://juniper.net/techpubs/software/junos/junos73/juniper-mibs-7.3R1.6.tgz
+# Source8-md5: 380f8475a7f71e093b1dc98e4976c106
 Patch0:                %{name}-acinclude.patch
 Patch1:                %{name}-acfix.patch
 Patch2:                %{name}-rpm-implicit-libs.patch
@@ -44,19 +35,23 @@ Patch5:             %{name}-manpage.patch
 Patch6:                %{name}-link.patch
 Patch7:                %{name}-llinterfaces.patch
 Patch8:                %{name}-usr_local_bin_perl.patch
+Patch9:                %{name}-kernel_headers.patch
+Patch10:       %{name}-syntax.patch
+Patch11:       %{name}-fix-insecure-fixproc.patch
 URL:           http://www.net-snmp.org/
 BuildRequires: autoconf >= 2.57-3
 BuildRequires: automake
 BuildRequires: elfutils-devel
 BuildRequires: libtool >= 1.4
 BuildRequires: libwrap-devel
-BuildRequires: openssl-devel >= 0.9.7c
+BuildRequires: openssl-devel >= 0.9.7d
 %{?with_autodeps:BuildRequires:        perl-Term-ReadKey}
 BuildRequires: perl-devel >= 1:5.8.0
 BuildRequires: rpm-devel >= 4.0
 BuildRequires: rpm-perlprov >= 3.0.3-16
+BuildRequires: rpmbuild(macros) >= 1.176
 PreReq:                rc-scripts >= 0.2.0
-PreReq:                %{name}-libs = %{version}
+PreReq:                %{name}-libs = %{version}-%{release}
 Requires(post,preun):  /sbin/chkconfig
 Requires:      /usr/bin/setsid
 Provides:      snmpd
@@ -82,12 +77,12 @@ Gesti
 Útil para administrar redes y hacer contabilidad.
 
 %description -l pl
-SNMP (Simple Network Management Protocol) jest protoko³ej u¿ywanym do
+SNMP (Simple Network Management Protocol) jest protoko³em u¿ywanym do
 zarz±dzania sieciami. Pakiet zawiera narzêdzia: rozbudowywalnego
 agenta, bibliotekê SNMP, narzêdzia do odpytywania oraz ustawiania
 informacji poprzez agentów SNMP, narzêdzia do generowania i obs³ugi
 pu³apek SNMP, wersjê komendy netstat u¿ywaj±c± SNMP, przegl±darkê mib
-w Tk/Perl, deamona, dokumentacjê itp.
+w Tk/Perl, demona, dokumentacjê itp.
 
 %description -l pt_BR
 Este pacote é derivado da implementação do Protocolo Simples de
@@ -116,8 +111,9 @@ SNMP, 
 Summary:       NET SNMP libraries
 Summary(pl):   Biblioteki SNMP
 Group:         Libraries
+Requires:      %{name}-mibs = %{version}-%{release}
+Obsoletes:     net-snmp-compat-libs
 Obsoletes:     ucd-snmp-libs
-Requires:      %{name}-mibs = %{version}
 
 %description libs
 NET SNMP libraries.
@@ -133,7 +129,7 @@ Summary(pt_BR):     Arquivos de inclus
 Summary(ru):   óÒÅÄÁ ÒÁÚÒÁÂÏÔËÉ ÄÌÑ ÐÒÏÅËÔÁ UCD-SNMP
 Summary(uk):   óÅÒÅÄÏ×ÉÝÅ ÒÏÚÒÏÂËÉ ÄÌÑ ÐÒÏÅËÔÕ UCD-SNMP
 Group:         Development/Libraries
-Requires:      %{name}-libs = %{version}
+Requires:      %{name}-libs = %{version}-%{release}
 Requires:      elfutils-devel
 Requires:      openssl-devel >= 0.9.7c
 Obsoletes:     ucd-snmp-devel
@@ -149,7 +145,7 @@ el SNMP de la UCD. Con este paquete es posible la creaci
 programas para uso en la gestión de redes.
 
 %description devel -l pl
-Pakiet zawiera pliki nag³ówkowe i bilioteki potrzebne do rozwoju
+Pakiet zawiera pliki nag³ówkowe i biblioteki potrzebne do rozwoju
 aplikacji u¿ywaj±cych protoko³u SNMP.
 
 %description devel -l pt_BR
@@ -172,7 +168,7 @@ Summary(pt_BR):     Bibliotecas est
 Summary(ru):   óÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ÐÒÏÅËÔÁ net-snmp
 Summary(uk):   óÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ ÄÌÑ ÐÒÏÅËÔÕ net-snmp
 Group:         Development/Libraries
-Requires:      %{name}-devel = %{version}
+Requires:      %{name}-devel = %{version}-%{release}
 Obsoletes:     ucd-snmp-static
 
 %description static
@@ -184,19 +180,6 @@ Statyczne biblioteki net-snmp.
 %description static -l pt_BR
 Bibliotecas estáticas para desenvolvimento com net-snmp.
 
-%package compat-libs
-Summary:       UCD SNMP libraries
-Summary(pl):   Biblioteki UCD SNMP
-Group:         Libraries
-Obsoletes:     ucd-snmp-libs
-Requires:      %{name}-mibs = %{version}
-
-%description compat-libs
-UCD SNMP libraries.
-
-%description compat-libs -l pl
-Biblioteki UCD SNMP.
-
 %package compat-devel
 Summary:       The development environment for the UCD-SNMP project
 Summary(es):   Archivos de inclusión y bibliotecas para desarrollo en el SNMP de la UCD
@@ -205,8 +188,8 @@ Summary(pt_BR):     Arquivos de inclus
 Summary(ru):   óÒÅÄÁ ÒÁÚÒÁÂÏÔËÉ ÄÌÑ ÐÒÏÅËÔÁ UCD-SNMP
 Summary(uk):   óÅÒÅÄÏ×ÉÝÅ ÒÏÚÒÏÂËÉ ÄÌÑ ÐÒÏÅËÔÕ UCD-SNMP
 Group:         Development/Libraries
-Requires:      %{name}-compat-libs = %{version}
-Requires:      openssl-devel >= 0.9.7c
+Requires:      %{name}-libs = %{version}-%{release}
+Requires:      openssl-devel >= 0.9.7d
 Obsoletes:     cmu-snmp-devel
 Obsoletes:     ucd-snmp-devel
 
@@ -221,7 +204,7 @@ el SNMP de la UCD. Con este paquete es posible la creaci
 programas para uso en la gestión de redes.
 
 %description compat-devel -l pl
-Pakiet zawiera pliki nag³ówkowe i bilioteki potrzebne do rozwoju
+Pakiet zawiera pliki nag³ówkowe i biblioteki potrzebne do rozwoju
 aplikacji u¿ywaj±cych protoko³u SNMP.
 
 %description compat-devel -l pt_BR
@@ -244,7 +227,7 @@ Summary(pt_BR):     Bibliotecas est
 Summary(ru):   óÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ÐÒÏÅËÔÁ UCD-SNMP
 Summary(uk):   óÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ ÄÌÑ ÐÒÏÅËÔÕ UCD-SNMP
 Group:         Development/Libraries
-Requires:      %{name}-compat-devel = %{version}
+Requires:      %{name}-compat-devel = %{version}-%{release}
 Obsoletes:     ucd-snmp-static
 
 %description compat-static
@@ -260,6 +243,7 @@ Bibliotecas est
 Summary:       MIB database
 Summary(pl):   Baza danych MIB
 Group:         Applications/System
+Conflicts:     ucd-snmp-libs
 
 %description mibs
 MIB database.
@@ -271,7 +255,7 @@ Baza danych MIB.
 Summary:       SNMP trap daemon
 Summary(pl):   Demon obs³uguj±cy pu³apki SNMP
 Group:         Applications/System
-PreReq:                %{name} = %{version}
+PreReq:                %{name} = %{version}-%{release}
 PreReq:                rc-scripts >= 0.2.0
 Requires(post,preun):  /sbin/chkconfig
 Obsoletes:     cmu-snmp-utils
@@ -291,7 +275,7 @@ Summary(pt_BR):     Utilit
 Summary(ru):   õÔÉÌÉÔÙ ÕÐÒÁ×ÌÅÎÉÑ ÓÅÔØÀ ÐÏ SNMP ÉÚ ÐÒÏÅËÔÁ NET-SNMP
 Summary(uk):   õÔÉ̦ÔÉ ËÅÒÕ×ÁÎÎÑ ÍÅÒÅÖÅÀ ÐÏ SNMP Ú ÐÒÏÅËÔÕ NET-SNMP
 Group:         Applications/System
-Requires:      %{name}-libs = %{version}
+Requires:      %{name}-libs = %{version}-%{release}
 Obsoletes:     cmu-snmp-utils
 Obsoletes:     ucd-snmp-utils
 
@@ -323,7 +307,8 @@ como: snmpwalk, snmptest e outros.
 Summary:       SNMP and NetSNMP::* Perl modules
 Summary(pl):   Modu³y Perla SNMP oraz NetSNMP::*
 Group:         Development/Languages/Perl
-Requires:      %{name}-libs = %{version}
+Requires:      %{name}-libs = %{version}-%{release}
+Conflicts:     ucd-snmp-utils-perl
 
 %description -n perl-SNMP
 SNMP and NetSNMP::* Perl modules - Perl interface to net-snmp.
@@ -335,7 +320,7 @@ Modu
 Summary:       Perl utilities for network management using SNMP
 Summary(pl):   Perlowe narzêdzia u¿ywaj±ce protoko³u SNMP
 Group:         Applications/System
-Requires:      perl-SNMP = %{version}
+Requires:      perl-SNMP = %{version}-%{release}
 Obsoletes:     cmu-snmp-utils
 Obsoletes:     ucd-snmp-utils-perl
 
@@ -350,8 +335,8 @@ Perlowe narz
 Summary:       snmpconf - creating and modifying SNMP configuration files
 Summary(pl):   snmpconf - tworzenie i modyfikowanie plików konfiguracyjnych SNMP
 Group:         Applications/System
-Requires:      %{name} = %{version}
-Requires:      perl-SNMP = %{version}
+Requires:      %{name} = %{version}-%{release}
+Requires:      perl-SNMP = %{version}-%{release}
 
 %description snmpconf
 snmpconf is a simple Perl script that walks you through setting up a
@@ -363,20 +348,20 @@ snmpconf to prosty skrypt Perla pozwalaj
 konfiguracyjnego krok po kroku. Powinien byæ w miarê prosty w u¿yciu.
 
 %package tkmib
-Summary:       MIB browser in TK
-Summary(pl):   Przegl±darka MIB-ów w TK
+Summary:       MIB browser in Tk
+Summary(pl):   Przegl±darka MIB-ów w Tk
 Group:         Applications/System
-Requires:      perl-SNMP = %{version}
+Requires:      perl-SNMP = %{version}-%{release}
 Requires:      perl-Tk
 
 %description tkmib
-MIB browser in TK.
+MIB browser in Tk.
 
 %description tkmib -l pl
-Przegl±darka MIB-ów w TK.
+Przegl±darka MIB-ów w Tk.
 
 %prep
-%setup -q -a7
+%setup -q -a7 -a8
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -384,8 +369,11 @@ Przegl
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
-%patch7 -p2
-%patch8 -p0
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p0
 
 %build
 %{__libtoolize}
@@ -400,17 +388,38 @@ Przegl
        --with-sys-location="Unknown" \
        --with-mib-modules="host disman/event-mib smux mibII/mta_sendmail \
                agentx target misc/ipfwacc tunnel" \
-       --with-libwrap=%{_prefix} \
-       --with-openssl=%{_prefix} \
+       --with-libwrap \
+       --with-openssl \
        --disable-debugging \
        --with-persistent-directory="/var/lib/net-snmp" \
        --enable-ipv6 \
-       --enable-reentrant \
        --with-sys-contact="root@localhost" \
        --enable-ucd-snmp-compatibility \
        --with-defaults \
        --with-default-snmp-version=3 \
        --enable-shared
+
+#      --enable-reentrant is broken - snmpd deadlocks on send (tries to lock the same mutex twice):
+#   #4  0xb760f54e in siglongjmp () from /lib/tls/libpthread.so.0
+#   #5  0xb7e5e0cf in snmp_res_lock (groupID=0, resourceID=1) at mt_support.c:103
+#   #6  0xb7e45698 in snmp_sess_pointer (session=0x80ff868) at snmp_api.c:6975
+#   #7  0xb7e41aca in snmp_async_send (session=0x80ff868, pdu=0x8141848, callback=0, cb_data=0x0)
+#       at snmp_api.c:4564
+#   #8  0xb7e41a6d in snmp_send (session=0x80ff868, pdu=0x8141848) at snmp_api.c:4551
+#   #9  0xb7ebf6fd in netsnmp_wrap_up_request (asp=0x812d828, status=0) at snmp_agent.c:1627
+#   #10 0xb7ec12e3 in netsnmp_handle_request (asp=0x812d828, status=0) at snmp_agent.c:2996
+#   #11 0xb7ebfa65 in handle_snmp_packet (op=1, session=0x80ff868, reqid=628270607, pdu=0x81419b8,
+#       magic=0x0) at snmp_agent.c:1792
+#   #12 0xb7e42b1c in _sess_process_packet (sessp=0x812c970, sp=0x80ff868, isp=0x812c698,
+#       transport=0x8142028, opaque=0x812c1a0, olength=16,
+#       packetptr=0x8145cb8 "0f\002\001\0030\021\002\004c [Ç\002\003", length=104) at snmp_api.c:5208
+#   #13 0xb7e434e6 in _sess_read (sessp=0x812c970, fdset=0xbfffe0e0) at snmp_api.c:5606
+#   #14 0xb7e43535 in snmp_sess_read (sessp=0x812c970, fdset=0xbfffe0e0) at snmp_api.c:5625
+#   #15 0xb7e42c44 in snmp_read (fdset=0xbfffe0e0) at snmp_api.c:5260
+#   #16 0x0804bbe5 in receive () at snmpd.c:1149
+#   #17 0x0804b53d in main (argc=5, argv=0xbffff344) at snmpd.c:993
+# [res mutex with groupID=0, resourceID=1 already locked in snmp_read() at snmp_api.c:5258]
+
 %{__make}
 
 TDIR="`pwd`"
@@ -427,7 +436,8 @@ PATH=`pwd`:$PATH \
 # avoid rpaths generated by MakeMaker
 perl -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' */Makefile */*/Makefile
 
-%{__make}
+%{__make} \
+       LDFLAGS="%{rpmldflags}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -435,7 +445,6 @@ install -d $RPM_BUILD_ROOT{/etc/{snmp,rc.d/init.d,sysconfig},/var/log}
 
 %{__make} install \
        INSTALL_PREFIX=$RPM_BUILD_ROOT
-# DESTDIR=$RPM_BUILD_ROOT
 
 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf
 :> $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.local.conf
@@ -455,8 +464,19 @@ install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd
 cd perl
 %{__make} 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}
+cd ..
+
+# IP-Filter (non-Linux)
+rm -f $RPM_BUILD_ROOT%{_bindir}/ipf-mod.pl
+
+# Juniper MIBs:
+install JuniperMibs/*.txt $RPM_BUILD_ROOT%{_datadir}/snmp/mibs
+
+# Standard MIBs (Required by Juniper MIBs)
+install StandardMibs/*.txt $RPM_BUILD_ROOT%{_datadir}/snmp/mibs
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -466,7 +486,10 @@ rm -rf $RPM_BUILD_ROOT
 if [ -f /var/lock/subsys/snmpd ]; then
        /etc/rc.d/init.d/snmpd restart >&2
 else
-       echo "Run \"/etc/rc.d/init.d/snmpd start\" to start snmpd daemon." >&2
+       %banner %{name} -e <<EOF
+Run \"/etc/rc.d/init.d/snmpd start\" to start snmpd daemon.
+EOF
+#" vim
 fi
 touch %{logfile}
 chmod 640 %{logfile}
@@ -482,15 +505,15 @@ fi
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
-%post  compat-libs -p /sbin/ldconfig
-%postun        compat-libs -p /sbin/ldconfig
-
 %post snmptrapd
 /sbin/chkconfig --add snmptrapd
 if [ -f /var/lock/subsys/snmptrapd ]; then
        /etc/rc.d/init.d/snmptrapd restart >&2
 else
-       echo "Run \"/etc/rc.d/init.d/snmptrapd start\" to start snmp trap daemon." >&2
+       %banner %{name}-snmptrapd -e <<EOF
+Run \"/etc/rc.d/init.d/snmptrapd start\" to start snmp trap daemon.
+EOF
+#" vim
 fi
 touch %{logfile}
 chmod 640 %{logfile}
@@ -510,11 +533,11 @@ fi
 %doc FAQ NEWS PORTING README.snmpv3 TODO AGENT.txt
 
 %attr(754,root,root) /etc/rc.d/init.d/snmpd
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/snmpd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmpd
 
 %dir %{_sysconfdir}/snmp
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/snmp/snmpd.conf
-%attr(640,root,root) %config(missingok,noreplace) %verify(not md5 size mtime) %{_sysconfdir}/snmp/snmpd.local.conf
+%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
 
@@ -531,22 +554,20 @@ fi
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/mib2c
+%attr(755,root,root) %{_bindir}/mib2c-update
 %attr(755,root,root) %{_bindir}/net-snmp-config
 %attr(755,root,root) %{_libdir}/libnet*[a-z].so
 %{_libdir}/libnet*.la
 %{_includedir}/net-snmp
 %{_datadir}/snmp/mib2c*
 %{_mandir}/man1/mib2c.1*
-%{_mandir}/man3/*
+%{_mandir}/man3/[!NS]*
+%{_mandir}/man5/mib2c.conf.5*
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libnet*.a
 
-%files compat-libs
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libsnmp.so.*.*
-
 %files compat-devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libsnmp.so
@@ -566,8 +587,9 @@ fi
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/snmptrapd
 %attr(754,root,root) /etc/rc.d/init.d/snmptrapd
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/snmptrapd
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/snmp/snmptrapd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmptrapd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmptrapd.conf
+%attr(755,root,root) %{_datadir}/snmp/snmp_perl_trapd.pl
 %{_mandir}/man5/snmptrapd.conf.5*
 %{_mandir}/man8/snmptrapd.8*
 
@@ -592,8 +614,6 @@ fi
 %attr(755,root,root) %{_bindir}/snmpvacm
 %attr(755,root,root) %{_bindir}/snmpwalk
 
-#%%{_datadir}/snmp/snmpconf/snmp.conf
-
 %{_mandir}/man1/snmpbulkget.1*
 %{_mandir}/man1/snmpbulkwalk.1*
 %{_mandir}/man1/snmpcmd.1*
@@ -644,10 +664,11 @@ fi
 %attr(755,root,root) %{_bindir}/traptoemail
 
 %files snmpconf
+%defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/snmpconf
 %{_mandir}/man1/snmpconf.1*
 %{_datadir}/snmp/snmpconf-data
 
 %files tkmib
 %defattr(644,root,root,755)
-%attr(0755,root,root) %{_bindir}/tkmib
+%attr(755,root,root) %{_bindir}/tkmib
This page took 0.114903 seconds and 4 git commands to generate.