3 %bcond_without python2 # CPython 2.x module
4 %bcond_with python3 # CPython 3.x module
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # unit tests
8 Summary: Crypthography library for Python 2
9 Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 2
10 Name: python-cryptography
13 License: Apache v2.0 or BSD
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/cryptography/
16 Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
17 # Source0-md5: e2ce2ec8a63965fad351f36ed70fde4b
18 #Source1Download: https://pypi.org/simple/cryptography_vectors/
19 Source1: https://files.pythonhosted.org/packages/source/c/cryptography-vectors/cryptography_vectors-%{version}.tar.gz
20 # Source1-md5: 79785df0f2d43f05895991b7e067a2ce
21 Patch0: openssl3.patch
22 Patch1: openssl3-tests.patch
23 URL: https://cryptography.io/
24 BuildRequires: openssl-devel >= 1.1.0
25 BuildRequires: rpm-build >= 4.6
26 BuildRequires: rpm-pythonprov >= 5.4.15-48
27 BuildRequires: rpmbuild(macros) >= 1.714
29 BuildRequires: python-cffi >= 1.12
30 BuildRequires: python-devel >= 1:2.7
31 BuildRequires: python-enum34
32 BuildRequires: python-pytz
33 BuildRequires: python-setuptools >= 1:18.5
34 BuildRequires: python-six >= 1.4.1
36 %if "%{py_ver}" >= "2.7"
37 BuildRequires: python-hypothesis >= 1.11.4
39 BuildRequires: python-ipaddress
40 BuildRequires: python-iso8601
41 BuildRequires: python-pretend
42 BuildRequires: python-pytest >= 3.6.0
43 BuildRequires: python-pytz
47 BuildRequires: python3-cffi >= 1.12
48 BuildRequires: python3-devel >= 1:3.6
49 BuildRequires: python3-setuptools >= 1:18.5
50 BuildRequires: python3-six >= 1.4.1
52 BuildRequires: python3-hypothesis >= 1.11.4
53 BuildRequires: python3-iso8601
54 BuildRequires: python3-pretend
55 BuildRequires: python3-pytest >= 3.6.0
56 BuildRequires: python3-pytz
60 BuildRequires: python-sphinx_rtd_theme
61 BuildRequires: sphinx-pdg-2 >= 1.6.5
63 Requires: openssl >= 1.1.0
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 cryptography is a package designed to expose cryptographic recipes and
68 primitives to Python developers. Our goal is for it to be your
69 "cryptographic standard library". It supports Python 2.7, Python 3.4+,
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.
76 This package contains Python 2 modules.
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
82 Pythona 2.7, Pythona 3.4+ oraz PyPy.
84 cryptography zawiera zarówno funkcje wysokopoziomowe, jak i
85 niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych,
86 takich jak szyfry symetryczne, skróty wiadomości czy funkcje
87 wyprowadzające klucze.
89 Ten pakiet zawiera moduły Pythona 2.
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
95 Requires: openssl >= 1.1.0
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
100 "cryptographic standard library". It supports Python 2.7, Python 3.4+,
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.
107 This package contains Python 3 modules.
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
113 Pythona 2.7, Pythona 3.4+ oraz PyPy.
115 cryptography zawiera zarówno funkcje wysokopoziomowe, jak i
116 niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych,
117 takich jak szyfry symetryczne, skróty wiadomości czy funkcje
118 wyprowadzające klucze.
120 Ten pakiet zawiera moduły Pythona 3.
123 Summary: API documentation for cryptography module
124 Summary(pl.UTF-8): Dokumentacja API modułu cryptography
129 API documentation for cryptography module.
131 %description apidocs -l pl.UTF-8
132 Dokumentacja API modułu cryptography.
135 %setup -q -n cryptography-%{version} %{?with_tests:-a1}
138 # Do not test legacy, disabled by default algorithms
139 # See man OSSL_PROVIDER-legacy(7)
140 %{__rm} tests/hazmat/primitives/test_{arc4,blowfish,cast5,idea,seed}.py
143 %{__mv} cryptography_vectors-%{version}/cryptography_vectors .
148 export CFLAGS="%{rpmcflags}"
154 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
155 %{__python} -m pytest tests
163 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
164 %{__python3} -m pytest tests
169 %{__make} -C docs html \
170 SPHINXBUILD=sphinx-build-2
174 rm -rf $RPM_BUILD_ROOT
187 rm -rf $RPM_BUILD_ROOT
191 %defattr(644,root,root,755)
192 %doc AUTHORS.rst README.rst LICENSE LICENSE.APACHE LICENSE.BSD
193 %dir %{py_sitedir}/cryptography
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]
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]
203 %attr(755,root,root) %{py_sitedir}/cryptography/hazmat/bindings/_*.so
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]
214 %dir %{py_sitedir}/cryptography/hazmat/primitives/serialization
215 %{py_sitedir}/cryptography/hazmat/primitives/serialization/*.py[co]
216 %dir %{py_sitedir}/cryptography/hazmat/primitives/twofactor
217 %{py_sitedir}/cryptography/hazmat/primitives/twofactor/*.py[co]
218 %dir %{py_sitedir}/cryptography/x509
219 %{py_sitedir}/cryptography/x509/*.py[co]
220 %{py_sitedir}/cryptography-%{version}-py*.egg-info
224 %files -n python3-cryptography
225 %defattr(644,root,root,755)
226 %doc AUTHORS.rst README.rst LICENSE LICENSE.APACHE LICENSE.BSD
227 %dir %{py3_sitedir}/cryptography
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__
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__
242 %attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so
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__
258 %dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization
259 %{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py
260 %{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__
261 %dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor
262 %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py
263 %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__
264 %dir %{py3_sitedir}/cryptography/x509
265 %{py3_sitedir}/cryptography/x509/*.py
266 %{py3_sitedir}/cryptography/x509/__pycache__
267 %{py3_sitedir}/cryptography-%{version}-py*.egg-info
272 %defattr(644,root,root,755)
273 %doc docs/_build/html/{_downloads,_static,development,hazmat,x509,*.html,*.js}