summaryrefslogtreecommitdiffstats
path: root/python-coverage.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-coverage.spec')
-rw-r--r--python-coverage.spec40
1 files changed, 15 insertions, 25 deletions
diff --git a/python-coverage.spec b/python-coverage.spec
index 1a18faa..71dc520 100644
--- a/python-coverage.spec
+++ b/python-coverage.spec
@@ -2,8 +2,6 @@
%global with_python3 1
%endif
-%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-
Name: python-coverage
Summary: Code coverage testing module for Python
Version: 3.2
@@ -36,45 +34,37 @@ have been executed.\
%package -n @confpkg-coverage
Summary: Code coverage testing module for @confpkg
Group: System Environment/Libraries
+Requires: @confpkg-setuptools
%description -n @confpkg-coverage
%SHARED_DESC
@confdescline
")
-%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}
chmod -x README.txt
sed -i 's/\r//g' README.txt
chmod -x coverage.egg-info/*.txt
+# Generate pristine Python 2 code
cp -a . ../pristine
-rpm-pyconfig --foreach --exe \
+# Generate pristine Python 3 code
+rpm-pyconfig --ifany-3 && (
+ rm -rf %{py3dir}
+ cp -a . %{py3dir}
+ pushd %{py3dir}
+ 2to3 --nobackups --write .
+ popd
+)
+
+# Each config gets its own source tree. This is possibly paranoid
+rpm-pyconfig --foreach-2 --exe \
"cp -a ../pristine @confsrcdir"
-%if 0%{?with_python3}
-rm -rf %{py3dir}
-cp -a . %{py3dir}
-pushd %{py3dir}
-2to3 --nobackups --write .
-popd
-%endif # if with_python3
+rpm-pyconfig --foreach-3 --exe \
+ "cp -a %{py3dir} @confsrcdir"
%build
%(rpm-pyconfig --foreach --eval "