%define name python-mock %define srcname mock %define version 1.0.1 %define release 1 %define is_python %(test -e /usr/bin/python && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python_64 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %endif Summary: A Python Mocking and Patching Library for Testing Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: UNKNOWN Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Michael Foord Url: http://www.voidspace.org.uk/python/mock/ BuildRequires: python, python-devel Requires: python %description mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. mock is now part of the Python standard library, available as `unittest.mock `_ in Python 3.3 onwards. mock provides a core `MagicMock` class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. %prep %setup -n %{srcname}-%{version} mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build cd 64bit python_64 setup.py build cd ../32bit python setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT cd 64bit python_64 setup.py install --skip-build --root ${RPM_BUILD_ROOT} cd ../32bit python setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/LICENSE.txt 32bit/PKG-INFO 32bit/README.txt %doc 32bit/docs %{python_sitelib}/mock* %changelog * Thu Jun 7 2013 Tristan Delhalle - 1.0.1-1 - first version for AIX V6.1 and higher