91e17b
%global srcname paramiko
91e17b
130b29
%if 0%{?rhel} && 0%{?rhel} <= 7
130b29
%bcond_with weak_deps
130b29
%bcond_with python3
130b29
%else
130b29
%bcond_without weak_deps
130b29
%bcond_without python3
130b29
%endif
130b29
130b29
Name:          python-%{srcname}
130b29
Version:       2.1.1
aa3440
Release:       4%{?dist}
130b29
Provides:       python2-paramiko = %{version}-%{release}
130b29
Summary:       SSH2 protocol library for python
91e17b
91e17b
# No version specified.
130b29
License:       LGPLv2+
130b29
URL:           https://github.com/paramiko/paramiko
130b29
Source0:       %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
91e17b
aa3440
Patch0:        CVE-2018-7750.diff
aa3440
130b29
BuildArch:     noarch
91e17b
130b29
Requires:      python-cryptography
aa3440
Requires:      python2-pyasn1
130b29
BuildRequires: python2-devel
91e17b
BuildRequires: python-setuptools
130b29
BuildRequires: python-cryptography
aa3440
BuildRequires: python2-pyasn1
130b29
%global paramiko_desc \
130b29
Paramiko (a combination of the esperanto words for "paranoid" and "friend") is\
130b29
a module for python 2.3 or greater that implements the SSH2 protocol for secure\
130b29
(encrypted and authenticated) connections to remote machines. Unlike SSL (aka\
130b29
TLS), the SSH2 protocol does not require heirarchical certificates signed by a\
130b29
powerful central authority. You may know SSH2 as the protocol that replaced\
130b29
telnet and rsh for secure access to remote shells, but the protocol also\
130b29
includes the ability to open arbitrary channels to remote services across an\
130b29
encrypted tunnel. (This is how sftp works, for example.)\
91e17b
91e17b
%description
130b29
%{paramiko_desc}
130b29
130b29
%if %{with weak_deps}
130b29
Recommends:    python-gssapi
130b29
%endif
130b29
130b29
%if %{with python3}
130b29
%package -n python%{python3_pkgversion}-%{srcname}
130b29
Summary:       SSH2 protocol library for python
130b29
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
130b29
BuildRequires: python%{python3_pkgversion}-devel
130b29
BuildRequires: python%{python3_pkgversion}-setuptools
130b29
BuildRequires: python%{python3_pkgversion}-cryptography
130b29
Requires:      python%{python3_pkgversion}-cryptography
130b29
%if %{with weak_deps}
130b29
Recommends:    python%{python3_pkgversion}-gssapi
130b29
%endif
130b29
130b29
%description -n python%{python3_pkgversion}-%{srcname}
130b29
%{paramiko_desc}
130b29
130b29
Python 3 version.
130b29
%endif
130b29
130b29
%package doc
130b29
Summary:       Docs and demo for SSH2 protocol library for python
130b29
BuildRequires: /usr/bin/sphinx-build
130b29
BuildRequires: python-sphinx-theme-alabaster
130b29
Requires:      %{name} = %{version}-%{release}
130b29
130b29
%description doc
130b29
%{paramiko_desc}
130b29
130b29
This is the documentation and demos.
91e17b
91e17b
%prep
aa3440
%autosetup -n %{srcname}-%{version} -p1
91e17b
130b29
chmod a-x demos/*
130b29
sed -i -e '/^#!/,1d' demos/*
91e17b
91e17b
%build
130b29
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s"
130b29
%if %{with python3}
130b29
%py3_build
130b29
%endif
91e17b
91e17b
%install
130b29
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}
130b29
%if %{with python3}
130b29
%py3_install
130b29
%endif
130b29
130b29
sphinx-build -b html sites/docs/ html/
130b29
rm -f html/.buildinfo
91e17b
91e17b
%check
130b29
%{__python2} ./test.py --no-sftp --no-big-file
130b29
%if %{with python3}
130b29
%{__python3} ./test.py --no-sftp --no-big-file
130b29
%endif
130b29
130b29
%files -n python-%{srcname}
130b29
%license LICENSE
130b29
%doc NEWS README.rst
130b29
%{python2_sitelib}/%{srcname}-*.egg-info/
130b29
%{python2_sitelib}/%{srcname}/
91e17b
130b29
%if %{with python3}
130b29
%files -n python%{python3_pkgversion}-%{srcname}
130b29
%license LICENSE
130b29
%doc NEWS README.rst
130b29
%{python3_sitelib}/%{srcname}-*.egg-info/
130b29
%{python3_sitelib}/%{srcname}/
130b29
%endif
130b29
130b29
%files doc
130b29
%doc html/ demos/
91e17b
91e17b
%changelog
aa3440
* Thu Mar 22 2018 Pavel Cahyna <pcahyna@redhat.com> - 2.1.1-4
aa3440
- Add a dependency on python2-pyasn1. It used to be a dependency
aa3440
  of python2-cryptography, but it is not the case with newer versions.
aa3440
  (RHBZ #1559133)
aa3440
aa3440
* Wed Mar 21 2018 Pavel Cahyna <pcahyna@redhat.com> - 2.1.1-3
aa3440
- Fix a security flaw (CVE-2018-7750) in Paramiko's server
aa3440
  mode (emphasis on **server** mode; this does **not** impact *client* use!)
aa3440
  Backported from 2.1.5.
aa3440
  Resolves #1557142
aa3440
130b29
* Fri May 12 2017 Pavel Cahyna <pcahyna@redhat.com> - 2.1.1-2
130b29
- Rebuild for RHEL 7.4 Extras
130b29
130b29
* Thu Jan 05 2017 Troy Dawson <tdawson@redhat.com> 2.1.1-1
130b29
- Update to 2.1.1
130b29
130b29
* Fri Jul 08 2016 Jon Schlueter <jschluet@redhat.com> 2.0.0-1.0
130b29
- Rebuild
130b29
130b29
* Fri Apr 29 2016 Igor Gnatenko <ignatenko@redhat.com> - 2.0.0-1
130b29
- Update to 2.0.0 (RHBZ #1331737)
130b29
130b29
* Sun Mar 27 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.16.0-1
130b29
- Update to 1.16.0
130b29
- Adopt to new packaging guidelines
130b29
130b29
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.2-5
130b29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
130b29
130b29
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.15.2-4
130b29
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
130b29
130b29
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.15.2-3
130b29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
130b29
130b29
* Sun Mar 22 2015 Peter Robinson <pbrobinson@fedoraproject.org> 1.15.2-2
130b29
- Use %%license
130b29
- Move duplicated docs to single doc sub package
130b29
- Remove old F-15 conditionals
130b29
130b29
* Tue Dec 23 2014 Athmane Madjoudj <athmane@fedoraproject.org> 1.15.2-1
130b29
- Update to 1.15.2
130b29
130b29
* Mon Nov 24 2014 Athmane Madjoudj <athmane@fedoraproject.org> 1.15.1-5
130b29
- Add conditional to exclude EL since does not have py3
130b29
130b29
* Sat Nov 15 2014 Athmane Madjoudj <athmane@fedoraproject.org> 1.15.1-4
130b29
- py3dir creation should be in prep section
130b29
130b29
* Fri Nov 14 2014 Athmane Madjoudj <athmane@fedoraproject.org> 1.15.1-3
130b29
- Build each pkg in a clean dir
130b29
130b29
* Fri Nov 14 2014 Athmane Madjoudj <athmane@fedoraproject.org> 1.15.1-2
130b29
- Add support for python3
130b29
- Add BR -devel for python macros.
130b29
130b29
* Fri Oct 17 2014 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.15.1-1
130b29
- Update to 1.15.1
130b29
91e17b
* Fri Jun 13 2014 Orion Poplawski <orion@cora.nwra.com> - 1.12.4-1
91e17b
- Update to 1.12.4
91e17b
91e17b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.2-2
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
91e17b
91e17b
* Tue Feb 25 2014 Orion Poplawski <orion@cora.nwra.com> - 1.12.2-1
91e17b
- Update to 1.12.2
91e17b
91e17b
* Wed Jan 22 2014 Orion Poplawski <orion@cora.nwra.com> - 1.11.3-1
91e17b
- Update to 1.11.3
91e17b
91e17b
* Mon Oct 21 2013 Orion Poplawski <orion@cora.nwra.com> - 1.11.0-1
91e17b
- Update to 1.11.0
91e17b
91e17b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.1-2
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
91e17b
91e17b
* Thu May  9 2013 Jeffrey Ollie <jeff@ocjtech.us> - 1.10.1-1
91e17b
- Update to 1.10.1
91e17b
91e17b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-2
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
91e17b
91e17b
* Wed Jan  2 2013 Jeffrey Ollie <jeff@ocjtech.us> - 1.9.0-1
91e17b
- Update to 1.9.0
91e17b
91e17b
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.7.1-3
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
91e17b
91e17b
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.7.1-2
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
91e17b
91e17b
* Wed Jul  6 2011 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.7.1-1
91e17b
- v1.7.7.1 (George) 21may11
91e17b
- -------------------------
91e17b
-   * Make the verification phase of SFTP.put optional (Larry Wright)
91e17b
-   * Patches to fix AIX support (anonymous)
91e17b
-   * Patch from Michele Bertoldi to allow compression to be turned on in the
91e17b
-     client constructor.
91e17b
-   * Patch from Shad Sharma to raise an exception if the transport isn't active
91e17b
-     when you try to open a new channel.
91e17b
-   * Stop leaking file descriptors in the SSH agent (John Adams)
91e17b
-   * More fixes for Windows address family support (Andrew Bennetts)
91e17b
-   * Use Crypto.Random rather than Crypto.Util.RandomPool
91e17b
-     (Gary van der Merwe, #271791)
91e17b
-   * Support for openssl keys (tehfink)
91e17b
-   * Fix multi-process support by calling Random.atfork (sugarc0de)
91e17b
91e17b
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.6-4
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
91e17b
91e17b
* Tue Jan 4 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.6-3
91e17b
- Patch to address deprecation warning from pycrypto
91e17b
- Simplify build as shown in new python guidelines
91e17b
- Enable test suite
91e17b
91e17b
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.7.6-2
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
91e17b
91e17b
* Mon Nov  2 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.6-1
91e17b
- v1.7.6 (Fanny) 1nov09
91e17b
- ---------------------
91e17b
-  * fixed bugs 411099 (sftp chdir isn't unicode-safe), 363163 & 411910 (more
91e17b
-    IPv6 problems on windows), 413850 (race when server closes the channel),
91e17b
-    426925 (support port numbers in host keys)
91e17b
91e17b
* Tue Oct 13 2009 Jeremy Katz <katzj@fedoraproject.org> - 1.7.5-2
91e17b
- Fix race condition (#526341)
91e17b
91e17b
* Thu Jul 23 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.5-1
91e17b
- v1.7.5 (Ernest) 19jul09
91e17b
- -----------------------
91e17b
-  * added support for ARC4 cipher and CTR block chaining (Denis Bernard)
91e17b
-  * made transport threads daemonize, to fix python 2.6 atexit behavior
91e17b
-  * support unicode hostnames, and IP6 addresses (Maxime Ripard, Shikhar
91e17b
-    Bhushan)
91e17b
-  * various small bug fixes
91e17b
91e17b
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.4-5
91e17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
91e17b
91e17b
* Mon Feb 16 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.4-4
91e17b
- Add demos as documentation. BZ#485742
91e17b
91e17b
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.7.4-3
91e17b
- Rebuild for Python 2.6
91e17b
91e17b
* Wed Sep  3 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.7.4-2
91e17b
- fix license tag
91e17b
91e17b
* Sun Jul  6 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.4-1
91e17b
- Update to 1.7.4
91e17b
91e17b
* Mon Mar 24 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.3-1
91e17b
- Update to 1.7.3.
91e17b
91e17b
* Tue Jan 22 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.2-1
91e17b
- Update to 1.7.2.
91e17b
- Remove upstreamed patch.
91e17b
91e17b
* Mon Jan 14 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.1-3
91e17b
- Update to latest Python packaging guidelines.
91e17b
- Apply patch that fixes insecure use of RandomPool.
91e17b
91e17b
* Thu Jul 19 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.1-2
91e17b
- Bump rev
91e17b
91e17b
* Thu Jul 19 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.7.1-1
91e17b
- Update to 1.7.1
91e17b
91e17b
* Sat Dec 09 2006 Toshio Kuratomi <toshio@tiki-lounge.com> - 1.6.4-1
91e17b
- Update to 1.6.4
91e17b
- Upstream is now shipping tarballs
91e17b
- Bump for python 2.5 in devel
91e17b
91e17b
* Mon Oct  9 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.2-1
91e17b
- Update to 1.6.2
91e17b
91e17b
* Sat Sep 16 2006 Shahms E. King <shahms@shahms.com> 1.6.1-3
91e17b
- Rebuild for FC6
91e17b
91e17b
* Fri Aug 11 2006 Shahms E. King <shahms@shahms.com> 1.6.1-2
91e17b
- Include, don't ghost .pyo files per new guidelines
91e17b
91e17b
* Tue Aug 08 2006 Shahms E. King <shahms@shahms.com> 1.6.1-1
91e17b
- Update to new upstream version
91e17b
91e17b
* Fri Jun 02 2006 Shahms E. King <shahms@shahms.com> 1.6-1
91e17b
- Update to new upstream version
91e17b
- ghost the .pyo files
91e17b
91e17b
* Fri May 05 2006 Shahms E. King <shahms@shahms.com> 1.5.4-2
91e17b
- Fix source line and rebuild
91e17b
91e17b
* Fri May 05 2006 Shahms E. King <shahms@shahms.com> 1.5.4-1
91e17b
- Update to new upstream version
91e17b
91e17b
* Wed Apr 12 2006 Shahms E. King <shahms@shahms.com> 1.5.3-1
91e17b
  - Initial package