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
|
|
|
#
|
2017-03-09 12:40:09 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
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
|
|
|
|
2011-09-21 12:04:49 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-10-29 16:35:43 +01:00
|
|
|
|
2017-04-05 07:42:23 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2012-11-20 20:35:54 +01:00
|
|
|
Name: python-docutils
|
2017-03-09 12:40:09 +01:00
|
|
|
Version: 0.13.1
|
2011-09-21 12:04:49 +02:00
|
|
|
Release: 0
|
2012-02-28 09:59:33 +01:00
|
|
|
Summary: Python Documentation Utilities
|
2012-04-30 16:30:08 +02:00
|
|
|
License: Python-2.0 and BSD-2-Clause and GPL-2.0+ and GPL-3.0+ and SUSE-Public-Domain
|
2011-09-21 12:04:49 +02:00
|
|
|
Group: Development/Languages/Python
|
2013-09-24 12:54:44 +02:00
|
|
|
Url: https://pypi.python.org/pypi/docutils/
|
2017-03-09 12:40:09 +01:00
|
|
|
Source: https://pypi.io/packages/source/d/docutils/docutils-%{version}.tar.gz
|
2017-04-05 07:42:23 +02:00
|
|
|
Source99: python-docutils-rpmlintrc
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module nose}
|
|
|
|
BuildRequires: %{python_module xml}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2011-09-21 12:04:49 +02:00
|
|
|
Requires: python-xml
|
2017-04-05 07:42:23 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2011-09-21 12:04:49 +02:00
|
|
|
Provides: docutils = %{version}
|
|
|
|
Obsoletes: docutils < %{version}
|
2012-11-20 20:35:54 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-02-28 09:59:33 +01:00
|
|
|
BuildArch: noarch
|
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
|
2012-11-20 20:35:54 +01:00
|
|
|
%setup -n docutils-%{version}
|
|
|
|
# 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-04-05 07:42:23 +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
|
2017-04-05 07:42:23 +02:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
|
2016-08-15 20:01:59 +02:00
|
|
|
|
2017-04-05 07:42:23 +02:00
|
|
|
for p in rst2html rst2html5 rst2latex rst2man rst2odt rst2odt_prepstyles \
|
|
|
|
rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html ; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$p
|
2013-09-17 13:59:09 +02:00
|
|
|
done
|
2012-11-20 20:35:54 +01:00
|
|
|
|
|
|
|
%check
|
2017-04-05 07:42:23 +02:00
|
|
|
%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"]))'
|
2011-09-21 12:04:49 +02:00
|
|
|
|
2013-09-17 13:59:09 +02:00
|
|
|
%post
|
2017-04-05 07:42:23 +02:00
|
|
|
%{python_install_alternative rst2html rst2html5 rst2latex rst2man rst2odt rst2odt_prepstyles
|
|
|
|
rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html}
|
2013-09-17 13:59:09 +02:00
|
|
|
|
2017-04-05 07:42:23 +02:00
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative rst2html
|
2013-09-17 13:59:09 +02:00
|
|
|
|
2017-04-05 07:42:23 +02:00
|
|
|
%files %{python_files}
|
2011-09-21 12:04:49 +02:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* licenses
|
2017-04-05 07:42:23 +02:00
|
|
|
%python_alternative %{_bindir}/rst2html
|
|
|
|
%python_alternative %{_bindir}/rst2html5
|
|
|
|
%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
|
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
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%changelog
|