3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit test
6 %define crates_ver 38.0.0
8 Summary: Crypthography library for Python 3
9 Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 3
10 Name: python3-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: 2148f1283f22df0677e204e46bccaf06
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: 6de6212b7b4dd45290f78e57e67cb093
21 # cd cryptography-%{version}/src/rust
23 # tar cJf python3-cryptography-crates-%{version}.tar.xz vendor Cargo.lock
24 Source2: %{name}-crates-%{crates_ver}.tar.xz
25 # Source2-md5: 7e0cabcabe80dfab99928226e9b8c2a1
26 URL: https://cryptography.io/
27 BuildRequires: openssl-devel >= 1.1.0
28 BuildRequires: python3-cffi >= 1.12
29 BuildRequires: python3-devel >= 1:3.6
30 BuildRequires: python3-setuptools >= 1:18.5
31 BuildRequires: python3-setuptools_rust
32 BuildRequires: python3-six >= 1.4.1
33 BuildRequires: rpm-pythonprov >= 5.4.15-48
34 BuildRequires: rpmbuild(macros) >= 2.004
35 BuildRequires: rust >= 1.48.0
37 BuildRequires: python3-hypothesis >= 1.11.4
38 BuildRequires: python3-iso8601
39 BuildRequires: python3-pretend
40 BuildRequires: python3-pytest >= 6.2.0
41 BuildRequires: python3-pytest-benchmark
42 BuildRequires: python3-pytest-subtests
43 BuildRequires: python3-pytz
46 BuildRequires: python3-sphinx_rtd_theme
47 BuildRequires: sphinx-pdg-3 >= 1.6.5
48 BuildRequires: tar >= 1:1.22
51 Requires: openssl >= 1.1.0
52 ExclusiveArch: %{rust_arches}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 cryptography is a package which provides cryptographic recipes and
57 primitives to Python developers. Our goal is for it to be your
58 "cryptographic standard library". It supports Python 3.6+ and
61 cryptography includes both high level recipes and low level interfaces
62 to common cryptographic algorithms such as symmetric ciphers, message
63 digests, and key derivation functions.
65 %description -l pl.UTF-8
66 cryptography to pakiet zaprojektowany w celu udostępnienia funkcji i
67 obiektów kryptograficznych programistom Pythona. Celem jest
68 dostarczenie "standardowej biblioteki kryptograficznej". Obsługuje
69 Pythona 3.6+ oraz PyPy 7.2+.
71 cryptography zawiera zarówno funkcje wysokopoziomowe, jak i
72 niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych,
73 takich jak szyfry symetryczne, skróty wiadomości czy funkcje
74 wyprowadzające klucze.
77 Summary: API documentation for cryptography module
78 Summary(pl.UTF-8): Dokumentacja API modułu cryptography
83 API documentation for cryptography module.
85 %description apidocs -l pl.UTF-8
86 Dokumentacja API modułu cryptography.
89 %setup -q -n cryptography-%{version} %{?with_tests:-a1}
92 %{__mv} cryptography_vectors-%{version}/cryptography_vectors .
97 # use our offline registry
98 export CARGO_HOME="$(pwd)/.cargo"
100 mkdir -p "$CARGO_HOME"
101 cat >.cargo/config <<EOF
103 registry = 'https://github.com/rust-lang/crates.io-index'
104 replace-with = 'vendored-sources'
106 [source.vendored-sources]
107 directory = '$PWD/vendor'
111 export CARGO_HOME="$(pwd)/src/rust/.cargo"
112 export CARGO_OFFLINE=true
113 export RUSTFLAGS="%{rpmrustflags}"
114 export CARGO_TERM_VERBOSE=true
116 export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
119 export CFLAGS="%{rpmcflags}"
124 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
125 %{__python3} -m pytest tests
129 %{__make} -C docs html \
130 SPHINXBUILD=sphinx-build-3
134 rm -rf $RPM_BUILD_ROOT
136 export CARGO_HOME="$(pwd)/src/rust/.cargo"
137 export CARGO_OFFLINE=true
138 export RUSTFLAGS="%{rpmrustflags}"
139 export CARGO_TERM_VERBOSE=true
141 export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
147 rm -rf $RPM_BUILD_ROOT
150 %defattr(644,root,root,755)
151 %doc CHANGELOG.rst CONTRIBUTING.rst LICENSE LICENSE.APACHE LICENSE.BSD README.rst
152 %dir %{py3_sitedir}/cryptography
153 %{py3_sitedir}/cryptography/*.py
154 %{py3_sitedir}/cryptography/py.typed
155 %{py3_sitedir}/cryptography/__pycache__
156 %dir %{py3_sitedir}/cryptography/hazmat
157 %{py3_sitedir}/cryptography/hazmat/*.py
158 %{py3_sitedir}/cryptography/hazmat/__pycache__
159 %dir %{py3_sitedir}/cryptography/hazmat/backends
160 %{py3_sitedir}/cryptography/hazmat/backends/*.py
161 %{py3_sitedir}/cryptography/hazmat/backends/__pycache__
162 %dir %{py3_sitedir}/cryptography/hazmat/backends/openssl
163 %{py3_sitedir}/cryptography/hazmat/backends/openssl/*.py
164 %{py3_sitedir}/cryptography/hazmat/backends/openssl/__pycache__
165 %dir %{py3_sitedir}/cryptography/hazmat/bindings
166 %{py3_sitedir}/cryptography/hazmat/bindings/*.py
167 %{py3_sitedir}/cryptography/hazmat/bindings/*.pyi
168 %{py3_sitedir}/cryptography/hazmat/bindings/__pycache__
169 %attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so
170 %dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust
171 %{py3_sitedir}/cryptography/hazmat/bindings/_rust/*.pyi
172 %dir %{py3_sitedir}/cryptography/hazmat/bindings/openssl
173 %{py3_sitedir}/cryptography/hazmat/bindings/openssl/*.py
174 %{py3_sitedir}/cryptography/hazmat/bindings/openssl/__pycache__
175 %dir %{py3_sitedir}/cryptography/hazmat/primitives
176 %{py3_sitedir}/cryptography/hazmat/primitives/*.py
177 %{py3_sitedir}/cryptography/hazmat/primitives/__pycache__
178 %dir %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric
179 %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py
180 %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/__pycache__
181 %dir %{py3_sitedir}/cryptography/hazmat/primitives/ciphers
182 %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/*.py
183 %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/__pycache__
184 %dir %{py3_sitedir}/cryptography/hazmat/primitives/kdf
185 %{py3_sitedir}/cryptography/hazmat/primitives/kdf/*.py
186 %{py3_sitedir}/cryptography/hazmat/primitives/kdf/__pycache__
187 %dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization
188 %{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py
189 %{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__
190 %dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor
191 %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py
192 %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__
193 %dir %{py3_sitedir}/cryptography/x509
194 %{py3_sitedir}/cryptography/x509/*.py
195 %{py3_sitedir}/cryptography/x509/__pycache__
196 %{py3_sitedir}/cryptography-%{version}-py*.egg-info
200 %defattr(644,root,root,755)
201 %doc docs/_build/html/{_downloads,_static,development,hazmat,x509,*.html,*.js}