-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython3-cryptography.spec
More file actions
224 lines (198 loc) · 7.79 KB
/
Copy pathpython3-cryptography.spec
File metadata and controls
224 lines (198 loc) · 7.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#
# Conditional build:
%bcond_without doc # Sphinx documentation
%bcond_without tests # unit test
%define crates_ver 50.0.0
Summary: Crypthography library for Python 3
Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 3
Name: python3-cryptography
Version: 50.0.0
Release: 1
License: Apache v2.0 or BSD
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/cryptography/
Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
# Source0-md5: 34159691358a924504ca0877c73bf75c
#Source1Download: https://pypi.org/simple/cryptography_vectors/
Source1: https://files.pythonhosted.org/packages/source/c/cryptography-vectors/cryptography_vectors-%{version}.tar.gz
# Source1-md5: fa59de8c35d5abeec1c8c6d2c6854017
# cd cryptography-%{version}
# cargo vendor-filterer --platform='*-unknown-linux-*' --tier=2
# tar cJf cryptography-crates-%{version}.tar.xz vendor Cargo.lock
Source2: cryptography-crates-%{crates_ver}.tar.xz
# Source2-md5: d14be203c87399c800a4c5c0e4f0a7ac
URL: https://cryptography.io/
BuildRequires: openssl-devel >= 1.1.1d
BuildRequires: python3-build >= 1.0.0
BuildRequires: python3-cffi >= 2.0
BuildRequires: python3-devel >= 1:3.9.2
BuildRequires: python3-installer
BuildRequires: python3-maturin >= 1.14.1
BuildRequires: python3-maturin < 2
BuildRequires: python3-setuptools >= 1:75
BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov >= 5.4.15-48
BuildRequires: rpmbuild(macros) >= 2.050
BuildRequires: rust >= 1.83.0
%if %{with tests}
BuildRequires: python3-certifi >= 2024
BuildRequires: python3-pretend >= 0.7
BuildRequires: python3-pytest >= 7.4.0
BuildRequires: python3-pytest-benchmark >= 4.0
BuildRequires: unzip
%endif
%if %{with doc}
BuildRequires: python3-sphinx_rtd_theme >= 3.0.0
BuildRequires: python3-sphinx_inline_tabs
BuildRequires: sphinx-pdg-3 >= 5.3.0
BuildRequires: tar >= 1:1.22
BuildRequires: xz
%endif
%{?rust_req}
Requires: openssl >= 1.1.1d
ExclusiveArch: %{rust_arches}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
cryptography is a package which provides cryptographic recipes and
primitives to Python developers. Our goal is for it to be your
"cryptographic standard library". It supports Python 3.6+ and
PyPy3 7.2+.
cryptography includes both high level recipes and low level interfaces
to common cryptographic algorithms such as symmetric ciphers, message
digests, and key derivation functions.
%description -l pl.UTF-8
cryptography to pakiet zaprojektowany w celu udostępnienia funkcji i
obiektów kryptograficznych programistom Pythona. Celem jest
dostarczenie "standardowej biblioteki kryptograficznej". Obsługuje
Pythona 3.6+ oraz PyPy 7.2+.
cryptography zawiera zarówno funkcje wysokopoziomowe, jak i
niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych,
takich jak szyfry symetryczne, skróty wiadomości czy funkcje
wyprowadzające klucze.
%package apidocs
Summary: API documentation for cryptography module
Summary(pl.UTF-8): Dokumentacja API modułu cryptography
Group: Documentation
BuildArch: noarch
%description apidocs
API documentation for cryptography module.
%description apidocs -l pl.UTF-8
Dokumentacja API modułu cryptography.
%prep
%setup -q -n cryptography-%{version} %{?with_tests:-a1} -a2
%if %{with tests}
%{__mv} cryptography_vectors-%{version}/cryptography_vectors .
%endif
# use our offline registry
export CARGO_HOME="$(pwd)/.cargo"
mkdir -p "$CARGO_HOME"
cat >.cargo/config.toml <<EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = '$PWD/vendor'
EOF
%build
export CARGO_HOME="$(pwd)/.cargo"
export CARGO_OFFLINE=true
export RUSTFLAGS="%{rpmrustflags}"
export CARGO_TERM_VERBOSE=true
%ifarch x32
export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
export PKG_CONFIG_ALLOW_CROSS=1
export PYO3_CROSS_LIB_DIR=%{py3_libdir}
%endif
export CFLAGS="%{rpmcflags}"
%py3_build_pyproject
%if %{with tests} || %{with doc}
%{__unzip} -qo build-3/*.whl -d build-3/test-path
%endif
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS="pytest_benchmark.plugin" \
PYTHONPATH=$(pwd)/build-3/test-path \
%{__python3} -m pytest tests
%endif
%if %{with doc}
PYTHONPATH=$(pwd)/build-3/test-path \
%{__make} -C docs html \
SPHINXBUILD=sphinx-build-3
%endif
%install
rm -rf $RPM_BUILD_ROOT
export CARGO_HOME="$(pwd)/.cargo"
export CARGO_OFFLINE=true
export RUSTFLAGS="%{rpmrustflags}"
export CARGO_TERM_VERBOSE=true
%ifarch x32
export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
export PKG_CONFIG_ALLOW_CROSS=1
export PYO3_CROSS_LIB_DIR=%{py3_libdir}
%endif
%py3_install_pyproject
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc CHANGELOG.rst CONTRIBUTING.rst LICENSE LICENSE.APACHE LICENSE.BSD README.rst
%dir %{py3_sitedir}/cryptography
%{py3_sitedir}/cryptography/*.py
%{py3_sitedir}/cryptography/py.typed
%{py3_sitedir}/cryptography/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat
%{py3_sitedir}/cryptography/hazmat/*.py
%{py3_sitedir}/cryptography/hazmat/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/asn1
%{py3_sitedir}/cryptography/hazmat/asn1/*.py
%{py3_sitedir}/cryptography/hazmat/asn1/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/backends
%{py3_sitedir}/cryptography/hazmat/backends/*.py
%{py3_sitedir}/cryptography/hazmat/backends/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/backends/openssl
%{py3_sitedir}/cryptography/hazmat/backends/openssl/*.py
%{py3_sitedir}/cryptography/hazmat/backends/openssl/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/bindings
%{py3_sitedir}/cryptography/hazmat/bindings/*.py
%{py3_sitedir}/cryptography/hazmat/bindings/__pycache__
%attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so
%dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust
%{py3_sitedir}/cryptography/hazmat/bindings/_rust/*.pyi
%dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust/openssl
%{py3_sitedir}/cryptography/hazmat/bindings/_rust/openssl/*.pyi
%dir %{py3_sitedir}/cryptography/hazmat/bindings/openssl
%{py3_sitedir}/cryptography/hazmat/bindings/openssl/*.py
%{py3_sitedir}/cryptography/hazmat/bindings/openssl/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/decrepit
%{py3_sitedir}/cryptography/hazmat/decrepit/*.py
%{py3_sitedir}/cryptography/hazmat/decrepit/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/decrepit/ciphers
%{py3_sitedir}/cryptography/hazmat/decrepit/ciphers/*.py
%{py3_sitedir}/cryptography/hazmat/decrepit/ciphers/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives
%{py3_sitedir}/cryptography/hazmat/primitives/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric
%{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives/ciphers
%{py3_sitedir}/cryptography/hazmat/primitives/ciphers/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/ciphers/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives/kdf
%{py3_sitedir}/cryptography/hazmat/primitives/kdf/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/kdf/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization
%{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__
%dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor
%{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py
%{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__
%dir %{py3_sitedir}/cryptography/x509
%{py3_sitedir}/cryptography/x509/*.py
%{py3_sitedir}/cryptography/x509/__pycache__
%{py3_sitedir}/cryptography-%{version}.dist-info
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
%doc docs/_build/html/{_downloads,_static,development,hazmat,x509,*.html,*.js}
%endif