956a8cc
%if 0%{?fedora}
956a8cc
%global with_python3 1
956a8cc
%endif
956a8cc
956a8cc
%global srcname netmiko
956a8cc
%global sum Multi-vendor library to simplify Paramiko SSH connections to network devices
956a8cc
956a8cc
Name:           python-%{srcname}
9e379f3
Version:        1.4.2
956a8cc
Release:        1%{?dist}
956a8cc
Summary:        %{sum}
956a8cc
956a8cc
License:        MIT
956a8cc
URL:            https://pypi.python.org/pypi/%{srcname}
956a8cc
Source0:        https://pypi.io/packages/source/n/%{srcname}/%{srcname}-%{version}.tar.gz
956a8cc
956a8cc
BuildArch:      noarch
956a8cc
956a8cc
%description
956a8cc
%{sum}
956a8cc
956a8cc
956a8cc
%package -n python2-%{srcname}
956a8cc
Summary:        %{sum}
956a8cc
BuildRequires:  python2-devel
956a8cc
Requires:       python2-paramiko >= 1.13.0
956a8cc
Requires:       python2-scp >= 0.10.0
956a8cc
Requires:       PyYAML
956a8cc
%{?python_provide:%python_provide python2-%{srcname}}
956a8cc
956a8cc
%description -n python2-%{srcname}
956a8cc
%{sum} - package for Python 2.
956a8cc
956a8cc
956a8cc
%if 0%{?with_python3}
956a8cc
956a8cc
%package -n python3-%{srcname}
956a8cc
Summary:        %{sum}
956a8cc
BuildRequires:  python3-devel
956a8cc
Requires:       python3-paramiko >= 1.13.0
956a8cc
Requires:       python3-scp >= 0.10.0
956a8cc
Requires:       python3-PyYAML
956a8cc
%{?python_provide:%python_provide python3-%{srcname}}
956a8cc
956a8cc
%description -n python3-%{srcname}
956a8cc
%{sum} - package for Python 3.
956a8cc
956a8cc
%endif
956a8cc
956a8cc
# FIXME: build the documentation, when upstream starts shipping its sources:
956a8cc
# https://github.com/ktbyers/netmiko/issues/507
956a8cc
956a8cc
956a8cc
%prep
956a8cc
%autosetup -n %{srcname}-%{version}
956a8cc
956a8cc
%build
956a8cc
%py2_build
956a8cc
956a8cc
%if 0%{?with_python3}
956a8cc
%py3_build
956a8cc
%endif
956a8cc
956a8cc
%install
956a8cc
%py2_install
956a8cc
956a8cc
%if 0%{?with_python3}
956a8cc
%py3_install
956a8cc
%endif
956a8cc
956a8cc
%check
956a8cc
# FIXME: run unit tests, when upstream starts shipping them:
956a8cc
# https://github.com/ktbyers/netmiko/issues/508
956a8cc
956a8cc
956a8cc
%files -n python2-%{srcname}
956a8cc
%license LICENSE
956a8cc
%doc README.md
956a8cc
%{python2_sitelib}/*
956a8cc
956a8cc
%if 0%{?with_python3}
956a8cc
956a8cc
%files -n python3-%{srcname}
956a8cc
%license LICENSE
956a8cc
%doc README.md
956a8cc
%{python3_sitelib}/*
956a8cc
956a8cc
%endif
956a8cc
956a8cc
956a8cc
%changelog
9e379f3
* Mon Jul 24 2017 Dmitry Tantsur <divius.inside@gmail.com> - 1.4.2-1
9e379f3
- Update to 1.4.2
9e379f3
956a8cc
* Mon Jul 24 2017 Dmitry Tantsur <divius.inside@gmail.com> - 1.4.1-1
956a8cc
- Initial packaging (#1465006)