3f5afb
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
3f5afb
051440
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
051440
    %global with_python3 1
051440
%endif
051440
3f5afb
Name:           python-minimock
3f5afb
Version:        1.2.5
051440
Release:        3%{?dist}
3f5afb
Summary:        The simplest possible mock library
3f5afb
3f5afb
Group:          Development/Tools
3f5afb
License:        MIT
3f5afb
URL:            http://pypi.python.org/pypi/MiniMock
3f5afb
Source0:        http://pypi.python.org/packages/source/M/MiniMock/MiniMock-%{version}.tar.gz
3f5afb
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3f5afb
3f5afb
BuildArch:      noarch
3f5afb
BuildRequires:  python-devel
3f5afb
BuildRequires:  python-setuptools
3f5afb
051440
%if 0%{?with_python3}
051440
BuildRequires:  python3-devel
051440
BuildRequires:  python3-setuptools
051440
BuildRequires:  python-tools
051440
%endif
051440
3f5afb
%description
3f5afb
minimock is a simple library for doing Mock objects with doctest.
3f5afb
051440
%if 0%{?with_python3}
051440
%package -n python3-minimock
051440
Summary:        The simplest possible mock library
051440
%description -n python3-minimock
051440
minimock is a simple library for doing Mock objects with doctest.
051440
%endif
3f5afb
3f5afb
%prep
3f5afb
%setup -q -n MiniMock-%{version}
3f5afb
051440
%if 0%{?with_python3}
051440
rm -rf %{py3dir}
051440
cp -ar . %{py3dir}
051440
2to3 --write --nobackups %{py3dir}
051440
%endif
3f5afb
3f5afb
%build
3f5afb
%{__python} setup.py build
3f5afb
051440
%if 0%{?with_python3}
051440
pushd %{py3dir}
051440
    %{__python3} setup.py build
051440
popd
051440
%endif
051440
3f5afb
3f5afb
%install
3f5afb
rm -rf $RPM_BUILD_ROOT
3f5afb
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
3f5afb
051440
%if 0%{?with_python3}
051440
pushd %{py3dir}
051440
    %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
051440
popd
051440
%endif
051440
3f5afb
 
3f5afb
%clean
3f5afb
rm -rf $RPM_BUILD_ROOT
3f5afb
3f5afb
3f5afb
%files
3f5afb
%defattr(-,root,root,-)
3f5afb
%doc docs/*
051440
%{python_sitelib}/MiniMock-%{version}-py?.?.egg-info
051440
%{python_sitelib}/minimock*
3f5afb
051440
%if 0%{?with_python3}
051440
%files -n python3-minimock
051440
%defattr(-,root,root,-)
051440
%doc docs/*
051440
%{python3_sitelib}/MiniMock-%{version}-py?.?.egg-info
051440
%{python3_sitelib}/minimock*
051440
%endif
3f5afb
3f5afb
%changelog
051440
* Fri Feb  5 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.2.5-3
051440
- update python3 subpackage to reflect actuall guidelines
051440
051440
* Thu Jan 14 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.2.5-2
051440
- also ship python3-minimock
051440
- be more explicit in %%files
051440
3f5afb
* Thu Dec 22 2009 Thomas Spura <tomspur@fedoraproject.org> - 1.2.5-1
3f5afb
- correct URL
3f5afb
- update to new version
3f5afb
3f5afb
* Sat Dec 5 2009 Thomas Spura <tomspur@fedoraproject.org> - 1.0-1
3f5afb
- Initial creation for review