]>
Commit | Line | Data |
---|---|---|
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 |
8 | Summary: Crypthography library for Python 3 |
9 | Summary(pl.UTF-8): Biblioteka Cryptography dla Pythona 3 | |
10 | Name: python3-cryptography | |
11 | Version: 35.0.0 | |
12 | Release: 0.1 | |
d6e7edf5 | 13 | License: Apache v2.0 or BSD |
06232684 | 14 | Group: Libraries/Python |
29d4b67b | 15 | #Source0Download: https://pypi.org/simple/cryptography/ |
7df50b22 | 16 | Source0: 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/ |
19 | Source1: 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 | |
24 | Source2: %{name}-crates-%{crates_ver}.tar.xz | |
25 | # Source2-md5: c3398eb08b99552f09b8b8f16d0d3910 | |
06232684 | 26 | URL: https://cryptography.io/ |
0f792d56 | 27 | BuildRequires: openssl-devel >= 1.1.0 |
0f792d56 JB |
28 | BuildRequires: python3-cffi >= 1.12 |
29 | BuildRequires: python3-devel >= 1:3.6 | |
29d4b67b | 30 | BuildRequires: python3-setuptools >= 18.5 |
c1d4b28c | 31 | BuildRequires: python3-setuptools_rust |
06232684 | 32 | BuildRequires: python3-six >= 1.4.1 |
7791f4ce JP |
33 | BuildRequires: rpm-pythonprov >= 5.4.15-48 |
34 | BuildRequires: rpmbuild(macros) >= 2.004 | |
35 | BuildRequires: rust >= 1.41.0 | |
049a803f | 36 | %if %{with tests} |
049a803f | 37 | BuildRequires: python3-hypothesis >= 1.11.4 |
049a803f JB |
38 | BuildRequires: python3-iso8601 |
39 | BuildRequires: python3-pretend | |
29d4b67b | 40 | BuildRequires: python3-pytest >= 3.6.0 |
f63b1331 JB |
41 | BuildRequires: python3-pytz |
42 | %endif | |
f63b1331 JB |
43 | %if %{with doc} |
44 | BuildRequires: python3-sphinx_rtd_theme | |
45 | BuildRequires: sphinx-pdg-3 >= 1.6.5 | |
7791f4ce JP |
46 | BuildRequires: tar >= 1:1.22 |
47 | BuildRequires: xz | |
06232684 | 48 | %endif |
0f792d56 | 49 | Requires: openssl >= 1.1.0 |
7791f4ce | 50 | ExclusiveArch: %{rust_arches} |
06232684 JB |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
53 | %description | |
59f13c5c | 54 | cryptography is a package which provides cryptographic recipes and |
06232684 | 55 | primitives to Python developers. Our goal is for it to be your |
59f13c5c JR |
56 | "cryptographic standard library". It supports Python 3.6+ and |
57 | PyPy3 7.2+. | |
06232684 | 58 | |
59f13c5c JR |
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. | |
06232684 JB |
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 | |
59f13c5c | 67 | Pythona 3.6+ oraz PyPy 7.2+. |
06232684 JB |
68 | |
69 | cryptography zawiera zarówno funkcje wysokopoziomowe, jak i | |
70 | niskopoziomowe interfejsy do popularnych algorytmów kryptograficznych, | |
226a2f8d | 71 | takich jak szyfry symetryczne, skróty wiadomości czy funkcje |
06232684 JB |
72 | wyprowadzające klucze. |
73 | ||
f63b1331 JB |
74 | %package apidocs |
75 | Summary: API documentation for cryptography module | |
76 | Summary(pl.UTF-8): Dokumentacja API modułu cryptography | |
77 | Group: Documentation | |
094f23d7 | 78 | BuildArch: noarch |
f63b1331 JB |
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 | ||
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 |
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 | ||
06232684 | 108 | %build |
7791f4ce JP |
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 | ||
06232684 JB |
117 | export CFLAGS="%{rpmcflags}" |
118 | ||
503cd915 JB |
119 | %py3_build |
120 | ||
121 | %if %{with tests} | |
122 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
123 | %{__python3} -m pytest tests | |
124 | %endif | |
06232684 | 125 | |
f63b1331 JB |
126 | %if %{with doc} |
127 | %{__make} -C docs html \ | |
128 | SPHINXBUILD=sphinx-build-3 | |
129 | %endif | |
130 | ||
06232684 JB |
131 | %install |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
7791f4ce JP |
134 | export CARGO_HOME="$(pwd)/src/rust/.cargo" |
135 | export CARGO_OFFLINE=true | |
136 | export RUSTFLAGS="%{rpmrustflags}" | |
137 | export CARGO_TERM_VERBOSE=true | |
138 | %ifarch x32 | |
139 | export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32 | |
140 | %endif | |
141 | ||
6d1f8f74 | 142 | %py3_install |
06232684 JB |
143 | |
144 | %clean | |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
06232684 JB |
147 | %files |
148 | %defattr(644,root,root,755) | |
7a9c1d53 | 149 | %doc CHANGELOG.rst CONTRIBUTING.rst LICENSE LICENSE.APACHE LICENSE.BSD README.rst |
06232684 | 150 | %dir %{py3_sitedir}/cryptography |
06232684 | 151 | %{py3_sitedir}/cryptography/*.py |
7a9c1d53 | 152 | %{py3_sitedir}/cryptography/py.typed |
06232684 JB |
153 | %{py3_sitedir}/cryptography/__pycache__ |
154 | %dir %{py3_sitedir}/cryptography/hazmat | |
155 | %{py3_sitedir}/cryptography/hazmat/*.py | |
156 | %{py3_sitedir}/cryptography/hazmat/__pycache__ | |
157 | %dir %{py3_sitedir}/cryptography/hazmat/backends | |
158 | %{py3_sitedir}/cryptography/hazmat/backends/*.py | |
159 | %{py3_sitedir}/cryptography/hazmat/backends/__pycache__ | |
06232684 JB |
160 | %dir %{py3_sitedir}/cryptography/hazmat/backends/openssl |
161 | %{py3_sitedir}/cryptography/hazmat/backends/openssl/*.py | |
162 | %{py3_sitedir}/cryptography/hazmat/backends/openssl/__pycache__ | |
163 | %dir %{py3_sitedir}/cryptography/hazmat/bindings | |
164 | %{py3_sitedir}/cryptography/hazmat/bindings/*.py | |
165 | %{py3_sitedir}/cryptography/hazmat/bindings/__pycache__ | |
d198b5a4 | 166 | %attr(755,root,root) %{py3_sitedir}/cryptography/hazmat/bindings/_*.so |
7a9c1d53 JP |
167 | %dir %{py3_sitedir}/cryptography/hazmat/bindings/_rust |
168 | %{py3_sitedir}/cryptography/hazmat/bindings/_rust/*.pyi | |
06232684 JB |
169 | %dir %{py3_sitedir}/cryptography/hazmat/bindings/openssl |
170 | %{py3_sitedir}/cryptography/hazmat/bindings/openssl/*.py | |
171 | %{py3_sitedir}/cryptography/hazmat/bindings/openssl/__pycache__ | |
172 | %dir %{py3_sitedir}/cryptography/hazmat/primitives | |
173 | %{py3_sitedir}/cryptography/hazmat/primitives/*.py | |
174 | %{py3_sitedir}/cryptography/hazmat/primitives/__pycache__ | |
175 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric | |
176 | %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/*.py | |
177 | %{py3_sitedir}/cryptography/hazmat/primitives/asymmetric/__pycache__ | |
178 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/ciphers | |
179 | %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/*.py | |
180 | %{py3_sitedir}/cryptography/hazmat/primitives/ciphers/__pycache__ | |
181 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/kdf | |
182 | %{py3_sitedir}/cryptography/hazmat/primitives/kdf/*.py | |
183 | %{py3_sitedir}/cryptography/hazmat/primitives/kdf/__pycache__ | |
f63b1331 JB |
184 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/serialization |
185 | %{py3_sitedir}/cryptography/hazmat/primitives/serialization/*.py | |
186 | %{py3_sitedir}/cryptography/hazmat/primitives/serialization/__pycache__ | |
f7d88309 AM |
187 | %dir %{py3_sitedir}/cryptography/hazmat/primitives/twofactor |
188 | %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/*.py | |
189 | %{py3_sitedir}/cryptography/hazmat/primitives/twofactor/__pycache__ | |
d198b5a4 AM |
190 | %dir %{py3_sitedir}/cryptography/x509 |
191 | %{py3_sitedir}/cryptography/x509/*.py | |
192 | %{py3_sitedir}/cryptography/x509/__pycache__ | |
06232684 | 193 | %{py3_sitedir}/cryptography-%{version}-py*.egg-info |
f63b1331 JB |
194 | |
195 | %if %{with doc} | |
196 | %files apidocs | |
197 | %defattr(644,root,root,755) | |
503cd915 | 198 | %doc docs/_build/html/{_downloads,_static,development,hazmat,x509,*.html,*.js} |
f63b1331 | 199 | %endif |