%global srcname pymox %global sum Mock object framework %if 0%{?fedora} %global with_python3 1 %endif Name: python-mox Version: 0.7.8 Release: 1%{?dist} Summary: %{sum} License: ASL 2.0 URL: https://pypi.python.org/pypi/%{srcname} Source0: https://github.com/ivancrneto/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if 0%{?el6}%{?el7} BuildRequires: python-six %else BuildRequires: python2-six %endif %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-six %endif %description Mox is a mock object framework for Python. %package -n python2-mox Summary: %{sum} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-mox Mox is a mock object framework for Python. %if 0%{?with_python3} %package -n python3-mox Summary: %{sum} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-mox Mox is a mock object framework for Python. %endif %prep %autosetup -n %{srcname}-%{version} # Remove erroneous shebang sed -i -e '/^#!\//, 1d' mox.py sed -i -e '/^#!\//, 1d' stubout.py %build %py2_build %if 0%{?with_python3} %py3_build %endif %install %py2_install %if 0%{?with_python3} %py3_install %endif %check # FIXME : Syntax error on EL6 %{!?el6:%{__python2} mox_test.py} %if 0%{?with_python3} %{__python3} mox_test.py %endif %files -n python2-mox %license COPYING %doc README.rst %{python2_sitelib}/* %if 0%{?with_python3} %files -n python3-mox %license COPYING %doc README.rst %{python3_sitelib}/* %endif %changelog * Fri Jun 29 2018 Xavier Bachelot - 0.7.8-1 - Update to 0.7.8. * Thu Feb 22 2018 Xavier Bachelot - 0.7.7-1 - Update to 0.7.7. * Mon Jan 22 2018 Xavier Bachelot - 0.7.6-1 - Initial package.