# # spec file for package python3-docutils # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # 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. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: python3-docutils Version: 0.8.1 Release: 0 License: public domain, Python, BSD-2-Clause, GPL (see COPYING.txt) Summary: Python Documentation Utilities Url: http://docutils.sourceforge.net/ Group: Development/Languages/Python Source: http://downloads.sourceforge.net/project/docutils/docutils/0.8.1/docutils-0.8.1.tar.gz BuildRequires: python3 BuildRequires: python3-2to3 BuildRequires: python3-devel BuildRequires: python3-xml BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: python3-xml %if 0%{?suse_version} <= 1140 %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)} %ifarch x86_64 # to allow ownership of noarch python directories BuildRequires: python3-32bit %endif %endif BuildArch: noarch Requires: python3 >= %{py3_ver} %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 %setup -n docutils-%{version} %build python3 setup.py build sed -i "s|#!\s*\/usr\/bin\/env python3||g" docutils/{math/math2html,_string_template_compat,error_reporting,writers/xetex/__init__,math/latex2mathml}.py # Fix non-executable scripts %install python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} for i in %{buildroot}%{_bindir}/rst*; do mv "$i" "${i/.py}-python%{py3_ver}"; done # Remove useless ".py" ending from executables and add -python3.x suffix %files %defattr(-,root,root,-) %doc COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* licenses %{_bindir}/rst*-python%{py3_ver} %{python3_sitelib}/* %if 0%{?suse_version} <= 1140 %dir %{python3_sitelib} %endif %changelog