]>
Commit | Line | Data |
---|---|---|
bd9b21f1 AM |
1 | # Conditional build: |
2 | %bcond_with doc # API documentation | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module pycryptodomex | |
8 | Summary: Package of low-level cryptographic primitives | |
bd9b21f1 AM |
9 | Name: python-%{module} |
10 | Version: 3.10.1 | |
70c37ddd | 11 | Release: 4 |
bd9b21f1 AM |
12 | License: BSD |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 91b86ca7fa80d41179d7735067c7347a | |
16 | URL: https://www.pycryptodome.org/ | |
17 | %if %{with python2} | |
18 | BuildRequires: python-devel >= 1:2.5 | |
19 | %if %{with tests} | |
20 | #BuildRequires: python- | |
21 | %endif | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-devel >= 1:3.2 | |
25 | %if %{with tests} | |
26 | #BuildRequires: python3- | |
27 | %endif | |
28 | %endif | |
29 | BuildRequires: rpm-pythonprov | |
30 | BuildRequires: rpmbuild(macros) >= 1.714 | |
31 | %if %{with doc} | |
32 | BuildRequires: sphinx-pdg-3 | |
33 | %endif | |
34 | Requires: python-modules >= 1:2.5 | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
8fccd2e4 AM |
38 | PyCryptodomex is a fork of PyCrypto. It brings the following |
39 | enhancements with respect to the last official version of PyCrypto | |
40 | (2.6.1): | |
bd9b21f1 | 41 | |
8fccd2e4 AM |
42 | - Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB) |
43 | - Accelerated AES on Intel platforms via AES-NI | |
44 | - First class support for PyPy | |
45 | - Elliptic curves cryptography (NIST P-256, P-384 and P-521 curves | |
46 | only) | |
47 | - Better and more compact API (nonce and iv attributes for ciphers, | |
48 | automatic generation of random nonces and IVs, simplified CTR cipher | |
49 | mode, and more) | |
50 | - SHA-3 (including SHAKE XOFs), truncated SHA-512 and BLAKE2 hash | |
51 | algorithms | |
52 | - Salsa20 and ChaCha20/XChaCha20 stream ciphers | |
53 | - Poly1305 MAC | |
54 | - ChaCha20-Poly1305 and XChaCha20-Poly1305 authenticated ciphers | |
55 | - scrypt, bcrypt and HKDF derivation functions | |
56 | - Deterministic (EC)DSA | |
57 | - Password-protected PKCS#8 key containers | |
58 | - Shamir's Secret Sharing scheme | |
59 | - Random numbers get sourced directly from the OS (and not from a | |
60 | CSPRNG in userspace) | |
61 | - Simplified install process, including better support for Windows | |
62 | - Cleaner RSA and DSA key generation (largely based on FIPS 186-4) | |
63 | - Major clean ups and simplification of the code base | |
bd9b21f1 AM |
64 | |
65 | %package -n python3-%{module} | |
8fccd2e4 | 66 | Summary: Package of low-level cryptographic primitives |
bd9b21f1 AM |
67 | Group: Libraries/Python |
68 | Requires: python3-modules >= 1:3.2 | |
69 | ||
70 | %description -n python3-%{module} | |
8fccd2e4 AM |
71 | PyCryptodomex is a fork of PyCrypto. It brings the following |
72 | enhancements with respect to the last official version of PyCrypto | |
73 | (2.6.1): | |
bd9b21f1 | 74 | |
8fccd2e4 AM |
75 | - Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB) |
76 | - Accelerated AES on Intel platforms via AES-NI | |
77 | - First class support for PyPy | |
78 | - Elliptic curves cryptography (NIST P-256, P-384 and P-521 curves | |
79 | only) | |
80 | - Better and more compact API (nonce and iv attributes for ciphers, | |
81 | automatic generation of random nonces and IVs, simplified CTR cipher | |
82 | mode, and more) | |
83 | - SHA-3 (including SHAKE XOFs), truncated SHA-512 and BLAKE2 hash | |
84 | algorithms | |
85 | - Salsa20 and ChaCha20/XChaCha20 stream ciphers | |
86 | - Poly1305 MAC | |
87 | - ChaCha20-Poly1305 and XChaCha20-Poly1305 authenticated ciphers | |
88 | - scrypt, bcrypt and HKDF derivation functions | |
89 | - Deterministic (EC)DSA | |
90 | - Password-protected PKCS#8 key containers | |
91 | - Shamir's Secret Sharing scheme | |
92 | - Random numbers get sourced directly from the OS (and not from a | |
93 | CSPRNG in userspace) | |
94 | - Simplified install process, including better support for Windows | |
95 | - Cleaner RSA and DSA key generation (largely based on FIPS 186-4) | |
96 | - Major clean ups and simplification of the code base | |
bd9b21f1 AM |
97 | |
98 | %package apidocs | |
99 | Summary: API documentation for Python %{module} module | |
100 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
101 | Group: Documentation | |
102 | BuildArch: noarch | |
103 | ||
104 | %description apidocs | |
105 | API documentation for Python %{module} module. | |
106 | ||
107 | %description apidocs -l pl.UTF-8 | |
108 | Dokumentacja API modułu Pythona %{module}. | |
109 | ||
110 | %prep | |
111 | %setup -q -n %{module}-%{version} | |
112 | ||
bd9b21f1 AM |
113 | %build |
114 | %if %{with python2} | |
115 | %py_build %{?with_tests:test} | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %py3_build %{?with_tests:test} | |
120 | %endif | |
121 | ||
122 | %if %{with doc} | |
123 | %{__make} -C Doc html \ | |
124 | PHINXBUILD=sphinx-build-3 | |
125 | rm -rf Doc/_build/html/_sources | |
126 | %endif | |
127 | ||
128 | %install | |
129 | rm -rf $RPM_BUILD_ROOT | |
130 | ||
131 | %if %{with python2} | |
132 | %py_install | |
133 | ||
134 | %py_postclean | |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
138 | %py3_install | |
139 | %endif | |
140 | ||
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
144 | %if %{with python2} | |
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %doc {AUTHORS,Changelog,FuturePlans,README}.rst | |
148 | %dir %{py_sitedir}/Cryptodome | |
149 | %{py_sitedir}/Cryptodome/*.py[coi] | |
150 | %{py_sitedir}/Cryptodome/py.typed | |
151 | %dir %{py_sitedir}/Cryptodome/Cipher | |
152 | %{py_sitedir}/Cryptodome/Cipher/*.py[coi] | |
153 | %attr(755,root,root) %{py_sitedir}/Cryptodome/Cipher/*.so | |
154 | %dir %{py_sitedir}/Cryptodome/Hash | |
155 | %{py_sitedir}/Cryptodome/Hash/*.py[coi] | |
156 | %attr(755,root,root) %{py_sitedir}/Cryptodome/Hash/*.so | |
157 | %{py_sitedir}/Cryptodome/IO | |
158 | %dir %{py_sitedir}/Cryptodome/PublicKey | |
159 | %{py_sitedir}/Cryptodome/PublicKey/*.py[coi] | |
160 | %attr(755,root,root) %{py_sitedir}/Cryptodome/PublicKey/*.so | |
161 | %dir %{py_sitedir}/Cryptodome/Protocol | |
162 | %{py_sitedir}/Cryptodome/Protocol/*.py[coi] | |
163 | %attr(755,root,root) %{py_sitedir}/Cryptodome/Protocol/*.so | |
164 | %{py_sitedir}/Cryptodome/Random | |
165 | %{py_sitedir}/Cryptodome/SelfTest | |
166 | %{py_sitedir}/Cryptodome/Signature | |
167 | %dir %{py_sitedir}/Cryptodome/Util | |
168 | %{py_sitedir}/Cryptodome/Util/*.py[coi] | |
169 | %attr(755,root,root) %{py_sitedir}/Cryptodome/Util/*.so | |
170 | %dir %{py_sitedir}/Cryptodome/Math | |
171 | %{py_sitedir}/Cryptodome/Math/*.py[coi] | |
172 | %attr(755,root,root) %{py_sitedir}/Cryptodome/Math/*.so | |
173 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
174 | %endif | |
175 | ||
176 | %if %{with python3} | |
177 | %files -n python3-%{module} | |
178 | %defattr(644,root,root,755) | |
179 | %doc {AUTHORS,Changelog,FuturePlans,README}.rst | |
180 | %dir %{py3_sitedir}/Cryptodome | |
181 | %{py3_sitedir}/Cryptodome/*.py* | |
182 | %{py3_sitedir}/Cryptodome/py.typed | |
183 | %{py3_sitedir}/Cryptodome/__pycache__ | |
184 | %dir %{py3_sitedir}/Cryptodome/Cipher | |
185 | %{py3_sitedir}/Cryptodome/Cipher/*.py* | |
186 | %{py3_sitedir}/Cryptodome/Cipher/__pycache__ | |
187 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/Cipher/*.so | |
188 | %dir %{py3_sitedir}/Cryptodome/Hash | |
189 | %{py3_sitedir}/Cryptodome/Hash/*.py* | |
190 | %{py3_sitedir}/Cryptodome/Hash/__pycache__ | |
191 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/Hash/*.so | |
192 | %{py3_sitedir}/Cryptodome/IO | |
193 | %dir %{py3_sitedir}/Cryptodome/PublicKey | |
194 | %{py3_sitedir}/Cryptodome/PublicKey/*.py* | |
195 | %{py3_sitedir}/Cryptodome/PublicKey/__pycache__ | |
196 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/PublicKey/*.so | |
197 | %dir %{py3_sitedir}/Cryptodome/Protocol | |
198 | %{py3_sitedir}/Cryptodome/Protocol/*.py* | |
199 | %{py3_sitedir}/Cryptodome/Protocol/__pycache__ | |
200 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/Protocol/*.so | |
201 | %{py3_sitedir}/Cryptodome/Random | |
202 | %{py3_sitedir}/Cryptodome/SelfTest | |
203 | %{py3_sitedir}/Cryptodome/Signature | |
204 | %dir %{py3_sitedir}/Cryptodome/Util | |
205 | %{py3_sitedir}/Cryptodome/Util/*.py* | |
206 | %{py3_sitedir}/Cryptodome/Util/__pycache__ | |
207 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/Util/*.so | |
208 | %dir %{py3_sitedir}/Cryptodome/Math | |
209 | %{py3_sitedir}/Cryptodome/Math/*.py* | |
210 | %{py3_sitedir}/Cryptodome/Math/__pycache__ | |
211 | %attr(755,root,root) %{py3_sitedir}/Cryptodome/Math/*.so | |
212 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
213 | %endif | |
214 | ||
215 | %if %{with doc} | |
216 | %files apidocs | |
217 | %defattr(644,root,root,755) | |
218 | %doc docs/_build/html/* | |
219 | %endif |