%global pypi_name pycryptodome Name: python-%{pypi_name} Version: 3.8.2 Release: 1%{?dist} Summary: Cryptographic library for Python # The source code in PyCryptodome is partially in the public domain # and partially released under the BSD 2-Clause license. # In either case, there are minimal if no restrictions on the redistribution, # modification and usage of the software. License: BSD and Public Domain and ASL 2.0 URL: https://www.pycryptodome.org Source0: %{pypi_source} Patch0: https://src.fedoraproject.org/rpms/python-pycryptodomex/raw/master/f/python-pycryptodomex-3.7.3-use_external_libtomcrypt.patch BuildRequires: python3-devel BuildRequires: gcc BuildRequires: python3dist(setuptools) BuildRequires: libtomcrypt-devel %description PyCryptodome is a self-contained Python package of low-level cryptographic primitives. %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} # GMP library is dl-opened Requires: gmp%{?_isa} %description -n python3-%{pypi_name} PyCryptodome PyCryptodome is a self-contained Python package of low-level cryptographic primitives.It supports Python 2.6 and 2.7, Python 3.4 and newer, and PyPy. %prep %autosetup -n %{pypi_name}-%{version} -p0 # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # Drop bundled libraries rm -r src/libtom/ # 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 # Use -fno-strict-aliasing in order to bypass: # https://github.com/Legrandin/pycryptodome/issues/291 export CFLAGS="%{optflags} -fno-strict-aliasing" %py3_build %install %py3_install %check %{__python3} setup.py test %files -n python3-%{pypi_name} %doc AUTHORS.rst Changelog.rst README.rst %license LICENSE.rst %{python3_sitearch}/Crypto %{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Fri Jun 14 2019 Pavlo Rudyi - 3.8.2-1 - initial build