]>
Commit | Line | Data |
---|---|---|
163a4ef8 | 1 | # TODO: when updating try to reenable all tests (two were failing in 2.7 with openssl 1.1.1d) |
06232684 JB |
2 | # |
3 | # Conditional build: | |
049a803f JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
f63b1331 | 6 | %bcond_without doc # Sphinx documentation |
163a4ef8 | 7 | %bcond_without tests # unit test |
06232684 JB |
8 | |
9 | Summary: Crypthography library for Python 2 | |
10 | Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 2 | |
11 | Name: python-cryptography | |
f63b1331 | 12 | Version: 2.7 |
606dca6b | 13 | Release: 1 |
d6e7edf5 | 14 | License: Apache v2.0 or BSD |
06232684 | 15 | Group: Libraries/Python |
29d4b67b | 16 | #Source0Download: https://pypi.org/simple/cryptography/ |
7df50b22 | 17 | Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz |
f63b1331 | 18 | # Source0-md5: 7dfe1035cae43569e571318f000462a4 |
163a4ef8 JB |
19 | #Source1Download: https://pypi.org/simple/cryptography_vectors/ |
20 | Source1: https://files.pythonhosted.org/packages/source/c/cryptography-vectors/cryptography_vectors-%{version}.tar.gz | |
21 | # Source1-md5: 1a518a28ed9c924ca6c570aa8ea0c334 | |
06232684 | 22 | URL: https://cryptography.io/ |
7df50b22 | 23 | BuildRequires: openssl-devel >= 1.0.1 |
d331861d | 24 | BuildRequires: rpm-pythonprov >= 5.4.15-48 |
049a803f | 25 | BuildRequires: rpmbuild(macros) >= 1.714 |
06232684 | 26 | %if %{with python2} |
f63b1331 | 27 | BuildRequires: python-cffi >= 1.8 |
29d4b67b | 28 | BuildRequires: python-devel >= 1:2.7 |
b2fc4ef3 | 29 | BuildRequires: python-enum34 |
29d4b67b JB |
30 | BuildRequires: python-pytz |
31 | BuildRequires: python-setuptools >= 18.5 | |
06232684 | 32 | BuildRequires: python-six >= 1.4.1 |
049a803f | 33 | %if %{with tests} |
29d4b67b | 34 | BuildRequires: python-asn1crypto >= 0.21.0 |
049a803f JB |
35 | %if "%{py_ver}" >= "2.7" |
36 | BuildRequires: python-hypothesis >= 1.11.4 | |
37 | %endif | |
29d4b67b | 38 | BuildRequires: python-idna >= 2.1 |
049a803f JB |
39 | BuildRequires: python-ipaddress |
40 | BuildRequires: python-iso8601 | |
41 | BuildRequires: python-pretend | |
29d4b67b | 42 | BuildRequires: python-pytest >= 3.6.0 |
f63b1331 | 43 | BuildRequires: python-pytz |
049a803f | 44 | %endif |
06232684 JB |
45 | %endif |
46 | %if %{with python3} | |
f63b1331 | 47 | BuildRequires: python3-cffi >= 1.8 |
d331861d | 48 | BuildRequires: python3-devel >= 1:3.4 |
29d4b67b | 49 | BuildRequires: python3-setuptools >= 18.5 |
06232684 | 50 | BuildRequires: python3-six >= 1.4.1 |
049a803f | 51 | %if %{with tests} |
29d4b67b | 52 | BuildRequires: python3-asn1crypto >= 0.21.0 |
049a803f | 53 | BuildRequires: python3-hypothesis >= 1.11.4 |
29d4b67b | 54 | BuildRequires: python3-idna >= 2.1 |
049a803f JB |
55 | BuildRequires: python3-iso8601 |
56 | BuildRequires: python3-pretend | |
29d4b67b | 57 | BuildRequires: python3-pytest >= 3.6.0 |
f63b1331 JB |
58 | BuildRequires: python3-pytz |
59 | %endif | |
049a803f | 60 | %endif |
f63b1331 JB |
61 | %if %{with doc} |
62 | BuildRequires: python3-sphinx_rtd_theme | |
63 | BuildRequires: sphinx-pdg-3 >= 1.6.5 | |
06232684 | 64 | %endif |
7df50b22 | 65 | Requires: openssl >= 1.0.1 |
06232684 JB |
66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
67 | ||
68 | %description | |
69 | cryptography is a package designed to expose cryptographic recipes and | |
70 | primitives to Python developers. Our goal is for it to be your | |
163a4ef8 JB |
71 | "cryptographic standard library". It supports Python 2.7, Python 3.4+, |
72 | and PyPy. | |
06232684 JB |
73 | |
74 | cryptography includes both high level recipes, and low level | |
75 | interfaces to common cryptographic algorithms such as symmetric | |
76 | ciphers, message digests and key derivation functions. | |
77 | ||
78 | This package contains Python 2 modules. | |
79 | ||
80 | %description -l pl.UTF-8 | |
81 | cryptography to pakiet zaprojektowany w celu udostępnienia funkcji i | |
82 | obiektów kryptograficznych programistom Pythona. Celem jest | |
83 | dostarczenie "standardowej biblioteki kryptograficznej". Obsługuje | |
163a4ef8 | 84 | Pythona 2.7, Pythona 3.4+ oraz PyPy. |
06232684 JB |
85 | |
86 | cryptography zawiera zarówno funkcje wysokopoziomowe, jak i | |
87 | niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych, | |
226a2f8d | 88 | takich jak szyfry symetryczne, skróty wiadomości czy funkcje |
06232684 JB |
89 | wyprowadzające klucze. |
90 | ||
91 | Ten pakiet zawiera moduły Pythona 2. | |
92 | ||
93 | %package -n python3-cryptography | |
94 | Summary: Crypthography library for Python 3 | |
95 | Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 3 | |
96 | Group: Libraries/Python | |
7df50b22 | 97 | Requires: openssl >= 1.0.1 |
06232684 JB |
98 | |
99 | %description -n python3-cryptography | |
100 | cryptography is a package designed to expose cryptographic recipes and | |
101 | primitives to Python developers. Our goal is for it to be your | |
163a4ef8 JB |
102 | "cryptographic standard library". It supports Python 2.7, Python 3.4+, |
103 | and PyPy. | |
06232684 JB |
104 | |
105 | cryptography includes both high level recipes, and low level | |
106 | interfaces to common cryptographic algorithms such as symmetric | |
107 | ciphers, message digests and key derivation functions. | |
108 | ||
109 | This package contains Python 3 modules. | |
110 | ||
111 | %description -n python3-cryptography -l pl.UTF-8 | |
112 | cryptography to pakiet zaprojektowany w celu udostępnienia funkcji i | |
113 | obiektów kryptograficznych programistom Pythona. Celem jest | |
114 | dostarczenie "standardowej biblioteki kryptograficznej". Obsługuje | |
163a4ef8 | 115 | Pythona 2.7, Pythona 3.4+ oraz PyPy. |
06232684 JB |
116 | |
117 | cryptography zawiera zarówno funkcje wysokopoziomowe, jak i | |
118 | niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych, | |
226a2f8d | 119 | takich jak szyfry symetryczne, skróty wiadomości czy funkcje |
06232684 JB |
120 | wyprowadzające klucze. |
121 | ||
122 | Ten pakiet zawiera moduły Pythona 3. | |
123 | ||
f63b1331 JB |
124 | %package apidocs |
125 | Summary: API documentation for cryptography module | |
126 | Summary(pl.UTF-8): Dokumentacja API modułu cryptography | |
127 | Group: Documentation | |
094f23d7 JB |
128 | %if "%{_rpmversion}" >= "5" |
129 | BuildArch: noarch | |
130 | %endif | |
f63b1331 JB |
131 | |
132 | %description apidocs | |
133 | API documentation for cryptography module. | |
134 | ||
135 | %description apidocs -l pl.UTF-8 | |
136 | Dokumentacja API modułu cryptography. | |
137 | ||
06232684 | 138 | %prep |
163a4ef8 JB |
139 | %setup -q -n cryptography-%{version} %{?with_tests:-a1} |
140 | ||
141 | %if %{with tests} | |
142 | %{__mv} cryptography_vectors-%{version}/cryptography_vectors . | |
143 | %endif | |
06232684 JB |
144 | |
145 | %build | |
146 | export CFLAGS="%{rpmcflags}" | |
147 | ||
148 | %if %{with python2} | |
163a4ef8 JB |
149 | %py_build |
150 | ||
151 | %if %{with tests} | |
152 | PYTHONPATH=$(pwd) \ | |
153 | %{__python} -m pytest tests -k 'not test_dh_parameters_supported and not test_load_ecdsa_no_named_curve' | |
154 | %endif | |
06232684 JB |
155 | %endif |
156 | ||
157 | %if %{with python2} | |
163a4ef8 JB |
158 | %py3_build |
159 | ||
160 | %if %{with tests} | |
161 | PYTHONPATH=$(pwd) \ | |
162 | %{__python3} -m pytest tests -k 'not test_dh_parameters_supported and not test_load_ecdsa_no_named_curve' | |
163 | %endif | |
06232684 JB |
164 | %endif |
165 | ||
f63b1331 JB |
166 | %if %{with doc} |
167 | %{__make} -C docs html \ | |
168 | SPHINXBUILD=sphinx-build-3 | |
169 | %endif | |
170 | ||
06232684 JB |
171 | %install |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | ||
174 | %if %{with python2} | |
6d1f8f74 | 175 | %py_install |
06232684 JB |
176 | |
177 | %py_postclean | |
178 | %endif | |
179 | ||
180 | %if %{with python3} | |
6d1f8f74 | 181 | %py3_install |
06232684 JB |
182 | %endif |
183 | ||
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
187 | %if %{with python2} | |
188 | %files | |
189 | %defattr(644,root,root,755) | |
049a803f | 190 | %doc AUTHORS.rst README.rst LICENSE LICENSE.APACHE LICENSE.BSD |
06232684 | 191 | %dir %{py_sitedir}/cryptography |
06232684 JB |
192 | %{py_sitedir}/cryptography/*.py[co] |
193 | %dir %{py_sitedir}/cryptography/hazmat | |
194 | %{py_sitedir}/cryptography/hazmat/*.py[co] | |
195 | %dir %{py_sitedir}/cryptography/hazmat/backends | |
196 | %{py_sitedir}/cryptography/hazmat/backends/*.py[co] | |
06232684 JB |
197 | %dir %{py_sitedir}/cryptography/hazmat/backends/openssl |
198 | %{py_sitedir}/cryptography/hazmat/backends/openssl/*.py[co] | |
199 | %dir %{py_sitedir}/cryptography/hazmat/bindings | |
200 | %{py_sitedir}/cryptography/hazmat/bindings/*.py[co] | |
d198b5a4 | 201 | %attr(755,root,root) %{py_sitedir}/cryptography/hazmat/bindings/_*.so |
06232684 JB |
202 | %dir %{py_sitedir}/cryptography/hazmat/bindings/openssl |
203 | %{py_sitedir}/cryptography/hazmat/bindings/openssl/*.py[co] | |
204 | %dir %{py_sitedir}/cryptography/hazmat/primitives | |
205 | %{py_sitedir}/cryptography/hazmat/primitives/*.py[co] | |
206 | %dir %{py_sitedir}/cryptography/hazmat/primitives/asymmetric | |
207 | %{py_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py[co] | |
208 | %dir %{py_sitedir}/cryptography/hazmat/primitives/ciphers | |
209 | %{py_sitedir}/cryptography/hazmat/primitives/ciphers/*.py[co] | |
210 | %dir %{py_sitedir}/cryptography/hazmat/primitives/kdf | |
211 | %{py_sitedir}/cryptography/hazmat/primitives/kdf/*.py[co] | |
f63b1331 JB |
212 | %dir %{py_sitedir}/cryptography/hazmat/primitives/serialization |
213 | %{py_sitedir}/cryptography/hazmat/primitives/serialization/*.py[co] | |
f7d88309 AM |
214 | %dir %{py_sitedir}/cryptography/hazmat/primitives/twofactor |
215 | %{py_sitedir}/cryptography/hazmat/primitives/twofactor/*.py[co] | |
d198b5a4 AM |
216 | %dir %{py_sitedir}/cryptography/x509 |
217 | %{py_sitedir}/cryptography/x509/*.py[co] | |
06232684 JB |
218 | %{py_sitedir}/cryptography-%{version}-py*.egg-info |
219 | %endif | |
220 | ||
221 | %if %{with python3} | |
222 | %files -n python3-cryptography | |
223 | %defattr(644,root,root,755) | |
049a803f | 224 | %doc AUTHORS.rst README.rst LICENSE LICENSE.APACHE LICENSE.BSD |
06232684 | 225 | %dir %{py3_sitedir}/cryptography |
06232684 JB |
226 | %{py3_sitedir}/cryptography/*.py |
227 | %{py3_sitedir}/cryptography/__pycache__ | |
228 | %dir %{py3_sitedir}/cryptography/hazmat | |
229 | %{py3_sitedir}/cryptography/hazmat/*.py | |
230 | %{py3_sitedir}/cryptography/hazmat/__pycache__ | |
231 | %dir %{py3_sitedir}/cryptography/hazmat/backends | |
232 | %{py3_sitedir}/cryptography/hazmat/backends/*.py | |
233 | %{py3_sitedir}/cryptography/hazmat/backends/__pycache__ | |
06232684 JB |
234 | %dir %{py3_sitedir}/cryptography/hazmat/backends/openssl |
235 | %{py3_sitedir}/cryptography/hazmat/backends/openssl/*.py | |
236 | %{py3_sitedir}/cryptography/hazmat/backends/openssl/__pycache__ | |
237 | %dir %{py3_sitedir}/cryptography/hazmat/bindings | |
238 | %{py3_sitedir}/cryptography/hazmat/bindings/*.py | |
239 | %{py3_sitedir}/cryptography/hazmat/bindings/__pycache__ | |
d198b5a4 | 240 | %attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so |
06232684 JB |
241 | %dir %{py3_sitedir}/cryptography/hazmat/bindings/openssl |
242 | %{py3_sitedir}/cryptography/hazmat/bindings/openssl/*.py | |
243 | %{py3_sitedir}/cryptography/hazmat/bindings/openssl/__pycache__ | |
244 | %dir %{py3_sitedir}/cryptography/hazmat/primitives | |
245 | %{py3_sitedir}/cryptography/hazmat/primitives/*.py | |
246 | %{py3_sitedir}/cryptography/hazmat/primitives/__pycache__ | |
247 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric | |
248 | %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py | |
249 | %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/__pycache__ | |
250 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/ciphers | |
251 | %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/*.py | |
252 | %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/__pycache__ | |
253 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/kdf | |
254 | %{py3_sitedir}/cryptography/hazmat/primitives/kdf/*.py | |
255 | %{py3_sitedir}/cryptography/hazmat/primitives/kdf/__pycache__ | |
f63b1331 JB |
256 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization |
257 | %{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py | |
258 | %{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__ | |
f7d88309 AM |
259 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor |
260 | %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py | |
261 | %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__ | |
d198b5a4 AM |
262 | %dir %{py3_sitedir}/cryptography/x509 |
263 | %{py3_sitedir}/cryptography/x509/*.py | |
264 | %{py3_sitedir}/cryptography/x509/__pycache__ | |
06232684 JB |
265 | %{py3_sitedir}/cryptography-%{version}-py*.egg-info |
266 | %endif | |
f63b1331 JB |
267 | |
268 | %if %{with doc} | |
269 | %files apidocs | |
270 | %defattr(644,root,root,755) | |
271 | %doc docs/_build/html/{_downloads,_modules,_static,development,hazmat,x509,*.html,*.js} | |
272 | %endif |