python-pycryptodomex/python-pycryptodomex.spec

226 lines
6.9 KiB
RPMSpec
Raw Normal View History

2024-01-29 20:55:01 +00: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
2024-01-29 20:55:01 +00:00
Name: python-%{pypi_name}
2024-01-28 16:53:31 +00:00
Version: 3.20.0
2024-01-29 20:55:01 +00:00
Release: 3
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
2024-01-28 16:53:31 +00:00
URL: https://www.pycryptodome.org
Source0: https://github.com/Legrandin/pycryptodome/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
2020-04-06 10:54:20 +00:00
# Use external libtomcrypt library
2024-01-28 16:53:31 +00: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
2024-01-28 16:53:31 +00:00
#Patch1: %{name}-3.7.0-sphinx.patch
#BuildRequires: pyproject-rpm-macros
BuildRequires: python3egg(pytest)
BuildRequires: python3egg(setuptools)
2023-09-18 12:11:57 +03:00
BuildRequires: pkgconfig(libtomcrypt)
BuildRequires: pkgconfig(libtommath)
BuildRequires: pkgconfig(python3)
2024-01-28 16:53:31 +00:00
BuildRequires: pkgconfig(python)
BuildRequires: pythonegg(setuptools)
BuildRequires: pythonegg(pytest)
BuildRequires: python38-devel
BuildRequires: python38-setuptools
#BuildRequires: python38-pytest
2024-01-28 19:26:39 +00:00
Requires: %{_lib}gmp10
2024-01-28 21:24:13 +00:00
Provides: python-%{pypi_name}x = %{EVRD}
2020-04-06 10:54:20 +00:00
%description
2024-01-28 16:53:31 +00: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
2024-01-28 19:26:39 +00:00
Requires: %{_lib}gmp10
2024-01-29 20:55:01 +00:00
Provides: python3-%{pypi_name} = %{EVRD}
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%description -n python3-%{pypi_name}
2024-01-28 16:53:31 +00: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), for instance:
2024-01-28 21:24:13 +00:00
2023-09-18 12:11:57 +03:00
* Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
* Accelerated AES on Intel platforms via AES-NI
* Elliptic curves cryptography (NIST P-256 curve only)
2024-01-28 16:53:31 +00:00
* Better and more compact API (nonce and iv attributes for
ciphers, automatic generation of random nonces and IVs,
simplified CTR cipher mode, and more)
2023-09-18 12:11:57 +03:00
* 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
2024-01-28 16:53:31 +00:00
* 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)
2023-09-18 12:11:57 +03:00
* Major clean ups and simplification of the code base
2024-01-28 16:53:31 +00:00
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
2023-09-18 12:11:57 +03:00
implemented as C extensions.
2020-04-06 10:54:20 +00:00
2024-01-28 16:53:31 +00: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}
2024-01-28 16:53:31 +00:00
%doc README.rst LICENSE.rst
%exclude %{python3_sitearch}/Crypto/SelfTest
%{python3_sitearch}/Crypto
%{python3_sitearch}/pycryptodome-%{version}-py%{py3_ver}.egg-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
2024-01-28 19:56:54 +00:00
Requires: python3-%{pypi_name} == %{EVRD}
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%description -n python3-%{pypi_name}-selftest
2024-01-28 16:53:31 +00:00
This package provides the PyCryptodome test suite module
(Cryptodome.SelfTest).
2020-04-06 10:54:20 +00:00
2023-09-18 12:11:57 +03:00
%files -n python3-%{pypi_name}-selftest
2024-01-28 16:53:31 +00:00
%{python3_sitearch}/Crypto/SelfTest
#------------------------------------------------
%package -n python38-%{pypi_name}
Summary: %{summary}
Group: Development/Python
2024-01-28 19:26:39 +00:00
Requires: %{_lib}gmp10
2024-01-29 20:55:01 +00:00
Provides: python38-%{pypi_name} = %{EVRD}
2024-01-28 16:53:31 +00:00
%description -n python38-%{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.
Note: all modules are installed under the Cryptodome package
to avoid conflicts with the PyCrypto library.
%files -n python38-%{pypi_name}
%doc README.rst LICENSE.rst
%exclude %{python38_sitearch}/Crypto/SelfTest
%{python38_sitearch}/Crypto
%{python38_sitearch}/pycryptodome-%{version}-py%{py38_ver}.egg-info
#------------------------------------------------
%package -n python38-%{pypi_name}-selftest
Summary: PyCryptodome test suite module
Group: Development/Python
2024-01-28 19:56:54 +00:00
Requires: python38-%{pypi_name} == %{EVRD}
2024-01-28 16:53:31 +00:00
%description -n python38-%{pypi_name}-selftest
This package provides the PyCryptodome test suite module
(Cryptodome.SelfTest).
%files -n python38-%{pypi_name}-selftest
%{python38_sitearch}/Crypto/SelfTest
#------------------------------------------------
%package -n python-%{pypi_name}-selftest
Summary: PyCryptodome test suite module
Group: Development/Python
2024-01-29 20:55:01 +00:00
Requires: python-%{pypi_name} == %{EVRD}
2024-01-28 16:53:31 +00:00
%description -n python-%{pypi_name}-selftest
This package provides the PyCryptodome test suite module
(Cryptodome.SelfTest).
%files -n python-%{pypi_name}-selftest
%{python_sitearch}/Cryptodome/SelfTest
2022-08-05 16:31:07 +09:00
#------------------------------------------------
2020-04-06 10:54:20 +00:00
%prep
2024-01-29 20:55:01 +00:00
%setup -qn pycryptodome-%{version}
2024-01-28 16:53:31 +00:00
cp -a . %{py3dir}
cp -a . %{py38dir}
2020-04-06 10:54:20 +00:00
# Drop bundled libraries
2024-01-28 16:53:31 +00:00
#rm -r src/libtom/
2020-04-06 10:54:20 +00:00
# Remove shebang
2024-01-28 16:53:31 +00: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
2024-01-28 16:53:31 +00:00
#generate_buildrequires
#pyproject_buildrequires -r
2020-04-06 10:54:20 +00:00
%build
touch .separate_namespace
2024-01-28 16:53:31 +00:00
%py_build
pushd %{py3dir}
%py3_build
popd
pushd %{py38dir}
%py38_build
popd
2020-04-06 10:54:20 +00:00
%install
2024-01-28 16:53:31 +00:00
%py_install
pushd %{py3dir}
%py3_install
popd
pushd %{py38dir}
%py38_install
popd
%files
%doc README.rst LICENSE.rst
%exclude %{python_sitearch}/Cryptodome/SelfTest
%{python_sitearch}/Cryptodome
%{python_sitearch}/pycryptodomex-%{version}-py%{py_ver}.egg-info