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