From 4adf7b746cb8d607ef7e51fa4d10f2e437267a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 12 Jul 2018 23:11:28 +0200 Subject: [PATCH] Only ship one version of the rst2* executables Also, invoke python2 with python2 in %check --- python-docutils.spec | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/python-docutils.spec b/python-docutils.spec index 20150c5..4b21427 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -6,7 +6,7 @@ Name: python-%{srcname} Version: 0.14 -Release: 4%{?dist} +Release: 5%{?dist} Summary: System for processing plaintext documentation Group: Development/Languages @@ -105,41 +105,37 @@ popd %install -# Must do the python3 install first because the scripts in /usr/bin are -# overwritten by setup.py install (and we want the python2 version to be the -# default for now). -%if 0%{?with_python3} -pushd %{py3dir} -%py3_install +%py2_install # docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib. rm -rf %{buildroot}%{python3_sitelib}/test -for file in %{buildroot}/%{_bindir}/*.py; do - mv $file `dirname $file`/`basename $file .py`-3 -done - # Flash file is used for testing docutils but shouldn't be in the installed package. mv docs/user/rst/images/biohazard.swf ./biohazard.swf -popd +%if 0%{?with_python3} +rm -f %{buildroot}/%{_bindir}/* %endif # with_python3 -%py2_install - -for file in %{buildroot}/%{_bindir}/*.py; do - mv $file `dirname $file`/`basename $file .py` -done - +%if 0%{?with_python3} +pushd %{py3dir} +%py3_install # We want the licenses but don't need this build file rm -f licenses/docutils.conf # Flash file is used for testing docutils but shouldn't be in the installed package. mv docs/user/rst/images/biohazard.swf ./biohazard.swf +popd +%endif # with_python3 + +for file in %{buildroot}/%{_bindir}/*.py; do + mv $file `dirname $file`/`basename $file .py` +done + %check mv biohazard.swf docs/user/rst/images/biohazard.swf -python test/alltests.py +python2 test/alltests.py rm docs/user/rst/images/biohazard.swf %if 0%{?with_python3} @@ -154,7 +150,6 @@ popd %license COPYING.txt licenses/* %doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt %doc THANKS.txt docs tools/editors -%{_bindir}/*[!'-3'] %{python2_sitelib}/* %if 0%{?with_python3} @@ -162,11 +157,17 @@ popd %license COPYING.txt licenses/* %doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt %doc THANKS.txt docs tools/editors -%{_bindir}/*-3 %{python3_sitelib}/* %endif +# Leave this at the end to end up in the proper one +%{_bindir}/* + %changelog +* Thu Jul 12 2018 Miro Hrončok - 0.14-5 +- Only ship one version of the rst2* executables +- Invoke python2 with python2 in %%check + * Thu Jun 14 2018 Miro Hrončok - 0.14-4 - Rebuilt for Python 3.7