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