diff --git a/python-docutils.changes b/python-docutils.changes index 1b9c110..e209e97 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 6 13:31:03 UTC 2017 - jmatejek@suse.com + +- only emit rst2html5 alternatives for python 3 +- switch the "docutils" provides to the python 3 package (all the comands live ther) + ------------------------------------------------------------------- Mon May 1 19:33:19 UTC 2017 - toddrme2178@gmail.com diff --git a/python-docutils.spec b/python-docutils.spec index d7eb385..62bb28d 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -32,13 +32,13 @@ BuildRequires: %{python_module xml} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-xml -%ifpython2 +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%ifpython3 Provides: docutils = %{version} Obsoletes: docutils < %{version} %endif -Requires(post): update-alternatives -Requires(preun): update-alternatives -BuildArch: noarch %python_subpackages %description @@ -47,12 +47,12 @@ such as HTML, XML, and LaTeX. For input Docutils supports reStructuredText, an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. %prep -%setup -n docutils-%{version} +%setup -q -n docutils-%{version} # Remove useless ".py" ending from executables: for i in tools/rst*; do mv "$i" "${i/.py}"; done sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py # Remove shebang from non-executable files -for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html','math/tex2mathml_extern'}; do +for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html','math/tex2mathml_extern'}; do sed -i -e "1d" "docutils/utils/$i.py" done sed -i -e "1d" "docutils/writers/xetex/__init__.py" "docutils/writers/_html_base.py" @@ -69,12 +69,16 @@ mv %{buildroot}%{_bindir}/rst2html5 %{buildroot}%{_bindir}/rst2html5-docutils ln -s -f %{_sysconfdir}/alternatives/rst2html5 %{buildroot}%{_bindir}/rst2html5 %post +%ifpython3 update-alternatives --install %{_bindir}/rst2html5 rst2html5 %{_bindir}/rst2html5-docutils 15 +%endif -%preun +%postun +%ifpython3 if [ ! -f %{_bindir}/rst2html5-docutils ] ; then update-alternatives --remove rst2html5 %{_bindir}/rst2html5-docutils fi +%endif %check %python_exec -c 'import subprocess; import sys; sys.exit(subprocess.call([sys.executable, "test/alltests.py" if sys.version_info[0] == 2 else "test3/alltests.py"]))'