3 %bcond_with apidocs # API docs packaging # Docs gone since 2.0.1 ?
4 %bcond_without 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: 24ee7e64682c2368176607fa23c39a5e
20 URL: https://github.com/paramiko/paramiko/
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.710
24 BuildRequires: python-cryptography >= 1.1
25 BuildRequires: python-devel >= 1:2.6
26 BuildRequires: python-pyasn1 >= 0.1.7
30 BuildRequires: python3-cryptography >= 1.1
31 BuildRequires: python3-devel >= 1:3.2
32 BuildRequires: python3-pyasn1 >= 0.1.7
35 Requires: python-cryptography >= 1.1
36 Requires: python-modules >= 1:2.6
37 Requires: python-pyasn1 >= 0.1.7
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 A module for Python 2.6 (or higher) that implements the SSH2 protocol
44 for secure (encrypted and authenticated) connections to remote
47 %description -l pl.UTF-8
48 Moduł dla języka Python 2.6 (lub wyższego) implementujący protokół
49 SSH2 dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych)
50 połączeń ze zdalnymi maszynami.
52 %package -n python3-%{module}
53 Summary: SSH2 protocol for Python 3
54 Summary(pl.UTF-8): Obsługa protokołu SSH2 w Pythonie 3
55 Group: Libraries/Python
56 Requires: python3-cryptography >= 1.1
57 Requires: python3-modules >= 1:3.2
58 Requires: python3-pyasn1 >= 0.1.7
60 %description -n python3-%{module}
61 A module for Python 3.2 (or higher) that implements the SSH2 protocol
62 for secure (encrypted and authenticated) connections to remote
65 %description -n python3-%{module} -l pl.UTF-8
66 Moduł dla języka Python 3.2 (lub wyższego) implementujący protokół
67 SSH2 dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych)
68 połączeń ze zdalnymi maszynami.
71 Summary: API documentation for paramiko module
72 Summary(pl.UTF-8): Dokumentacja API modułu paramiko
76 API documentation for paramiko module.
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API modułu paramiko.
82 %setup -q -n %{module}-%{version}
84 find demos -name '*.py' -type f | xargs sed -i -e '1s|#!.*python.*|#!%{_bindir}/python|'
86 # Windows-specific modules, break tests by using Windows-specific ctypes API
87 %{__rm} paramiko/{win_pageant,_winapi}.py
92 %{?with_tests:LC_ALL=C.UTF-8 %{__python} test.py}
97 %{?with_tests:LC_ALL=C.UTF-8 %{__python3} test.py}
101 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
115 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
119 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
120 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
121 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
125 rm -rf $RPM_BUILD_ROOT
129 %defattr(644,root,root,755)
131 %{py_sitescriptdir}/%{module}
132 %{py_sitescriptdir}/%{module}-*.egg-info
133 %{_examplesdir}/%{name}-%{version}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
140 %{py3_sitescriptdir}/%{module}
141 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
142 %{_examplesdir}/python3-%{module}-%{version}
147 %defattr(644,root,root,755)
148 %doc docs/{_static,api,*.html,*.js}