]> git.pld-linux.org Git - packages/net-snmp.git/blobdiff - net-snmp.spec
- patch not to fail if same ip seen in different interfaces; rel 11
[packages/net-snmp.git] / net-snmp.spec
index 5a55dda39cfb41fcce4b077f559ee56ce64ad8bc..e0b98345c5acf11f350c0694fcfacaf308aea288 100644 (file)
@@ -1,4 +1,14 @@
-# TODO: python-netsnmp links with libnetsnmp.so.* installed on builder
+# TODO
+# - package or remove:
+#   %{py_sitedir}/netsnmp/__init__.py
+#   %{py_sitedir}/netsnmp/client.py
+#   %{py_sitedir}/netsnmp/tests/__init__.py
+#   %{py_sitedir}/netsnmp/tests/__init__.pyc
+#   %{py_sitedir}/netsnmp/tests/__init__.pyo
+#   %{py_sitedir}/netsnmp/tests/test.py
+#   %{py_sitedir}/netsnmp/tests/test.pyc
+#   %{py_sitedir}/netsnmp/tests/test.pyo
+#   %{_datadir}/snmp/snmp_perl.pl
 #
 # Conditional build:
 %bcond_without autodeps        # don't BR packages only for deps resolving
@@ -7,6 +17,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
@@ -16,12 +27,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
-Release:       5
+Version:       5.4.1
+Release:       11
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
-# Source0-md5: 46d893281056ff476e597659cb91574d
+# Source0-md5: 6c974df7a5a5b1579f72115e6b045bda
 Source1:       %{name}d.init
 Source2:       %{name}d.conf
 Source3:       %{name}d.sysconfig
@@ -33,17 +44,19 @@ Source7:    ucd-ipchains.tar.gz
 Patch0:                %{name}-acfix.patch
 Patch1:                %{name}-rpm-implicit-libs.patch
 Patch2:                %{name}-config-noflags.patch
-Patch3:                %{name}-dlopen-fix.patch
-Patch4:                %{name}-manpage.patch
-Patch5:                %{name}-link.patch
-Patch6:                %{name}-llinterfaces.patch
-Patch7:                %{name}-kernel_headers.patch
-Patch8:                %{name}-rpmpath.patch
-Patch9:                %{name}-snmpksm.patch
-Patch10:       %{name}-python.patch
-Patch11:       %{name}-python-includes.patch
+Patch3:                %{name}-manpage.patch
+Patch4:                %{name}-link.patch
+Patch5:                %{name}-llinterfaces.patch
+Patch6:                %{name}-kernel_headers.patch
+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
+Patch13:       %{name}-duplicate-ip.patch
 URL:           http://www.net-snmp.org/
-BuildRequires: autoconf >= 2.57-3
+BuildRequires: autoconf >= 2.61-3
 BuildRequires: automake
 BuildRequires: elfutils-devel
 %{?with_kerberos5:BuildRequires:       krb5-devel}
@@ -61,20 +74,20 @@ BuildRequires:      python-setuptools
 BuildRequires: rpm-devel >= 4.0
 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)
 
 %define                logfile         /var/log/snmpd.log
-%define                filterout_ld    -Wl,--as-needed
 
 %description
 SNMP (Simple Network Management Protocol) is a protocol used for
@@ -125,7 +138,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
 
@@ -145,6 +158,7 @@ Summary(uk.UTF-8):  Середовище розробки для проекту U
 Group:         Development/Libraries
 Requires:      %{name}-libs = %{version}-%{release}
 Requires:      elfutils-devel
+%{?with_kerberos5:Requires:    krb5-devel}
 Requires:      libwrap-devel
 %{?with_lm_sensors:Requires:   lm_sensors-devel}
 Requires:      openssl-devel >= 0.9.7c
@@ -293,6 +307,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
 
@@ -405,6 +420,8 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
+%patch12 -p1
+%patch13 -p0
 
 %build
 %{__libtoolize}
@@ -414,22 +431,23 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 %configure \
        --disable-debugging \
        --enable-as-needed \
+       %{!?with_static_libs:--disable-static} \
        --with-cflags="%{rpmcflags} -I/usr/include/et" \
        --with-ldflags="%{rpmldflags}" \
        --with-defaults \
        --with-default-snmp-version=3 \
        %{?with_kerberos5:--with-krb5=%{_prefix}} \
-       %{?with_kerberos5:--without-krb5} \
+       %{!?with_kerberos5:--without-krb5} \
        --with-openssl=%{_prefix} \
        --with-libwrap=%{_prefix} \
        --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 \
        --with-mib-modules="host agentx smux mibII/mta_sendmail \
 %ifarch %{ix86} %{x8664}
-%if %{with sensors}
+%if %{with lm_sensors}
                        ucd-snmp/lmSensors \
 %endif
 %endif
@@ -444,9 +462,7 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
        --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
 
@@ -496,6 +512,25 @@ 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
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -574,9 +609,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)
@@ -584,9 +621,11 @@ 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)
This page took 0.051293 seconds and 4 git commands to generate.