From fd65364a402d0ecdbdb0ccbf02047f91499ca8fbbe4e30bd2ed9804ad86f1f08 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 25 Jul 2013 13:10:23 +0000 Subject: [PATCH] Accepting request 184004 from net-snmp:factory Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/184004 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-snmp?expand=0&rev=66 --- net-snmp.changes | 5 +++++ net-snmp.spec | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/net-snmp.changes b/net-snmp.changes index 95f96e1..a117b95 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 15 11:49:08 UTC 2013 - mardnh@gmx.de + +- add support for python bindings + ------------------------------------------------------------------- Wed Jul 10 08:26:14 UTC 2013 - lars@linux-schulserver.de diff --git a/net-snmp.spec b/net-snmp.spec index 11e0334..33b2634 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -16,6 +16,10 @@ # +# compatibility for SLES11 <=SP1 +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} + %define pkg_name net-snmp %ifnarch s390 s390x %define netsnmp_with_sensors 1 @@ -30,6 +34,8 @@ Version: 5.7.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: openssl-devel +BuildRequires: python-devel +BuildRequires: python-setuptools BuildRequires: rpm-devel BuildRequires: tcpd-devel %if 0%{?netsnmp_with_sensors} @@ -201,6 +207,22 @@ Authors: -------- G.S. Marzot +%package python +Summary: The Python 'netsnmp' module for the Net-SNMP +License: BSD-3-Clause and MIT +Group: Development/Libraries/Python + +%description python +The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3, +SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the +Net-SNMP toolkit library. + + +Authors: +-------- + G.S. Marzot + + %prep %setup -q -n %{pkg_name}-%{version} %patch1 -p1 @@ -244,6 +266,10 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib" # module and libnetsnmp are not correctly defined. make #%{?_smp_mflags} +pushd python +%{__python} setup.py --basedir="../" build +popd + %check %if 0%{?netsnmp_check} %ifnarch %arm @@ -273,6 +299,9 @@ pushd perl %perl_process_packlist %{__rm} -f %{buildroot}/%{perl_vendorarch}/Bundle/Makefile.subs.pl popd +pushd python +%{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot} +popd %{__grep} -v "^#define PACKAGE" %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h > \ %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h.new %{__mv} %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h{.new,} @@ -384,4 +413,9 @@ rm -f "%buildroot/%_libdir"/*.la /var/adm/perl-modules/net-snmp %endif +%files python +%defattr(-,root,root) +%doc README +%{python_sitearch}/* + %changelog