python-pycryptodomex/python-pycryptodomex.spec

109 lines
3.7 KiB
RPMSpec
Raw Normal View History

2023-09-18 12:11:57 +03:00
%global pypi_name pycryptodomex
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
Summary: A self-contained cryptographic library for Python
Name: python-%{pypi_name}
Version: 3.19.0
Release: 1
2020-04-06 10:54:20 +00:00
# PyCrypto-based code is public domain, further PyCryptodome contributions are
# BSD
2023-09-18 12:11:57 +03:00
License: BSD and Public Domain
Group: Development/Python
Url: http://www.pycryptodome.org/
Source0: %pypi_source
2020-04-06 10:54:20 +00:00
# Use external libtomcrypt library
2023-09-18 12:11:57 +03:00
Patch0: %{name}-3.15.0-use_external_libtomcrypt.patch
2020-04-06 10:54:20 +00:00
# Fix documentation build with Sphinx <= 1.2, especially on EL
2023-09-18 12:11:57 +03:00
Patch1: %{name}-3.7.0-sphinx.patch
BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(pycrypto)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(setuptools)
BuildRequires: pkgconfig(libtomcrypt)
BuildRequires: pkgconfig(libtommath)
BuildRequires: pkgconfig(python3)
2020-04-06 10:54:20 +00:00
%description
2023-09-18 12:11:57 +03:00
PyCryptodome is a self-contained Python package of low-level cryptographic
primitives. It's a fork of PyCrypto. It brings several enhancements with respect
to the last official version of PyCrypto (2.6.1).
2020-04-06 10:54:20 +00:00
2022-08-05 16:31:07 +09:00
#------------------------------------------------
2023-09-18 12:11:57 +03:00
%package -n python3-%{pypi_name}
Summary: %{summary}
Group: Development/Python
Requires: gmp%{?_isa}
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%description -n python3-%{pypi_name}
PyCryptodome is a self-contained Python package of low-level cryptographic
primitives. It's a fork of PyCrypto. It brings several enhancements with respect
to the last official version of PyCrypto (2.6.1), for instance:
\
* Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
* Accelerated AES on Intel platforms via AES-NI
* Elliptic curves cryptography (NIST P-256 curve only)
* Better and more compact API (nonce and iv attributes for ciphers, automatic
generation of random nonces and IVs, simplified CTR cipher mode, and more)
* SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
* Salsa20 and ChaCha20 stream ciphers
* scrypt and HKDF
* Deterministic (EC)DSA
* Password-protected PKCS#8 key containers
* Shamir's Secret Sharing scheme
* Random numbers get sourced directly from the OS (and not from a CSPRNG in
userspace)
* Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
* Major clean ups and simplification of the code base
PyCryptodome is not a wrapper to a separate C library like OpenSSL. To the
largest possible extent, algorithms are implemented in pure Python. Only the
pieces that are extremely critical to performance (e.g. block ciphers) are
implemented as C extensions.
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
Note: all modules are installed under the Cryptodome package to avoid conflicts\
with the PyCrypto library.
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%files -n python3-%{pypi_name}
2022-08-05 16:31:07 +09:00
%doc AUTHORS.rst Changelog.rst README.rst
%license LICENSE.rst
2023-09-18 12:11:57 +03:00
%{python3_sitearch}/Cryptodome
%exclude %{python3_sitearch}/Cryptodome/SelfTest
%{python3_sitearch}/%{pypi_name}-%{version}.dist-info
2022-08-05 16:31:07 +09:00
#------------------------------------------------
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%package -n python3-%{pypi_name}-selftest
Summary: PyCryptodome test suite module
Group: Development/Python
Requires: python3-%{pypi_name}%{?_isa}
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%description -n python3-%{pypi_name}-selftest
2020-04-06 10:54:20 +00:00
This package provides the PyCryptodome test suite module (Cryptodome.SelfTest).
2023-09-18 12:11:57 +03:00
%files -n python3-%{pypi_name}-selftest
%{python3_sitearch}/Cryptodome/SelfTest
2022-08-05 16:31:07 +09:00
#------------------------------------------------
2020-04-06 10:54:20 +00:00
%prep
2023-09-18 12:11:57 +03:00
%autosetup -p1 -n %{pypi_name}-%{version}
2020-04-06 10:54:20 +00:00
# Drop bundled libraries
rm -r src/libtom/
# Remove shebang
2023-09-18 12:11:57 +03:00
sed '1{\@^#! /usr/bin/env python@d}' lib/Cryptodome/SelfTest/__main__.py >lib/Cryptodome/SelfTest/__main__.py.new && \
touch -r lib/Cryptodome/SelfTest/__main__.py lib/Cryptodome/SelfTest/__main__.py.new && \
mv lib/Cryptodome/SelfTest/__main__.py.new lib/Cryptodome/SelfTest/__main__.py
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%generate_buildrequires
%pyproject_buildrequires -r
2020-04-06 10:54:20 +00:00
%build
touch .separate_namespace
2023-09-18 12:11:57 +03:00
%pyproject_wheel
2020-04-06 10:54:20 +00:00
%install
2023-09-18 12:11:57 +03:00
%pyproject_install