python-coverage/python-coverage.spec
2015-03-31 10:29:13 -04:00

247 lines
8.2 KiB
RPMSpec

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