3 %bcond_with apidocs # API docs packaging # Docs gone since 2.0.1 ?
4 %bcond_with tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module paramiko
9 Summary: SSH2 protocol for Python 2
10 Summary(pl.UTF-8): Obsługa protokołu SSH2 w Pythonie 2
11 Name: python-%{module}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/paramiko/
18 Source0: https://github.com/paramiko/paramiko/archive/%{version}.tar.gz
19 # Source0-md5: 7de566f1b0a65c59c635ccce7469604b
20 URL: https://github.com/paramiko/paramiko/
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.710
24 BuildRequires: python-PyNaCl >= 1.0.1
25 BuildRequires: python-bcrypt >= 3.1.3
26 BuildRequires: python-cryptography >= 1.5
27 BuildRequires: python-devel >= 1:2.6
28 BuildRequires: python-pyasn1 >= 0.1.7
29 %{?with_tests:BuildRequires: python-pytest}
32 BuildRequires: python3-PyNaCl >= 1.0.1
33 BuildRequires: python3-bcrypt >= 3.1.3
34 BuildRequires: python3-cryptography >= 1.5
35 BuildRequires: python3-devel >= 1:3.2
36 BuildRequires: python3-pyasn1 >= 0.1.7
37 %{?with_tests:BuildRequires: python3-pytest}
39 Requires: python-PyNaCl >= 1.0.1
40 Requires: python-bcrypt >= 3.1.3
41 Requires: python-cryptography >= 1.5
42 Requires: python-pyasn1 >= 0.1.7
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 A module for Python 2.6 (or higher) that implements the SSH2 protocol
49 for secure (encrypted and authenticated) connections to remote
52 %description -l pl.UTF-8
53 Moduł dla języka Python 2.6 (lub wyższego) implementujący protokół
54 SSH2 dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych)
55 połączeń ze zdalnymi maszynami.
57 %package -n python3-%{module}
58 Summary: SSH2 protocol for Python 3
59 Summary(pl.UTF-8): Obsługa protokołu SSH2 w Pythonie 3
60 Group: Libraries/Python
61 Requires: python3-PyNaCl >= 1.0.1
62 Requires: python3-bcrypt >= 3.1.3
63 Requires: python3-cryptography >= 1.1
64 Requires: python3-modules >= 1:3.2
65 Requires: python3-pyasn1 >= 0.1.7
67 %description -n python3-%{module}
68 A module for Python 3.2 (or higher) that implements the SSH2 protocol
69 for secure (encrypted and authenticated) connections to remote
72 %description -n python3-%{module} -l pl.UTF-8
73 Moduł dla języka Python 3.2 (lub wyższego) implementujący protokół
74 SSH2 dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych)
75 połączeń ze zdalnymi maszynami.
78 Summary: API documentation for paramiko module
79 Summary(pl.UTF-8): Dokumentacja API modułu paramiko
83 API documentation for paramiko module.
85 %description apidocs -l pl.UTF-8
86 Dokumentacja API modułu paramiko.
89 %setup -q -n %{module}-%{version}
91 find demos -name '*.py' -type f | xargs sed -i -e '1s|#!.*python.*|#!%{_bindir}/python|'
93 # Windows-specific modules, break tests by using Windows-specific ctypes API
94 %{__rm} paramiko/{win_pageant,_winapi}.py
98 %py_build %{?with_tests:test}
102 %py3_build %{?with_tests:test}
106 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
124 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
125 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
126 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
130 rm -rf $RPM_BUILD_ROOT
134 %defattr(644,root,root,755)
136 %{py_sitescriptdir}/%{module}
137 %{py_sitescriptdir}/%{module}-*.egg-info
138 %{_examplesdir}/%{name}-%{version}
142 %files -n python3-%{module}
143 %defattr(644,root,root,755)
145 %{py3_sitescriptdir}/%{module}
146 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
147 %{_examplesdir}/python3-%{module}-%{version}
152 %defattr(644,root,root,755)
153 %doc docs/{_static,api,*.html,*.js}