ba733b
%if 0%{?fedora} > 12
ba733b
%global with_python3 1
ba733b
%endif
ba733b
ba733b
%global betaver b3
ba733b
ba733b
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
ba733b
ba733b
# tracer.so is a private object, don't include it in the provides
ba733b
%global _use_internal_dependency_generator 0
ba733b
%global __find_provides /bin/sh -c "%{_rpmconfigdir}/find-provides | grep -v -E '(tracer.so)' || /bin/true"
ba733b
%global __find_requires /bin/sh -c "%{_rpmconfigdir}/find-requires | grep -v -E '(tracer.so)' || /bin/true"
ba733b
ba733b
Name:           python-coverage
ba733b
Summary:        Code coverage testing module for Python
ba733b
Version:        3.6
ba733b
Release:        0.3.%{?betaver}%{?dist}
ba733b
License:        BSD and (MIT or GPLv2)
ba733b
Group:          System Environment/Libraries
ba733b
URL:            http://nedbatchelder.com/code/modules/coverage.html
ba733b
Source0:        http://pypi.python.org/packages/source/c/coverage/coverage-%{version}%{?betaver}.tar.gz
ba733b
BuildRequires:  python-setuptools, python-devel
ba733b
Requires:       python-setuptools
ba733b
%if 0%{?with_python3}
ba733b
BuildRequires:  /usr/bin/2to3
ba733b
BuildRequires:  python3-setuptools, python3-devel
ba733b
%endif # with_python3
ba733b
ba733b
%description
ba733b
Coverage.py is a Python module that measures code coverage during Python 
ba733b
execution. It uses the code analysis tools and tracing hooks provided in the 
ba733b
Python standard library to determine which lines are executable, and which 
ba733b
have been executed.
ba733b
ba733b
%if 0%{?with_python3}
ba733b
%package -n python3-coverage
ba733b
Summary:        Code coverage testing module for Python 3
ba733b
Group:          System Environment/Libraries
ba733b
# As the "coverage" executable requires the setuptools at runtime (#556290),
ba733b
# so the "python3-coverage" executable requires python3-setuptools:
ba733b
Requires:       python3-setuptools
ba733b
ba733b
%description -n python3-coverage
ba733b
Coverage.py is a Python 3 module that measures code coverage during Python
ba733b
execution. It uses the code analysis tools and tracing hooks provided in the 
ba733b
Python standard library to determine which lines are executable, and which 
ba733b
have been executed.
ba733b
%endif # with_python3
ba733b
ba733b
%prep
ba733b
%setup -q -n coverage-%{version}%{?betaver}
ba733b
ba733b
find . -type f -exec chmod 0644 \{\} \;
ba733b
sed -i 's/\r//g' README.txt
ba733b
ba733b
%if 0%{?with_python3}
ba733b
rm -rf %{py3dir}
ba733b
cp -a . %{py3dir}
ba733b
pushd %{py3dir}
ba733b
2to3 --nobackups --write .
ba733b
popd
ba733b
%endif # if with_python3
ba733b
ba733b
%build
ba733b
%{__python} setup.py build
ba733b
ba733b
%if 0%{?with_python3}
ba733b
pushd %{py3dir}
ba733b
%{__python3} setup.py build
ba733b
popd
ba733b
%endif # if with_python3
ba733b
ba733b
%install
ba733b
%if 0%{?with_python3}
ba733b
pushd %{py3dir}
ba733b
%{__python3} setup.py install --skip-build --root %{buildroot}
ba733b
mv %{buildroot}/%{_bindir}/coverage %{buildroot}/%{_bindir}/python3-coverage
ba733b
popd
ba733b
%endif # if with_python3
ba733b
ba733b
%{__python} setup.py install --skip-build --root %{buildroot}
ba733b
ba733b
%files
ba733b
%doc README.txt
ba733b
%{_bindir}/coverage
ba733b
%{_bindir}/coverage2
ba733b
%{_bindir}/coverage-2*
ba733b
%{python_sitearch}/coverage/
ba733b
%{python_sitearch}/coverage*.egg-info/
ba733b
ba733b
%if 0%{?with_python3}
ba733b
%files -n python3-coverage
ba733b
%{_bindir}/coverage-3*
ba733b
%{_bindir}/coverage3
ba733b
%{_bindir}/python3-coverage
ba733b
%{python3_sitearch}/coverage/
ba733b
%{python3_sitearch}/coverage*.egg-info/
ba733b
%endif # if with_python3
ba733b
ba733b
ba733b
%changelog
ba733b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6-0.3.b3
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ba733b
ba733b
* Wed Jan  2 2013 Tom Callaway <spot@fedoraproject.org> - 3.6-0.3.b3
ba733b
- update to 3.6beta3
ba733b
ba733b
* Thu Nov 29 2012 Tom Callaway <spot@fedoraproject.org> - 3.6-0.1.b1
ba733b
- update to 3.6beta1
ba733b
- patch0 merged into upstream
ba733b
ba733b
* Wed Oct 10 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 3.5.3-2
ba733b
- Patch from upstream for traceback when people use this with python2 and
ba733b
  python3 in the same directory
ba733b
ba733b
* Mon Oct  1 2012 Tom Callaway <spot@fedoraproject.org> - 3.5.3-1
ba733b
- update to 3.5.3
ba733b
ba733b
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.5.2-0.4.b1
ba733b
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
ba733b
ba733b
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 3.5.2-0.3.b1
ba733b
- remove rhel logic from with_python3 conditional
ba733b
ba733b
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.2-0.2.b1
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
ba733b
ba733b
* Wed May  2 2012 Tom Callaway <spot@fedoraproject.org> - 3.5.2-0.1.b1
ba733b
- update to 3.5.2b1
ba733b
ba733b
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.1-0.2.b1
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ba733b
ba733b
* Fri Sep  2 2011 Tom Callaway <spot@fedoraproject.org> - 3.5.1-0.1.b1
ba733b
- update to 3.5.1b1
ba733b
ba733b
* Mon Jun  6 2011 Tom Callaway <spot@fedoraproject.org> - 3.5-0.1.b1
ba733b
- update to 3.5b1
ba733b
ba733b
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-3
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ba733b
ba733b
* Wed Dec 29 2010  <David Malcolm <dmalcolm@redhat.com>> - 3.4-2
ba733b
- rebuild for newer python3
ba733b
ba733b
* Thu Oct 21 2010 Luke Macken <lmacken@redhat.com> - 3.4-1
ba733b
- Update to 3.4 (#631751)
ba733b
ba733b
* Fri Sep 03 2010 Luke Macken <lmacken@redhat.com> - 3.3.1-4
ba733b
- Rebuild against Python 3.2
ba733b
ba733b
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.3.1-3
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ba733b
ba733b
* Wed May 9 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 3.3.1-2
ba733b
- Fix license tag, permissions, and filtering extraneous provides
ba733b
ba733b
* Wed May 9 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 3.3.1-1
ba733b
- Update to 3.3.1
ba733b
ba733b
* Fri Feb  5 2010 David Malcolm <dmalcolm@redhat.com> - 3.2-3
ba733b
- add python 3 subpackage (#536948)
ba733b
ba733b
* Sun Jan 17 2010 Luke Macken <lmacken@redhat.com> - 3.2-2
ba733b
- Require python-setuptools (#556290)
ba733b
ba733b
* Wed Dec  9 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 3.2-1
ba733b
- update to 3.2
ba733b
ba733b
* Fri Oct 16 2009 Luke Macken <lmacken@redhat.com> - 3.1-1
ba733b
- Update to 3.1
ba733b
ba733b
* Wed Aug 10 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 3.0.1-1
ba733b
- update to 3.0.1
ba733b
ba733b
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.85-3
ba733b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ba733b
ba733b
* Fri May 15 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.85-2
ba733b
- fix install invocation
ba733b
ba733b
* Wed May 6 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.85-1
ba733b
- Initial package for Fedora