From d74992fe32515009b888d080ce4842143a7cedf04c73185726c89aa55a3e4864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 14 Mar 2020 09:57:12 +0000 Subject: [PATCH 1/3] - Add patch to fix build with pygments 2.4 and newer: * pygments25.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=63 --- pygments25.patch | 107 ++++++++++++++++++++++++++++++++++++++++ python-docutils.changes | 6 +++ python-docutils.spec | 3 +- 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 pygments25.patch diff --git a/pygments25.patch b/pygments25.patch new file mode 100644 index 0000000..c998c23 --- /dev/null +++ b/pygments25.patch @@ -0,0 +1,107 @@ +Index: docutils/test/test_parsers/test_rst/test_directives/test_code.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_directives/test_code.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_directives/test_code.py (revision 8495) +@@ -98,7 +98,7 @@ + + totest['code-parsing'] = [ + ["""\ +-.. code:: python ++.. code:: python3 + :class: testclass + + print('hello world') # to stdout +@@ -105,9 +105,9 @@ + """, + """\ + +- ++ + \n\ +- ++ + print + + ( +@@ -120,7 +120,7 @@ + # to stdout + """], + ["""\ +-.. code:: python ++.. code:: python3 + :class: testclass + :name: my_function + :number-lines: 7 +@@ -134,7 +134,7 @@ + """, + """\ + +- ++ + + 7 \n\ + +@@ -167,7 +167,7 @@ + + 12 \n\ + \n\ +- ++ + print + + ( +Index: docutils/test/test_parsers/test_rst/test_directives/test_code_long.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (revision 8495) +@@ -24,7 +24,7 @@ + + totest['code-parsing-long'] = [ + ["""\ +-.. code:: python ++.. code:: python3 + :number-lines: 7 + + def my_function(): +@@ -36,7 +36,7 @@ + """, + """\ + +- ++ + + 7 \n\ + +@@ -69,7 +69,7 @@ + + 12 \n\ + \n\ +- ++ + print + + ( +Index: docutils/test/test_parsers/test_rst/test_interpreted.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_interpreted.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_interpreted.py (revision 8495) +@@ -271,7 +271,7 @@ + Custom role based on code role: + + .. role:: python(code) +- :language: python ++ :language: python3 + :class: testclass + + Python code :python:`print("The end")`. +@@ -282,8 +282,8 @@ + Custom role based on code role: + + Python code \n\ +- +- ++ ++ + print + + ( diff --git a/python-docutils.changes b/python-docutils.changes index 2fc855f..fe9a81c 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Mar 14 09:56:02 UTC 2020 - Tomáš Chvátal + +- Add patch to fix build with pygments 2.4 and newer: + * pygments25.patch + ------------------------------------------------------------------- Wed Jan 15 10:56:28 UTC 2020 - Tomáš Chvátal diff --git a/python-docutils.spec b/python-docutils.spec index ef45f08..2daebae 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -30,10 +30,10 @@ Version: 0.16 Release: 0 Summary: Python Documentation Utilities License: Python-2.0 AND BSD-2-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND SUSE-Public-Domain -Group: Development/Languages/Python URL: https://pypi.python.org/pypi/docutils/ Source: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz Source99: python-docutils-rpmlintrc +Patch0: pygments25.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml} BuildRequires: fdupes @@ -63,6 +63,7 @@ easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. %prep %setup -q -n docutils-%{version} +%patch0 -p1 # 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 From 168f5a41a2f29b40160a922c03e1ce1750970158a3f24c493001d16ceca21a29 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 6 Apr 2020 15:57:55 +0000 Subject: [PATCH 2/3] - Remove %python3_only and use full alternatives. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=64 --- python-docutils.changes | 5 ++++ python-docutils.spec | 61 ++++++++++++++--------------------------- 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/python-docutils.changes b/python-docutils.changes index fe9a81c..a3da64a 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 6 15:57:17 UTC 2020 - Matej Cepl + +- Remove %python3_only and use full alternatives. + ------------------------------------------------------------------- Sat Mar 14 09:56:02 UTC 2020 - Tomáš Chvátal diff --git a/python-docutils.spec b/python-docutils.spec index 2daebae..c6b1908 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -80,57 +80,38 @@ sed -i -e "1d" "docutils/writers/xetex/__init__.py" "docutils/writers/_html_base %if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} - -# To avoid conflicts with the rst2html4 package -mv %{buildroot}%{_bindir}/rst2html4 %{buildroot}%{_bindir}/rst2html4-docutils -ln -s -f %{_sysconfdir}/alternatives/rst2html4 %{buildroot}%{_bindir}/rst2html4 - -# To avoid conflicts with the rst2html5 package -mv %{buildroot}%{_bindir}/rst2html5 %{buildroot}%{_bindir}/rst2html5-docutils -ln -s -f %{_sysconfdir}/alternatives/rst2html5 %{buildroot}%{_bindir}/rst2html5 -%endif - -%ifpython3 -%post -update-alternatives --install %{_bindir}/rst2html4 rst2html4 %{_bindir}/rst2html4-docutils 15 -update-alternatives --install %{_bindir}/rst2html5 rst2html5 %{_bindir}/rst2html5-docutils 15 -%endif - -%ifpython3 -%postun -if [ ! -f %{_bindir}/rst2html4-docutils ] ; then - update-alternatives --remove rst2html4 %{_bindir}/rst2html4-docutils -fi -if [ ! -f %{_bindir}/rst2html5-docutils ] ; then - update-alternatives --remove rst2html5 %{_bindir}/rst2html5-docutils -fi +for binary in rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5 ; do + %python_clone -a %{buildroot}%{_bindir}/$binary +done %endif %check %if %{with test} %python_exec test/alltests.py + +%post +%{python_install_alternative rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5} + +%postun +%{python_uninstall_alternative rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5} %endif %if !%{with test} %files %{python_files} %license COPYING.txt licenses/*.txt %doc FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* -%python3_only %{_bindir}/rst2html -%python3_only %{_bindir}/rst2latex -%python3_only %{_bindir}/rst2man -%python3_only %{_bindir}/rst2odt -%python3_only %{_bindir}/rst2odt_prepstyles -%python3_only %{_bindir}/rst2pseudoxml -%python3_only %{_bindir}/rst2s5 -%python3_only %{_bindir}/rst2xetex -%python3_only %{_bindir}/rst2xml -%python3_only %{_bindir}/rstpep2html -%python3_only %{_bindir}/rst2html4 -%python3_only %{_bindir}/rst2html4-docutils -%python3_only %{_bindir}/rst2html5 -%python3_only %{_bindir}/rst2html5-docutils -%python3_only %ghost %{_sysconfdir}/alternatives/rst2html4 -%python3_only %ghost %{_sysconfdir}/alternatives/rst2html5 +%python_alternative %{_bindir}/rst2html +%python_alternative %{_bindir}/rst2latex +%python_alternative %{_bindir}/rst2man +%python_alternative %{_bindir}/rst2odt +%python_alternative %{_bindir}/rst2odt_prepstyles +%python_alternative %{_bindir}/rst2pseudoxml +%python_alternative %{_bindir}/rst2s5 +%python_alternative %{_bindir}/rst2xetex +%python_alternative %{_bindir}/rst2xml +%python_alternative %{_bindir}/rstpep2html +%python_alternative %{_bindir}/rst2html4 +%python_alternative %{_bindir}/rst2html5 %{python_sitelib}/docutils/ %{python_sitelib}/docutils-%{version}-py%{python_version}.egg-info %endif From b130c916590422ee36d74b34ef17be01f7761e5b91669969fc50b98c1ab58171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 7 Apr 2020 09:32:17 +0000 Subject: [PATCH 3/3] - Fix the condition to really generate the direct binaries OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=65 --- python-docutils.changes | 5 +++++ python-docutils.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/python-docutils.changes b/python-docutils.changes index a3da64a..7803bcf 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 7 09:31:55 UTC 2020 - Tomáš Chvátal + +- Fix the condition to really generate the direct binaries + ------------------------------------------------------------------- Mon Apr 6 15:57:17 UTC 2020 - Matej Cepl diff --git a/python-docutils.spec b/python-docutils.spec index c6b1908..67c05c9 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -88,7 +88,9 @@ done %check %if %{with test} %python_exec test/alltests.py +%endif +%if !%{with test} %post %{python_install_alternative rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5}