Fix and install license

- Cleanup and modernize spec
This commit is contained in:
Orion Poplawski 2016-01-13 11:56:26 -07:00
parent 4d09d33b92
commit 8645a7f9f6

View File

@ -1,24 +1,19 @@
%if 0%{?fedora} > 12
%if 0%{?fedora}
%global with_python3 1
%else
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
%global prever b1
%{!?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.1
Release: 0.1.%{?prever}%{?dist}
License: BSD and (MIT or GPLv2)
License: ASL 2.0
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
@ -35,6 +30,20 @@ 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.
%package -n python2-coverage
Summary: Code coverage testing module for Python 2
Group: System Environment/Libraries
# As the "coverage" executable requires the setuptools at runtime (#556290),
# so the "python3-coverage" executable requires python3-setuptools:
Requires: python2-setuptools
%{?python_provide:%python_provide python2-coverage}
%description -n python2-coverage
Coverage.py is a Python 2 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
@ -42,6 +51,7 @@ 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
%{?python_provide:%python_provide python3-coverage}
%description -n python3-coverage
Coverage.py is a Python 3 module that measures code coverage during Python
@ -56,29 +66,21 @@ have been executed.
find . -type f -exec chmod 0644 \{\} \;
sed -i 's/\r//g' README.rst
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # if with_python3
%build
%{__python2} setup.py build
%py2_build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%py3_build
%endif # if with_python3
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
%py3_install
mv %{buildroot}/%{_bindir}/coverage %{buildroot}/%{_bindir}/python3-coverage
popd
%endif # if with_python3
%{__python2} setup.py install --skip-build --root %{buildroot}
%py2_install
# rename binaries, make compat symlinks
pushd %{buildroot}%{_bindir}
@ -97,18 +99,21 @@ for i in coverage3 coverage-%{?python3_shortver}; do
done
popd
%files
%files -n python2-coverage
%license LICENSE.txt NOTICE.txt
%doc README.rst
%{_bindir}/coverage
%{_bindir}/coverage2
%{_bindir}/coverage-2*
%{_bindir}/python-coverage
%{_bindir}/python2-coverage
%{python_sitearch}/coverage/
%{python_sitearch}/coverage*.egg-info/
%{python2_sitearch}/coverage/
%{python2_sitearch}/coverage*.egg-info/
%if 0%{?with_python3}
%files -n python3-coverage
%license LICENSE.txt NOTICE.txt
%doc README.rst
%{_bindir}/coverage-3*
%{_bindir}/coverage3
%{_bindir}/python3-coverage
@ -118,6 +123,10 @@ popd
%changelog
* Wed Jan 13 2016 Orion Poplawski <orion@cora.nwra.com> - 4.1-0.2.b1
- Fix and install license
- Cleanup and modernize spec
* Tue Jan 12 2016 Tom Callaway <spot@fedoraproject.org> - 4.1-0.1.b1
- update to 4.1b1