%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1
%endif
%global modname chai
Name: python-%{modname}
Version: 0.4.4
Release: 1%{?dist}
Summary: Easy to use mocking/stub framework
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/chai
Source0: http://pypi.python.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-nose
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-nose
%endif
%description
Chai provides a very easy to use api for mocking/stubbing your python
objects, patterned after the `Mocha `_ library
for Ruby.
%if 0%{?with_python3}
%package -n python3-%{modname}
Summary: Easy to use mocking/stub framework
Group: Development/Libraries
%description -n python3-%{modname}
Chai provides a very easy to use api for mocking/stubbing your python
objects, patterned after the `Mocha `_ library
for Ruby.
%endif
%prep
%setup -q -n %{modname}-%{version}
# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
rm chai/python2.py
%{__python3} setup.py build
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
%check
# breaks because of https://github.com/agoragames/chai/issues/11
#nosetests
%if 0%{?with_python3}
pushd %{py3dir}
nosetests-3.3
popd
%endif
%files
%doc README.rst
# LICENSE.txt https://github.com/agoragames/chai/pull/9
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*
%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst
# LICENSE.txt https://github.com/agoragames/chai/pull/9
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*
%endif
%changelog
* Tue Oct 29 2013 Pierre-Yves Chibon 0.4.4-1
- initial package for Fedora