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