]> git.pld-linux.org Git - packages/python3-cryptography.git/blame - python3-cryptography.spec
- x32 build fix; release 2
[packages/python3-cryptography.git] / python3-cryptography.spec
CommitLineData
06232684
JB
1#
2# Conditional build:
f63b1331 3%bcond_without doc # Sphinx documentation
163a4ef8 4%bcond_without tests # unit test
06232684 5
e8e4527e 6%define crates_ver 41.0.4
7791f4ce 7
59f13c5c
JR
8Summary: Crypthography library for Python 3
9Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 3
10Name: python3-cryptography
e8e4527e 11Version: 41.0.4
30e99531 12Release: 2
d6e7edf5 13License: Apache v2.0 or BSD
06232684 14Group: Libraries/Python
29d4b67b 15#Source0Download: https://pypi.org/simple/cryptography/
7df50b22 16Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
e8e4527e 17# Source0-md5: e53b22d4baae5430e881f2f516effa67
163a4ef8
JB
18#Source1Download: https://pypi.org/simple/cryptography_vectors/
19Source1: https://files.pythonhosted.org/packages/source/c/cryptography-vectors/cryptography_vectors-%{version}.tar.gz
e8e4527e 20# Source1-md5: baa05bd96d91129bb8123881fca0129d
7791f4ce
JP
21# cd cryptography-%{version}/src/rust
22# cargo vendor
23# tar cJf python3-cryptography-crates-%{version}.tar.xz vendor Cargo.lock
24Source2: %{name}-crates-%{crates_ver}.tar.xz
f36af986 25# Source2-md5: 940f9f8bc4bbdd7d1fe081e38cbf90d3
06232684 26URL: https://cryptography.io/
f36af986 27BuildRequires: openssl-devel >= 1.1.1d
0f792d56 28BuildRequires: python3-cffi >= 1.12
f36af986
JB
29BuildRequires: python3-devel >= 1:3.7
30BuildRequires: python3-setuptools >= 1:61.0.0
31BuildRequires: python3-setuptools_rust >= 0.11.4
32BuildRequires: rpm-build >= 4.6
7791f4ce
JP
33BuildRequires: rpm-pythonprov >= 5.4.15-48
34BuildRequires: rpmbuild(macros) >= 2.004
f36af986 35BuildRequires: rust >= 1.56.0
049a803f 36%if %{with tests}
049a803f 37BuildRequires: python3-hypothesis >= 1.11.4
049a803f 38BuildRequires: python3-pretend
bbccd1ec
JB
39BuildRequires: python3-pytest >= 6.2.0
40BuildRequires: python3-pytest-benchmark
f63b1331 41%endif
f63b1331 42%if %{with doc}
f36af986
JB
43# TODO: bump to 1.1.1 / 5.3.0 resp.
44BuildRequires: python3-sphinx_rtd_theme >= 1.0.0
45BuildRequires: sphinx-pdg-3 >= 4.5.0
7791f4ce
JP
46BuildRequires: tar >= 1:1.22
47BuildRequires: xz
06232684 48%endif
f36af986 49Requires: openssl >= 1.1.1d
7791f4ce 50ExclusiveArch: %{rust_arches}
06232684
JB
51BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53%description
59f13c5c 54cryptography is a package which provides cryptographic recipes and
06232684 55primitives to Python developers. Our goal is for it to be your
59f13c5c
JR
56"cryptographic standard library". It supports Python 3.6+ and
57PyPy3 7.2+.
06232684 58
59f13c5c
JR
59cryptography includes both high level recipes and low level interfaces
60to common cryptographic algorithms such as symmetric ciphers, message
61digests, and key derivation functions.
06232684
JB
62
63%description -l pl.UTF-8
64cryptography to pakiet zaprojektowany w celu udostępnienia funkcji i
65obiektów kryptograficznych programistom Pythona. Celem jest
66dostarczenie "standardowej biblioteki kryptograficznej". Obsługuje
59f13c5c 67Pythona 3.6+ oraz PyPy 7.2+.
06232684
JB
68
69cryptography zawiera zarówno funkcje wysokopoziomowe, jak i
70niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych,
226a2f8d 71takich jak szyfry symetryczne, skróty wiadomości czy funkcje
06232684
JB
72wyprowadzające klucze.
73
f63b1331
JB
74%package apidocs
75Summary: API documentation for cryptography module
76Summary(pl.UTF-8): Dokumentacja API modułu cryptography
77Group: Documentation
094f23d7 78BuildArch: noarch
f63b1331
JB
79
80%description apidocs
81API documentation for cryptography module.
82
83%description apidocs -l pl.UTF-8
84Dokumentacja API modułu cryptography.
85
06232684 86%prep
163a4ef8
JB
87%setup -q -n cryptography-%{version} %{?with_tests:-a1}
88
89%if %{with tests}
90%{__mv} cryptography_vectors-%{version}/cryptography_vectors .
91%endif
06232684 92
7791f4ce
JP
93cd src/rust
94tar xf %{SOURCE2}
95# use our offline registry
96export CARGO_HOME="$(pwd)/.cargo"
97
98mkdir -p "$CARGO_HOME"
99cat >.cargo/config <<EOF
100[source.crates-io]
101registry = 'https://github.com/rust-lang/crates.io-index'
102replace-with = 'vendored-sources'
103
104[source.vendored-sources]
105directory = '$PWD/vendor'
106EOF
107
06232684 108%build
7791f4ce
JP
109export CARGO_HOME="$(pwd)/src/rust/.cargo"
110export CARGO_OFFLINE=true
111export RUSTFLAGS="%{rpmrustflags}"
112export CARGO_TERM_VERBOSE=true
113%ifarch x32
114export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
30e99531 115export PKG_CONFIG_ALLOW_CROSS=1
7791f4ce
JP
116%endif
117
06232684
JB
118export CFLAGS="%{rpmcflags}"
119
503cd915
JB
120%py3_build
121
122%if %{with tests}
f36af986
JB
123PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
124PYTEST_PLUGINS="pytest_benchmark.plugin" \
503cd915
JB
125PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
126%{__python3} -m pytest tests
127%endif
06232684 128
f63b1331
JB
129%if %{with doc}
130%{__make} -C docs html \
131 SPHINXBUILD=sphinx-build-3
132%endif
133
06232684
JB
134%install
135rm -rf $RPM_BUILD_ROOT
136
7791f4ce
JP
137export CARGO_HOME="$(pwd)/src/rust/.cargo"
138export CARGO_OFFLINE=true
139export RUSTFLAGS="%{rpmrustflags}"
140export CARGO_TERM_VERBOSE=true
141%ifarch x32
142export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
30e99531 143export PKG_CONFIG_ALLOW_CROSS=1
7791f4ce
JP
144%endif
145
6d1f8f74 146%py3_install
06232684
JB
147
148%clean
149rm -rf $RPM_BUILD_ROOT
150
06232684
JB
151%files
152%defattr(644,root,root,755)
7a9c1d53 153%doc CHANGELOG.rst CONTRIBUTING.rst LICENSE LICENSE.APACHE LICENSE.BSD README.rst
06232684 154%dir %{py3_sitedir}/cryptography
06232684 155%{py3_sitedir}/cryptography/*.py
7a9c1d53 156%{py3_sitedir}/cryptography/py.typed
06232684
JB
157%{py3_sitedir}/cryptography/__pycache__
158%dir %{py3_sitedir}/cryptography/hazmat
159%{py3_sitedir}/cryptography/hazmat/*.py
160%{py3_sitedir}/cryptography/hazmat/__pycache__
161%dir %{py3_sitedir}/cryptography/hazmat/backends
162%{py3_sitedir}/cryptography/hazmat/backends/*.py
163%{py3_sitedir}/cryptography/hazmat/backends/__pycache__
06232684
JB
164%dir %{py3_sitedir}/cryptography/hazmat/backends/openssl
165%{py3_sitedir}/cryptography/hazmat/backends/openssl/*.py
166%{py3_sitedir}/cryptography/hazmat/backends/openssl/__pycache__
167%dir %{py3_sitedir}/cryptography/hazmat/bindings
168%{py3_sitedir}/cryptography/hazmat/bindings/*.py
169%{py3_sitedir}/cryptography/hazmat/bindings/__pycache__
d198b5a4 170%attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so
7a9c1d53
JP
171%dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust
172%{py3_sitedir}/cryptography/hazmat/bindings/_rust/*.pyi
e8e4527e
AM
173%dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust/openssl
174%{py3_sitedir}/cryptography/hazmat/bindings/_rust/openssl/*.pyi
06232684
JB
175%dir %{py3_sitedir}/cryptography/hazmat/bindings/openssl
176%{py3_sitedir}/cryptography/hazmat/bindings/openssl/*.py
177%{py3_sitedir}/cryptography/hazmat/bindings/openssl/__pycache__
178%dir %{py3_sitedir}/cryptography/hazmat/primitives
179%{py3_sitedir}/cryptography/hazmat/primitives/*.py
180%{py3_sitedir}/cryptography/hazmat/primitives/__pycache__
181%dir %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric
182%{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py
183%{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/__pycache__
184%dir %{py3_sitedir}/cryptography/hazmat/primitives/ciphers
185%{py3_sitedir}/cryptography/hazmat/primitives/ciphers/*.py
186%{py3_sitedir}/cryptography/hazmat/primitives/ciphers/__pycache__
187%dir %{py3_sitedir}/cryptography/hazmat/primitives/kdf
188%{py3_sitedir}/cryptography/hazmat/primitives/kdf/*.py
189%{py3_sitedir}/cryptography/hazmat/primitives/kdf/__pycache__
f63b1331
JB
190%dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization
191%{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py
192%{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__
f7d88309
AM
193%dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor
194%{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py
195%{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__
d198b5a4
AM
196%dir %{py3_sitedir}/cryptography/x509
197%{py3_sitedir}/cryptography/x509/*.py
198%{py3_sitedir}/cryptography/x509/__pycache__
06232684 199%{py3_sitedir}/cryptography-%{version}-py*.egg-info
f63b1331
JB
200
201%if %{with doc}
202%files apidocs
203%defattr(644,root,root,755)
503cd915 204%doc docs/_build/html/{_downloads,_static,development,hazmat,x509,*.html,*.js}
f63b1331 205%endif
This page took 0.214909 seconds and 5 git commands to generate.