File python-pysmi.spec of Package python-pysmi

# Created by pyp2rpm-3.2.3
%global pypi_name pysmi

Name:           python-%{pypi_name}
Version:        0.2.2
Release:        1%{?dist}
Summary:        SNMP SMI/MIB Parser

License:        BSD
URL:            https://github.com/etingof/pysmi
Source0:        https://pypi.io/packages/source/p/pysmi/pysmi-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools

%description
A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.

%package -n     python2-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
 
Requires:       python2-ply
Requires:       python2-setuptools

%description -n python2-%{pypi_name}
A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.

%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
%py2_build

%install
%py2_install
cp %{buildroot}/%{_bindir}/mibdump.py %{buildroot}/%{_bindir}/mibdump.py-%{python2_version}
ln -s %{_bindir}/mibdump.py-%{python2_version} %{buildroot}/%{_bindir}/mibdump.py-2

%files -n python2-%{pypi_name}
%if (0%{?rhel} >= 7) || (0%{?suse_version} >= 1315)
%license docs/source/license.rst LICENSE.rst
%endif
%doc docs/README.txt README.md
%{_bindir}/mibdump.py
%{_bindir}/mibdump.py-2
%{_bindir}/mibdump.py-%{python2_version}
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%changelog
* Tue Dec 26 2017 Yunfei Shi <shiyf2@lenovo.com> - 0.2.2-1
- Initial package.
openSUSE Build Service is sponsored by