%{!?python_sitelib_platform: %define python_sitelib_platform %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define pkgname hashlib Summary: Secure hash and message digest algorithm library Name: python-hashlib Version: 20081119 Release: 5%{?dist} Source0: http://code.krypto.org/python/hashlib/%{pkgname}-%{version}.tar.gz License: Python Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: openssl-devel, python-devel Prefix: %{_prefix} Url: http://code.krypto.org/python/hashlib/ # https://bugzilla.redhat.com/show_bug.cgi?id=503772 Source1: hmac25.py Patch0: %{name}-hmac25.patch %description This is a stand alone packaging of the hashlib library introduced in Python 2.5 so that it can be used on older versions of Python. %prep %setup -q -n %{pkgname}-%{version} #fix EOL characters sed -i -e 's|\r||g' README.txt ChangeLog %patch0 -p0 -b .hmac25 %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %install rm -rf %{buildroot} %{__python} setup.py install -O1 --root=%{buildroot} cp %{SOURCE1} %{buildroot}%{python_sitelib_platform} %check PYTHONPATH=%{buildroot}%{python_sitelib_platform} %{__python} test/test_hashlib.py %clean rm -rf %{buildroot} %files %defattr(-,root,root) %{python_sitelib_platform}/* %doc README.txt ChangeLog %changelog * Mon Jun 01 2009 Luke Macken - 20081119-5 - Add python-hashlib-hmac25.patch to work around some Python2.4 hmac / hashlib incompatibility - Include Python2.5's hmac.py as hmac25.py in our site-packages - Run the hashlib test suite * Fri Feb 20 2009 Dennis Gilmore - 20081119-4 - review fixes (License TAG, doc files) * Thu Jan 29 2009 Seth Vidal - 20081119-3 - few minor spec cleanups - add Changelog to docs - first build and packaging