]> git.pld-linux.org Git - packages/net-snmp.git/blobdiff - net-snmp.spec
- change default
[packages/net-snmp.git] / net-snmp.spec
index c8e00c296b2db99c3e6e534d320f762c17e5ea9e..a12f337c7b6494a599eb58c11f2ade38a9d75f4f 100644 (file)
@@ -6,6 +6,7 @@
 %bcond_without lm_sensors      # don't include sensors support
 %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
 #
 %include       /usr/lib/rpm/macros.perl
 Summary:       A collection of SNMP protocol tools
@@ -15,12 +16,12 @@ 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.1
-Release:       2
+Version:       5.4.2.1
+Release:       9
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
-# Source0-md5: 6c974df7a5a5b1579f72115e6b045bda
+# Source0-md5: 984932520143f0c8bf7b7ce1fc9e1da1
 Source1:       %{name}d.init
 Source2:       %{name}d.conf
 Source3:       %{name}d.sysconfig
@@ -40,39 +41,50 @@ Patch7:             %{name}-rpmpath.patch
 Patch8:                %{name}-snmpksm.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
 URL:           http://www.net-snmp.org/
 BuildRequires: autoconf >= 2.61-3
 BuildRequires: automake
 BuildRequires: elfutils-devel
-%{?with_kerberos5:BuildRequires:       krb5-devel}
+%{?with_kerberos5:BuildRequires:       heimdal-devel}
+BuildRequires: libnl-devel >= 1:1.1
 BuildRequires: libtool >= 1.4
 BuildRequires: libwrap-devel
-%{?with_lm_sensors:BuildRequires:      lm_sensors-devel}
+%{?with_lm_sensors:BuildRequires:      lm_sensors-devel >= 3.0.1}
 BuildRequires: openssl-devel >= 0.9.7d
 %{?with_autodeps:BuildRequires:        perl-Term-ReadKey}
 BuildRequires: perl-devel >= 1:5.8.0
 %if %{with python}
-BuildRequires: python-devel >= 1:2.5
+BuildRequires: python-devel
 BuildRequires: python-setuptools
 %endif
 %if %{with rpm}
-BuildRequires: rpm-devel >= 4.0
+BuildRequires: rpm
 BuildRequires: rpm-perlprov >= 3.0.3-16
 %endif
-BuildRequires: rpmbuild(macros) >= 1.176
 BuildRequires: rpmbuild(macros) >= 1.268
 Requires(post,preun):  /sbin/chkconfig
 Requires:      %{name}-libs = %{version}-%{release}
+Requires:      %{name}-mibs = %{version}-%{release}
 Requires:      /usr/bin/setsid
 Requires:      rc-scripts >= 0.2.0
 Provides:      snmpd
 Obsoletes:     cmu-snmp
 Obsoletes:     snmpd
 Obsoletes:     ucd-snmp
+Conflicts:     rpm < 4.4.9-43.11
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# linking libraries is ugly in this package
+%define                no_install_post_check_so        1
+
 %define                logfile         /var/log/snmpd.log
-%define                filterout_ld    -Wl,--as-needed
 
 %description
 SNMP (Simple Network Management Protocol) is a protocol used for
@@ -123,7 +135,7 @@ SNMP, утиліти для запросу та встановлення інф
 Summary:       NET SNMP libraries
 Summary(pl.UTF-8):     Biblioteki SNMP
 Group:         Libraries
-Requires:      %{name}-mibs = %{version}-%{release}
+Requires:      %{name}-mibs
 Obsoletes:     net-snmp-compat-libs
 Obsoletes:     ucd-snmp-libs
 
@@ -143,11 +155,10 @@ Summary(uk.UTF-8):        Середовище розробки для проекту U
 Group:         Development/Libraries
 Requires:      %{name}-libs = %{version}-%{release}
 Requires:      elfutils-devel
-%{?with_kerberos5:Requires:    krb5-devel}
+%{?with_kerberos5:Requires:    heimdal-devel}
 Requires:      libwrap-devel
-%{?with_lm_sensors:Requires:   lm_sensors-devel}
+%{?with_lm_sensors:Requires:   lm_sensors-devel >= 3.0.1}
 Requires:      openssl-devel >= 0.9.7c
-%{?with_rpm:Requires:  rpm-devel}
 Obsoletes:     ucd-snmp-devel
 
 %description devel
@@ -292,6 +303,7 @@ 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}
 Obsoletes:     cmu-snmp-utils
 Obsoletes:     ucd-snmp-utils
 
@@ -403,15 +415,24 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch14 -p0
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p3
 
 %build
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
 %{__autoheader}
+cp -f /usr/share/automake/config.sub .
 %configure \
        --disable-debugging \
        --enable-as-needed \
+       %{!?with_static_libs:--disable-static} \
        --with-cflags="%{rpmcflags} -I/usr/include/et" \
        --with-ldflags="%{rpmldflags}" \
        --with-defaults \
@@ -423,12 +444,13 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
        --with-logfile="%{logfile}" \
        --with-zlib=%{_prefix} \
        --with-bzip2=%{_prefix} \
-       --with%{!?with_rpm:out}-perl-modules \
-       --with%{!?with_rpm:out}-python-modules \
+       --with%{!?with_perl:out}-perl-modules \
+       --with%{!?with_python:out}-python-modules \
+       --enable-local-smux \
        --with-mib-modules="host agentx smux mibII/mta_sendmail \
 %ifarch %{ix86} %{x8664}
 %if %{with lm_sensors}
-                       ucd-snmp/lmSensors \
+                       ucd-snmp/lmsensorsMib \
 %endif
 %endif
                        disman/event disman/schedule ucd-snmp/diskio \
@@ -436,15 +458,13 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
        %{?with_kerberos5:--with-security-modules="ksm"} \
        --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" \
        --with-persistent-directory="/var/lib/net-snmp" \
        --enable-ucd-snmp-compatibility \
        --enable-ipv6 \
        --with%{!?with_rpm:out}-rpm
 
-# build this subdir first. it's causing STRANGE compile failures # otherwise (for me at least). glen
-%{__make} -C agent/mibgroup
-%{__make}
+%{__make} -j1
 
 cd perl
 
@@ -462,9 +482,9 @@ perl -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' */Makefile */*/Makefile
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,snmp},/var/log}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,snmp},/var/log,%{_libdir}/snmp/dlmod}
 
-%{__make} install \
+%{__make} -j1 install \
        DESTDIR=$RPM_BUILD_ROOT
 
 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf
@@ -484,7 +504,7 @@ install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd
 #      $RPM_BUILD_ROOT%{_datadir}/snmp/mibs
 
 cd perl
-%{__make} install \
+%{__make} -j1 install \
        DESTDIR=$RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version}
@@ -494,6 +514,34 @@ cd ..
 # IP-Filter (non-Linux)
 rm -f $RPM_BUILD_ROOT%{_bindir}/ipf-mod.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}
+# hack: convert DynaLoader.a inside .a file to .o, as strip(1) would otherwise say invalid argument
+for a in $RPM_BUILD_ROOT%{_libdir}/libnet*.a; do
+       rm -f *.o *.a
+       ar x $a DynaLoader.a
+       if [ -f DynaLoader.a ]; then
+               ar x DynaLoader.a
+               ar cr $a DynaLoader.o
+               ar d $a DynaLoader.a
+               # remove second file too
+               ar d $a DynaLoader.a
+       fi
+done
+%else
+rm -f $RPM_BUILD_ROOT%{_libdir}/libsnmp.a
+%endif
+
+%if %{with python}
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/tests
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/*.py
+%endif
+
+touch $RPM_BUILD_ROOT%{_datadir}/snmp/mibs/.index
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -544,6 +592,9 @@ fi
 
 %attr(755,root,root) %{_sbindir}/snmpd
 
+%dir %{_libdir}/snmp
+%dir %{_libdir}/snmp/dlmod
+
 %{_mandir}/man5/snmpd.conf.5*
 %{_mandir}/man5/snmpd.examples.5*
 %{_mandir}/man5/snmpd.internal.5*
@@ -555,15 +606,32 @@ fi
 %files libs
 %defattr(644,root,root,755)
 %dir %{_sysconfdir}/snmp
-%attr(755,root,root) %{_libdir}/libnet*.so.*.*
+%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
 
 %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
+%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
+%{_libdir}/libnetsnmp.la
+%{_libdir}/libnetsnmpagent.la
+%{_libdir}/libnetsnmphelpers.la
+%{_libdir}/libnetsnmpmibs.la
+%{_libdir}/libnetsnmptrapd.la
 %{_includedir}/net-snmp
 %{_datadir}/snmp/mib2c*
 %{_mandir}/man1/mib2c.1*
@@ -572,9 +640,11 @@ fi
 %{_mandir}/man3/[!NS]*
 %{_mandir}/man5/mib2c.conf.5*
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libnet*.a
+%endif
 
 %files compat-devel
 %defattr(644,root,root,755)
@@ -582,14 +652,17 @@ fi
 %{_libdir}/libsnmp.la
 %{_includedir}/ucd-snmp
 
+%if %{with static_libs}
 %files compat-static
 %defattr(644,root,root,755)
 %{_libdir}/libsnmp.a
+%endif
 
 %files mibs
 %defattr(644,root,root,755)
 %dir %{_datadir}/snmp
 %{_datadir}/snmp/mibs
+%ghost %{_datadir}/snmp/mibs/.index
 
 %files snmptrapd
 %defattr(644,root,root,755)
This page took 0.146143 seconds and 4 git commands to generate.