]> git.pld-linux.org Git - packages/python-paramiko.git/blob - python-paramiko.spec
38ff5b725e64442c7c648bf7939de502f27e5dc2
[packages/python-paramiko.git] / python-paramiko.spec
1 #
2 # Conditional build:
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
7
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}
12 Version:        2.0.1
13 Release:        4
14 License:        LGPL v2.1+
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/paramiko/
17
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
23 %if %{with python2}
24 BuildRequires:  python-cryptography >= 1.1
25 BuildRequires:  python-devel >= 1:2.6
26 BuildRequires:  python-pyasn1 >= 0.1.7
27
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-cryptography >= 1.1
31 BuildRequires:  python3-devel >= 1:3.2
32 BuildRequires:  python3-pyasn1 >= 0.1.7
33
34 %endif
35 Requires:       python-cryptography >= 1.1
36 Requires:       python-modules >= 1:2.6
37 Requires:       python-pyasn1 >= 0.1.7
38
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 A module for Python 2.6 (or higher) that implements the SSH2 protocol
44 for secure (encrypted and authenticated) connections to remote
45 machines.
46
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.
51
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
59
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
63 machines.
64
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.
69
70 %package apidocs
71 Summary:        API documentation for paramiko module
72 Summary(pl.UTF-8):      Dokumentacja API modułu paramiko
73 Group:          Documentation
74
75 %description apidocs
76 API documentation for paramiko module.
77
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API modułu paramiko.
80
81 %prep
82 %setup -q -n %{module}-%{version}
83
84 find demos -name '*.py' -type f | xargs sed -i -e '1s|#!.*python.*|#!%{_bindir}/python|'
85
86 # Windows-specific modules, break tests by using Windows-specific ctypes API
87 %{__rm} paramiko/{win_pageant,_winapi}.py
88
89 %build
90 %if %{with python2}
91 %py_build
92 %{?with_tests:LC_ALL=C.UTF-8 %{__python} test.py}
93 %endif
94
95 %if %{with python3}
96 %py3_build
97 %{?with_tests:LC_ALL=C.UTF-8 %{__python3} test.py}
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %py_install
105
106 %py_postclean
107 %endif
108
109 %if %{with python3}
110 %py3_install
111 %endif
112
113 %if %{with python2}
114 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
115 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
116 %endif
117 %if %{with python3}
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}|'
122 %endif
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %files
129 %defattr(644,root,root,755)
130 %doc README.rst
131 %{py_sitescriptdir}/%{module}
132 %{py_sitescriptdir}/%{module}-*.egg-info
133 %{_examplesdir}/%{name}-%{version}
134 %endif
135
136 %if %{with python3}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc README.rst
140 %{py3_sitescriptdir}/%{module}
141 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
142 %{_examplesdir}/python3-%{module}-%{version}
143 %endif
144
145 %if %{with apidocs}
146 %files apidocs
147 %defattr(644,root,root,755)
148 %doc docs/{_static,api,*.html,*.js}
149 %endif
This page took 0.098146 seconds and 2 git commands to generate.