]> git.pld-linux.org Git - packages/net-snmp.git/blobdiff - net-snmp.spec
- updated to 5.9 (new sonames)
[packages/net-snmp.git] / net-snmp.spec
index db1b35c831053e3061803011b0361853e0f1793d..c4a2e90370f1f16ee6a1bbdaf531c49a64d7434f 100644 (file)
@@ -3,19 +3,19 @@
 # - FHS: #define NETSNMP_AGENTX_SOCKET "/var/agentx/master"
 #
 # Conditional build:
 # - FHS: #define NETSNMP_AGENTX_SOCKET "/var/agentx/master"
 #
 # Conditional build:
-%bcond_without rpm             # don't include RPM support
-%bcond_without kerberos5       # don't include kerberos support
-%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
+%bcond_without rpm             # RPM support
+%bcond_without kerberos5       # Kerberos support
+%bcond_without lm_sensors      # LM sensors support
+%bcond_without perl            # Perl modules and utils
+%bcond_without python          # Python (3.x) modules
+%bcond_without python2         # Python 2.x modules
+%bcond_without static_libs     # static library
 
 %ifnarch %{ix86} %{x8664} x32
 %undefine      with_lm_sensors
 %endif
 
 
 %ifnarch %{ix86} %{x8664} x32
 %undefine      with_lm_sensors
 %endif
 
-%define                so_version      35
-%include       /usr/lib/rpm/macros.perl
+%define                so_version      40
 Summary:       A collection of SNMP protocol tools
 Summary(es.UTF-8):     Agente SNMP de la UCD
 Summary(pl.UTF-8):     Kolekcja narzędzi do obsługi protokołu SNMP
 Summary:       A collection of SNMP protocol tools
 Summary(es.UTF-8):     Agente SNMP de la UCD
 Summary(pl.UTF-8):     Kolekcja narzędzi do obsługi protokołu SNMP
@@ -23,13 +23,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
 Summary(ru.UTF-8):     Набор утилит для протокола SNMP от UC-Davis
 Summary(uk.UTF-8):     Набір утиліт для протоколу SNMP від UC-Davis
 Name:          net-snmp
-# NOTE: 5.7.x is LTS version
-Version:       5.8
+Version:       5.9
 Release:       1
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
 Release:       1
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
-# Source0-md5: 63bfc65fbb86cdb616598df1aff6458a
+# Source0-md5: 382da80138897f294299badf9c62c699
 Source1:       %{name}d.init
 Source2:       %{name}d.conf
 Source3:       %{name}d.sysconfig
 Source1:       %{name}d.init
 Source2:       %{name}d.conf
 Source3:       %{name}d.sysconfig
@@ -44,11 +43,10 @@ Patch1:             %{name}-rpm-implicit-libs.patch
 Patch2:                %{name}-config-noflags.patch
 Patch3:                %{name}-manpage.patch
 Patch4:                %{name}-link.patch
 Patch2:                %{name}-config-noflags.patch
 Patch3:                %{name}-manpage.patch
 Patch4:                %{name}-link.patch
-Patch5:                %{name}-llinterfaces.patch
 Patch6:                %{name}-kernel_headers.patch
 Patch7:                %{name}-rpmpath.patch
 Patch8:                %{name}-python.patch
 Patch6:                %{name}-kernel_headers.patch
 Patch7:                %{name}-rpmpath.patch
 Patch8:                %{name}-python.patch
-Patch9:        %{name}-lvalue.patch
+Patch9:                %{name}-lvalue.patch
 Patch10:       %{name}-defaultconfig.patch
 Patch11:       %{name}-use-rpm-hrmib.patch
 Patch12:       %{name}-TCP_STATS_CACHE_TIMEOUT.patch
 Patch10:       %{name}-defaultconfig.patch
 Patch11:       %{name}-use-rpm-hrmib.patch
 Patch12:       %{name}-TCP_STATS_CACHE_TIMEOUT.patch
@@ -73,9 +71,14 @@ BuildRequires:       pcre-devel
 BuildRequires: perl-devel >= 1:5.8.0
 BuildRequires: pkgconfig >= 1:0.9.0
 %if %{with python}
 BuildRequires: perl-devel >= 1:5.8.0
 BuildRequires: pkgconfig >= 1:0.9.0
 %if %{with python}
-BuildRequires: python-devel
-BuildRequires: python-modules
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.5
+BuildRequires: python-modules >= 1:2.5
 BuildRequires: python-setuptools
 BuildRequires: python-setuptools
+%endif
+BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-modules >= 1:3.2
+BuildRequires: python3-setuptools
 BuildRequires: rpm-pythonprov
 %endif
 %if %{with rpm}
 BuildRequires: rpm-pythonprov
 %endif
 %if %{with rpm}
@@ -428,8 +431,8 @@ MIB browser in Tk.
 Przeglądarka MIB-ów w Tk.
 
 %package -n python-netsnmp
 Przeglądarka MIB-ów w Tk.
 
 %package -n python-netsnmp
-Summary:       Python netsnmp extension module
-Summary(pl.UTF-8):     Moduł rozszerzenia netsnmp dla Pythona
+Summary:       Python netsnmp extension module
+Summary(pl.UTF-8):     Moduł rozszerzenia netsnmp dla Pythona 2
 Group:         Libraries/Python
 Requires:      %{name}-libs = %{version}-%{release}
 
 Group:         Libraries/Python
 Requires:      %{name}-libs = %{version}-%{release}
 
@@ -441,13 +444,26 @@ tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) client API.
 Moduł rozszerzenia netsnmp dla Pythona udostępnia pełne API klienckie
 SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 
 Moduł rozszerzenia netsnmp dla Pythona udostępnia pełne API klienckie
 SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 
+%package -n python3-netsnmp
+Summary:       Python 3 netsnmp extension module
+Summary(pl.UTF-8):     Moduł rozszerzenia netsnmp dla Pythona 3
+Group:         Libraries/Python
+Requires:      %{name}-libs = %{version}-%{release}
+
+%description -n python3-netsnmp
+The 'netsnmp' Python extension module provides a full featured,
+tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) client API.
+
+%description -n python3-netsnmp -l pl.UTF-8
+Moduł rozszerzenia netsnmp dla Pythona udostępnia pełne API klienckie
+SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
+
 %prep
 %setup -q -a7
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
 %prep
 %setup -q -a7
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch5 -p1
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
@@ -459,6 +475,9 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
 %patch14 -p1
 %patch15 -p1
 
 %patch14 -p1
 %patch15 -p1
 
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+perl(\s|$),#!%{__perl}\1,' \
+      perl/SNMP/examples/pingmib.pl
+
 %build
 %{__libtoolize}
 %{__aclocal} -I m4
 %build
 %{__libtoolize}
 %{__aclocal} -I m4
@@ -512,8 +531,11 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
 
 %{__make} -j1
 
 
 %{__make} -j1
 
+TOPDIR="$(pwd)"
+
 cd perl
 %{__perl} -I. Makefile.PL \
 cd perl
 %{__perl} -I. Makefile.PL \
+       -NET-SNMP-CONFIG="${TOPDIR}/net-snmp-config" \
        -NET-SNMP-IN-SOURCE=true \
        INSTALLDIRS=vendor \
        OPTIMIZE="%{rpmcflags} %{rpmcppflags}" \
        -NET-SNMP-IN-SOURCE=true \
        INSTALLDIRS=vendor \
        OPTIMIZE="%{rpmcflags} %{rpmcppflags}" \
@@ -522,9 +544,16 @@ cd perl
 # avoid rpaths generated by MakeMaker
 %{__perl} -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' */Makefile */*/Makefile
 
 # avoid rpaths generated by MakeMaker
 %{__perl} -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' */Makefile */*/Makefile
 
-bd=$(cd ..; pwd)
 %{__make} \
 %{__make} \
-       LDFLAGS="%{rpmldflags} -L$bd/snmplib/.libs/ -L$bd/agent/.libs/"
+       LDFLAGS="%{rpmldflags} -L${TOPDIR}/snmplib/.libs/ -L${TOPDIR}/agent/.libs/"
+cd ..
+
+%if %{with python2}
+cd python
+%py_build \
+       --basedir=$TOPDIR
+cd ..
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -582,6 +611,15 @@ done
 %endif
 
 %if %{with python}
 %endif
 
 %if %{with python}
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/netsnmp/tests
+%endif
+
+%if %{with python2}
+cd python
+%py_install \
+       --basedir=$TOPDIR
+cd ..
+
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/tests
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/*.py
 %endif
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/tests
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/*.py
 %endif
@@ -687,6 +725,8 @@ fi
 %{_libdir}/libnetsnmpmibs.la
 %{_libdir}/libnetsnmptrapd.la
 %{_includedir}/net-snmp
 %{_libdir}/libnetsnmpmibs.la
 %{_libdir}/libnetsnmptrapd.la
 %{_includedir}/net-snmp
+%{_pkgconfigdir}/netsnmp.pc
+%{_pkgconfigdir}/netsnmp-agent.pc
 %{_datadir}/snmp/mib2c*
 %{_mandir}/man1/mib2c.1*
 %{_mandir}/man1/mib2c-update.1*
 %{_datadir}/snmp/mib2c*
 %{_mandir}/man1/mib2c.1*
 %{_mandir}/man1/mib2c-update.1*
@@ -831,7 +871,7 @@ fi
 %{_mandir}/man1/tkmib.1*
 %endif
 
 %{_mandir}/man1/tkmib.1*
 %endif
 
-%if %{with python}
+%if %{with python2}
 %files -n python-netsnmp
 %defattr(644,root,root,755)
 %dir %{py_sitedir}/netsnmp
 %files -n python-netsnmp
 %defattr(644,root,root,755)
 %dir %{py_sitedir}/netsnmp
@@ -839,3 +879,13 @@ fi
 %{py_sitedir}/netsnmp/*.py[co]
 %{py_sitedir}/netsnmp_python-*.egg-info
 %endif
 %{py_sitedir}/netsnmp/*.py[co]
 %{py_sitedir}/netsnmp_python-*.egg-info
 %endif
+
+%if %{with python}
+%files -n python3-netsnmp
+%defattr(644,root,root,755)
+%dir %{py3_sitedir}/netsnmp
+%attr(755,root,root) %{py3_sitedir}/netsnmp/client_intf.cpython-*.so
+%{py3_sitedir}/netsnmp/*.py
+%{py3_sitedir}/netsnmp/__pycache__
+%{py3_sitedir}/netsnmp_python-*.egg-info
+%endif
This page took 0.115604 seconds and 4 git commands to generate.