2011-09-21 12:04:49 +02:00
|
|
|
#
|
2011-09-23 12:27:18 +02:00
|
|
|
# spec file for package python-docutils
|
2011-09-21 12:04:49 +02:00
|
|
|
#
|
2020-01-15 12:05:21 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2011-09-21 12:04:49 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2012-04-24 11:02:56 +02:00
|
|
|
|
2018-12-04 14:24:21 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-09-21 12:04:49 +02:00
|
|
|
#
|
|
|
|
|
2012-10-29 16:35:43 +01:00
|
|
|
|
2019-05-14 01:49:22 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2017-04-05 07:42:23 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-05-14 01:49:22 +02:00
|
|
|
Name: python-docutils%{psuffix}
|
2020-01-15 12:05:21 +01:00
|
|
|
Version: 0.16
|
2011-09-21 12:04:49 +02:00
|
|
|
Release: 0
|
2012-02-28 09:59:33 +01:00
|
|
|
Summary: Python Documentation Utilities
|
2018-12-04 14:24:21 +01:00
|
|
|
License: Python-2.0 AND BSD-2-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND SUSE-Public-Domain
|
2019-05-08 12:06:25 +02:00
|
|
|
URL: https://pypi.python.org/pypi/docutils/
|
2017-04-20 18:17:49 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz
|
2017-04-05 07:42:23 +02:00
|
|
|
Source99: python-docutils-rpmlintrc
|
2020-03-14 10:57:12 +01:00
|
|
|
Patch0: pygments25.patch
|
2019-08-12 16:22:49 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2017-04-05 07:42:23 +02:00
|
|
|
BuildRequires: %{python_module xml}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2011-09-21 12:04:49 +02:00
|
|
|
Requires: python-xml
|
2017-06-08 12:30:51 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2019-05-08 12:06:25 +02:00
|
|
|
Recommends: python-Pillow
|
|
|
|
Recommends: python-Pygments
|
|
|
|
Recommends: python-roman
|
2017-06-08 12:30:51 +02:00
|
|
|
BuildArch: noarch
|
2019-08-12 16:27:55 +02:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module Pillow}
|
|
|
|
BuildRequires: %{python_module Pygments}
|
|
|
|
BuildRequires: %{python_module roman}
|
|
|
|
%endif
|
2017-06-08 12:30:51 +02:00
|
|
|
%ifpython3
|
2011-09-21 12:04:49 +02:00
|
|
|
Provides: docutils = %{version}
|
|
|
|
Obsoletes: docutils < %{version}
|
2017-05-01 21:36:39 +02:00
|
|
|
%endif
|
2017-04-05 07:42:23 +02:00
|
|
|
%python_subpackages
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Docutils is a modular system for processing documentation into useful formats,
|
|
|
|
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
|
2017-06-08 12:30:51 +02:00
|
|
|
%setup -q -n docutils-%{version}
|
2020-03-14 10:57:12 +01:00
|
|
|
%patch0 -p1
|
2012-11-20 20:35:54 +01:00
|
|
|
# Remove useless ".py" ending from executables:
|
2017-04-05 07:42:23 +02:00
|
|
|
for i in tools/rst*; do mv "$i" "${i/.py}"; done
|
|
|
|
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py
|
2013-09-24 12:54:44 +02:00
|
|
|
# Remove shebang from non-executable files
|
2017-06-08 12:30:51 +02:00
|
|
|
for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html','math/tex2mathml_extern'}; do
|
2013-09-24 12:54:44 +02:00
|
|
|
sed -i -e "1d" "docutils/utils/$i.py"
|
|
|
|
done
|
2017-04-05 07:42:23 +02:00
|
|
|
sed -i -e "1d" "docutils/writers/xetex/__init__.py" "docutils/writers/_html_base.py"
|
2013-09-24 12:54:44 +02:00
|
|
|
|
2011-09-21 12:04:49 +02:00
|
|
|
%build
|
2017-04-05 07:42:23 +02:00
|
|
|
%python_build
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%install
|
2019-05-14 01:49:22 +02:00
|
|
|
%if !%{with test}
|
2017-04-05 07:42:23 +02:00
|
|
|
%python_install
|
2019-08-12 16:27:55 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2020-04-06 17:57:55 +02:00
|
|
|
for binary in rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5 ; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$binary
|
|
|
|
done
|
2017-06-08 12:30:51 +02:00
|
|
|
%endif
|
2017-04-20 18:17:49 +02:00
|
|
|
|
|
|
|
%check
|
2019-05-14 01:49:22 +02:00
|
|
|
%if %{with test}
|
2020-01-15 12:05:21 +01:00
|
|
|
%python_exec test/alltests.py
|
2020-04-07 11:32:17 +02:00
|
|
|
%endif
|
2020-04-06 17:57:55 +02:00
|
|
|
|
2020-04-07 11:32:17 +02:00
|
|
|
%if !%{with test}
|
2020-04-06 17:57:55 +02:00
|
|
|
%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}
|
2019-05-14 01:49:22 +02:00
|
|
|
%endif
|
2013-09-17 13:59:09 +02:00
|
|
|
|
2019-05-14 01:49:22 +02:00
|
|
|
%if !%{with test}
|
2017-04-05 07:42:23 +02:00
|
|
|
%files %{python_files}
|
2019-05-08 12:06:25 +02:00
|
|
|
%license COPYING.txt licenses/*.txt
|
|
|
|
%doc FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/*
|
2020-04-06 17:57:55 +02:00
|
|
|
%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
|
2012-11-20 20:35:54 +01:00
|
|
|
%{python_sitelib}/docutils/
|
2017-04-05 07:42:23 +02:00
|
|
|
%{python_sitelib}/docutils-%{version}-py%{python_version}.egg-info
|
2019-05-14 01:49:22 +02:00
|
|
|
%endif
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%changelog
|