%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_minor 16 %global py_major 3.9 %global python_major python%{py_major} %global pkgname pycryptodomex %global meta_package python3-%{pkgname} %global meta_package1 python3-%{pkgname}-selftest %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") %global python3_sitearch64 %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") Name: %{python_major}-%{pkgname} Version: 3.10.1 Release: 2 Summary: A self-contained cryptographic library for Python License: BSD and Public Domain URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/p/%{pkgname}/%{pkgname}-%{version}.tar.gz BuildArch: ppc BuildRequires: %{python_major}-devel >= %{py_major} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major} BuildRequires: make >= 4.2.1 BuildRequires: gcc >= 8.3.0 BuildRequires: libtomcrypt-devel >= 1.18.2 # Needed for documentation BuildRequires: %{python_major}-sphinx >= 2.3.0 %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.} %package -n %{python_major}-%{pkgname}-selftest Summary: PyCryptodome test suite module Requires: %{python_major}%{?_isa} Provides: %{python_major}-%{pkgname}-selftest %description -n %{python_major}-%{pkgname}-selftest %{_description} This package provides the PyCryptodome test suite module (Cryptodome.SelfTest). %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %package -n %{meta_package1} Summary: Meta-package for %{python_major}-%{pkgname}-selftest Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} Requires: %{python_major}-%{pkgname}-selftest = %{version}-%{release} %description -n %{meta_package1} This is a Meta-package for %{python_major}-%{pkgname}-selftest package. %prep %autosetup -n pycryptodome-%{version} -p1 # Remove shebang sed '1{\@^#! /usr/bin/env python@d}' lib/Crypto/SelfTest/__main__.py >lib/Crypto/SelfTest/__main__.py.new && \ touch -r lib/Crypto/SelfTest/__main__.py lib/Crypto/SelfTest/__main__.py.new && \ mv lib/Crypto/SelfTest/__main__.py.new lib/Crypto/SelfTest/__main__.py %build touch .separate_namespace export PATH=/opt/freeware/bin:$PATH # Build documentation make -C Doc/ man SPHINXBUILD=sphinx-build %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS.rst Changelog.rst README.rst %license LICENSE.rst %exclude %{python3_sitearch64}/Cryptodome/SelfTest/ %{python3_sitearch64}/* %files -n %{meta_package} %defattr(-,root,system,-) %{python3_sitearch64}/Cryptodome/SelfTest/* %files -n %{python_major}-%{pkgname}-selftest %defattr(-,root,system,-) %{python3_sitearch64}/Cryptodome/SelfTest/* %files -n python3-%{pkgname}-selftest %defattr(-,root,system,-) %{python3_sitearch64}/Cryptodome/SelfTest/* %changelog * Tue Mar 7 2023 Sangeetha Bandi - 3.10.1-2 - pycryptodomex for python3.9 * Mon Apr 19 2021 Rishita Saha - 3.10.1-1 - Initial port to AIX Toolbox * Tue Feb 09 2021 Mohamed El Morabity - 3.10.1-1 - Update to 3.10.1 * Wed Jul 29 2020 Fedora Release Engineering - 3.9.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue Jul 07 2020 Mohamed El Morabity - 3.9.8-1 - Update to 3.9.8 * Fri Jun 05 2020 Miro Hron▒^▒ok - 3.9.7-3 - Drop python2-pycryptodomex (#1785783) * Tue May 26 2020 Miro Hron▒^▒ok - 3.9.7-2 - Rebuilt for Python 3.9 * Fri Feb 21 2020 Mohamed El Morabity - 3.9.7-1 - Update to 3.9.7 * Mon Feb 17 2020 Mohamed El Morabity - 3.9.6-2 - Move test suite module to a separate package (RHBZ #1802989) * Mon Feb 03 2020 Mohamed El Morabity - 3.9.6-1 - Update to 3.9.6 * Thu Jan 30 2020 Fedora Release Engineering - 3.9.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Nov 19 2019 Mohamed El Morabity - 3.9.4-1 - Update to 3.9.4 * Fri Nov 15 2019 Mohamed El Morabity - 3.9.3-1 - Update to 3.9.3 * Fri Nov 15 2019 Mohamed El Morabity - 3.9.2-1 - Update to 3.9.2 - Spec cleanup * Thu Oct 03 2019 Miro Hron▒^▒ok - 3.9.0-2 - Rebuilt for Python 3.8.0rc1 (#1748018) * Wed Aug 28 2019 Mohamed El Morabity - 3.9.0-1 - Update to 3.9.0 * Mon Aug 19 2019 Miro Hron▒^▒ok - 3.8.2-2 - Rebuilt for Python 3.8 * Fri Aug 09 2019 Mohamed El Morabity - 3.8.2-1 - Update to 3.8.2 * Fri Jul 26 2019 Fedora Release Engineering - 3.8.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Apr 09 2019 Miro Hron▒^▒ok - 3.8.1-2 - Readd python2-pycryptodomex (#1672052) * Fri Apr 05 2019 Mohamed El Morabity - 3.8.1-1 - Update to 3.8.1 * Fri Mar 29 2019 Mohamed El Morabity - 3.8.0-1 - Update to 3.8.0 * Fri Feb 15 2019 Mohamed El Morabity - 3.7.3-1 - Update to 3.7.3 * Sat Feb 02 2019 Fedora Release Engineering - 3.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Mon Nov 19 2018 Mohamed El Morabity - 3.7.0-1 - Update to 3.7.0 - Use the same .spec file for all supported releases of Fedora and EL