%global pythonver %(%{__python} -c "import sys; print sys.version[:3]" || echo 0.0) %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: Cryptography library for Python Name: python-crypto2.1 Version: 2.1.0 Release: 3%{?dist} # Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python License: Public Domain and Python Group: Development/Libraries URL: http://www.pycrypto.org/ Source0: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz Patch0: python-crypto-2.1.0-optflags.patch Patch1: python-crypto2.1-use-Crypto21.patch Patch2: python-crypto2.1-setup-Crypto21.patch BuildRequires: python2-devel BuildRequires: gmp-devel >= 4.1 # Don't want provides for python shared objects %{?filter_provides_in: %filter_provides_in %{python_sitearch}/Crypto/.*\.so} %{?filter_setup} %description Python-crypto is a collection of both secure hash functions (such as MD5 and SHA), and various encryption algorithms (AES, DES, RSA, ElGamal etc.). This is a parallel update for EPEL6 %prep %setup -n pycrypto-%{version} -q # Use distribution compiler flags rather than upstream's %patch0 -p1 %patch1 -p1 %patch2 -p1 # Remove spurious shellbangs %{__sed} -i -e '\|^#!/usr/local/bin/python| d' lib/Crypto/Util/RFC1751.py # Fix permissions for debuginfo %{__chmod} -x src/*.c %{__mv} lib/Crypto lib/Crypto21 %build CFLAGS="%{optflags}" %{__python} setup.py build %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} # Remove group write permissions on shared objects /usr/bin/find %{buildroot}%{python_sitearch} -name '*.so' \ -exec %{__chmod} g-w {} \; # See if there's any egg-info if [ -f %{buildroot}%{python_sitearch}/pycrypto-%{version}-py%{pythonver}.egg-info ]; then echo %{python_sitearch}/pycrypto-%{version}-py%{pythonver}.egg-info fi > egg-info %check %{__python} setup.py test %files -f egg-info %doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/ %{python_sitearch}/Crypto21/ %changelog * Sat Apr 18 2015 Athmane Madjoudj 2.1.0-3 - Rebase use Crypto21 patch. - Remove pycrypto provide. * Thu Apr 16 2015 Cleber Rosa - 2.1.0-2 - Patched setup.py to use Crypto21 module name from the start - This removed the need for the rename after the build and installation - Enabled the check target * Fri Mar 27 2015 Athmane Madjoudj 2.1.0-1 - First EPEL6 spec