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