mirror of
https://abf.rosa.ru/djam/python-pycryptodomex.git
synced 2025-02-24 09:32:45 +00:00
Adjust for RPM4 (it doesn't allow even empty package with the same name as subpackage)
This commit is contained in:
parent
0c97f4e838
commit
cae5c70570
1 changed files with 84 additions and 140 deletions
|
@ -1,113 +1,97 @@
|
|||
%global srcname pycryptodomex
|
||||
%global common_description 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.
|
||||
|
||||
%global _with_python2 1
|
||||
%global _with_tests 1
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 3.9.7
|
||||
Release: 2
|
||||
Summary: A self-contained cryptographic library for Python
|
||||
Group: Development/Python
|
||||
%global module pycryptodomex
|
||||
|
||||
Summary: A self-contained cryptographic library for Python
|
||||
Name: python-%{module}
|
||||
Version: 3.9.7
|
||||
Release: 2
|
||||
Group: Development/Python
|
||||
# PyCrypto-based code is public domain, further PyCryptodome contributions are
|
||||
# BSD
|
||||
License: BSD and Public Domain
|
||||
URL: http://www.pycryptodome.org/
|
||||
Source0: https://github.com/Legrandin/pycryptodome/archive/v%{version}/%{srcname}-%{version}.tar.gz
|
||||
License: BSD and Public Domain
|
||||
Url: http://www.pycryptodome.org/
|
||||
Source0: https://github.com/Legrandin/pycryptodome/archive/v%{version}/%{module}-%{version}.tar.gz
|
||||
# Use external libtomcrypt library
|
||||
Patch0: %{name}-3.7.3-use_external_libtomcrypt.patch
|
||||
Patch0: %{name}-3.7.3-use_external_libtomcrypt.patch
|
||||
# Fix documentation build with Sphinx <= 1.2, especially on EL
|
||||
Patch1: %{name}-3.7.0-sphinx.patch
|
||||
|
||||
BuildRequires: pkgconfig(libtomcrypt)
|
||||
BuildRequires: pkgconfig(libtommath)
|
||||
%if 0%{?_with_python2}
|
||||
BuildRequires: %python2-devel
|
||||
BuildRequires: %python2-setuptools
|
||||
%endif
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
Patch1: %{name}-3.7.0-sphinx.patch
|
||||
BuildRequires: pkgconfig(libtomcrypt)
|
||||
BuildRequires: pkgconfig(libtommath)
|
||||
BuildRequires: pkgconfig(python)
|
||||
BuildRequires: pkgconfig(python3)
|
||||
BuildRequires: pythonegg(setuptools)
|
||||
BuildRequires: python3egg(setuptools)
|
||||
# Needed for documentation
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: python3-sphinx
|
||||
|
||||
%description
|
||||
%{common_description}
|
||||
PyCryptodome is a self-contained Python package of low-level cryptographic\
|
||||
primitives. It's a fork of PyCrypto.
|
||||
|
||||
Note: all modules are installed under the Cryptodome package to avoid conflicts
|
||||
with the PyCrypto library.
|
||||
|
||||
%if 0%{?_with_python2}
|
||||
%package -n %python2-%{srcname}
|
||||
Summary: %{summary}
|
||||
Group: Development/Python
|
||||
# GMP library is dl-opened
|
||||
Requires: gmp%{?_isa}
|
||||
%{?python_provide:%python_provide %python2-%{srcname}}
|
||||
%files
|
||||
%doc AUTHORS.rst Changelog.rst README.rst
|
||||
%license LICENSE.rst
|
||||
%{python2_sitearch}/Cryptodome/
|
||||
%exclude %{python2_sitearch}/Cryptodome/SelfTest/
|
||||
%{python2_sitearch}/%{module}-*.egg-info/
|
||||
%{_mandir}/man1/pycryptodome.1.*
|
||||
|
||||
%description -n %python2-%{srcname}
|
||||
%{common_description}
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%package selftest
|
||||
Summary: PyCryptodome test suite module
|
||||
Group: Development/Python
|
||||
Requires: python-%{module}
|
||||
|
||||
%package -n %python2-%{srcname}-selftest
|
||||
Summary: PyCryptodome test suite module
|
||||
Group: Development/Python
|
||||
Requires: %python2-%{srcname}%{?_isa}
|
||||
%{?python_provide:%python_provide %python2-%{srcname}}
|
||||
|
||||
%description -n %python2-%{srcname}-selftest
|
||||
%{common_description}
|
||||
|
||||
This package provides the PyCryptodome test suite module (Cryptodome.SelfTest).
|
||||
%endif
|
||||
|
||||
|
||||
%package -n python3-%{srcname}
|
||||
Summary: %{summary}
|
||||
Group: Development/Python
|
||||
# GMP library is dl-opened
|
||||
Requires: gmp%{?_isa}
|
||||
%{?python_provide:%python_provide python3-%{srcname}}
|
||||
|
||||
%description -n python3-%{srcname}
|
||||
%{common_description}
|
||||
|
||||
|
||||
%package -n python3-%{srcname}-selftest
|
||||
Summary: PyCryptodome test suite module
|
||||
Group: Development/Python
|
||||
Requires: python3-%{srcname}%{?_isa}
|
||||
%{?python_provide:%python_provide python3-%{srcname}-selftest}
|
||||
|
||||
%description -n python3-%{srcname}-selftest
|
||||
%{common_description}
|
||||
%description selftest
|
||||
PyCryptodome is a self-contained Python package of low-level cryptographic\
|
||||
primitives. It's a fork of PyCrypto.
|
||||
|
||||
This package provides the PyCryptodome test suite module (Cryptodome.SelfTest).
|
||||
|
||||
%files selftest
|
||||
%{python2_sitearch}/Cryptodome/SelfTest/
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%package -n python3-%{module}
|
||||
Summary: A self-contained cryptographic library for Python
|
||||
Group: Development/Python
|
||||
|
||||
%description -n python3-%{module}
|
||||
PyCryptodome is a self-contained Python package of low-level cryptographic\
|
||||
primitives. It's a fork of PyCrypto.
|
||||
|
||||
Note: all modules are installed under the Cryptodome package to avoid conflicts
|
||||
with the PyCrypto library.
|
||||
|
||||
%files -n python3-%{module}
|
||||
%doc AUTHORS.rst Changelog.rst README.rst
|
||||
%license LICENSE.rst
|
||||
%{python3_sitearch}/Cryptodome/
|
||||
%exclude %{python3_sitearch}/Cryptodome/SelfTest/
|
||||
%{python3_sitearch}/%{module}-*.egg-info/
|
||||
%{_mandir}/man1/pycryptodome.1.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%package -n python3-%{module}-selftest
|
||||
Summary: PyCryptodome test suite module
|
||||
Group: Development/Python
|
||||
Requires: python3-%{module}
|
||||
|
||||
%description -n python3-%{module}-selftest
|
||||
PyCryptodome is a self-contained Python package of low-level cryptographic\
|
||||
primitives. It's a fork of PyCrypto.
|
||||
|
||||
This package provides the PyCryptodome test suite module (Cryptodome.SelfTest).
|
||||
|
||||
%files -n python3-%{module}-selftest
|
||||
%{python3_sitearch}/Cryptodome/SelfTest/
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%autosetup -n pycryptodome-%{version} -p0
|
||||
|
@ -123,64 +107,24 @@ mv lib/Crypto/SelfTest/__main__.py.new lib/Crypto/SelfTest/__main__.py
|
|||
|
||||
%build
|
||||
touch .separate_namespace
|
||||
%if 0%{?_with_python2}
|
||||
%py2_build
|
||||
%endif
|
||||
%py3_build
|
||||
|
||||
# Build documentation
|
||||
%make_build -C Doc/ man SPHINXBUILD=sphinx-build-3
|
||||
|
||||
%make -C Doc/ man SPHINXBUILD=sphinx-build-3
|
||||
|
||||
%install
|
||||
%if 0%{?_with_python2}
|
||||
%py2_install
|
||||
%endif
|
||||
%py3_install
|
||||
|
||||
|
||||
# Install man pages
|
||||
install -Dpm 0644 Doc/_build/man/pycryptodome.1 $RPM_BUILD_ROOT%{_mandir}/man1/pycryptodome.1
|
||||
install -Dpm 0644 Doc/_build/man/pycryptodome.1 %{buildroot}%{_mandir}/man1/pycryptodome.1
|
||||
|
||||
# Fix permissions
|
||||
%if 0%{_with_python2}
|
||||
chmod 0755 $RPM_BUILD_ROOT%{python2_sitearch}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh
|
||||
%endif
|
||||
chmod 0755 $RPM_BUILD_ROOT%{python3_sitearch}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh
|
||||
|
||||
chmod 0755 %{buildroot}%{python2_sitearch}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh
|
||||
chmod 0755 %{buildroot}%{python3_sitearch}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh
|
||||
|
||||
%check
|
||||
%if 0%{?_with_tests}
|
||||
%if 0%{?_with_python2}
|
||||
%{__python2} setup.py test
|
||||
%endif
|
||||
%{__python3} setup.py test
|
||||
%endif
|
||||
%__python2 setup.py test
|
||||
%__python3 setup.py test
|
||||
|
||||
|
||||
%if 0%{?_with_python2}
|
||||
%files -n %python2-%{srcname}
|
||||
%doc AUTHORS.rst Changelog.rst README.rst
|
||||
%license LICENSE.rst
|
||||
%{python2_sitearch}/Cryptodome/
|
||||
%exclude %{python2_sitearch}/Cryptodome/SelfTest/
|
||||
%{python2_sitearch}/%{srcname}-*.egg-info/
|
||||
%{_mandir}/man1/pycryptodome.1.*
|
||||
|
||||
|
||||
%files -n %python2-%{srcname}-selftest
|
||||
%{python2_sitearch}/Cryptodome/SelfTest/
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-%{srcname}
|
||||
%doc AUTHORS.rst Changelog.rst README.rst
|
||||
%license LICENSE.rst
|
||||
%{python3_sitearch}/Cryptodome/
|
||||
%exclude %{python3_sitearch}/Cryptodome/SelfTest/
|
||||
%{python3_sitearch}/%{srcname}-*.egg-info/
|
||||
%{_mandir}/man1/pycryptodome.1.*
|
||||
|
||||
|
||||
%files -n python3-%{srcname}-selftest
|
||||
%{python3_sitearch}/Cryptodome/SelfTest/
|
||||
|
|
Loading…
Add table
Reference in a new issue