%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define python_sitearch64 %(python_64 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") Summary: Cryptography library for Python Name: python-crypto Version: 2.6 Release: 1 # 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 Source1: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz.asc Source2: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz.sha256sum Patch0: %{name}-%{version}-aix.patch Provides: pycrypto = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: AIX-rpm >= 5.2.0.0 BuildRequires: python-devel >= 2.6.2 BuildRequires: gmp-devel >= 5.0.5-1 BuildRequires: perl >= 5.8.8, sed # we need /dev/urandom Requires: AIX-rpm >= 5.2.0.0 Requires: python >= 2.6.2 Requires: gmp >= 5.0.5-1 %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.). %prep %setup -q -n pycrypto-%{version} %patch0 export PATH=/opt/freeware/bin:$PATH # Remove spurious shellbangs sed -i -e '\|^#!/usr/local/bin/python| d' lib/Crypto/Util/RFC1751.py # Fix permissions for debuginfo %{__chmod} -x src/_fastmath.c mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build export CC="xlc_r" cd 64bit export OBJECT_MODE=64 python_64 setup.py build cd ../32bit export OBJECT_MODE=32 python setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit python_64 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} cd ../32bit python setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} # fix path to python find ${RPM_BUILD_ROOT}%{python_sitearch} -name "*.py" | xargs /opt/freeware/bin/perl -pi -e "s:/usr/local/bin/python:/opt/freeware/bin/python:" find ${RPM_BUILD_ROOT}%{python_sitearch64} -name "*.py" | xargs /opt/freeware/bin/perl -pi -e "s:/usr/local/bin/python:/opt/freeware/bin/python_64:" %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/README 32bit/TODO 32bit/ACKS 32bit/ChangeLog 32bit/LEGAL/ %doc 32bit/COPYRIGHT 32bit/Doc %{python_sitearch}/* %{python_sitearch64}/* %changelog * Mon Aug 12 2013 Michael Perzl - 2.6-1 - updated to version 2.6 - updated to GMP version 5.0.5 - fixed the segmentation faults * Mon Nov 21 2011 Michael Perzl - 2.4.1-1 - updated to version 2.4.1 * Tue Feb 08 2011 Michael Perzl - 2.3-1 - updated to version 2.3 * Wed Sep 02 2009 Michael Perzl - 2.0.1-1 - first version for AIX V5.1 and higher