File python3-Sphinx.spec of Package python-Sphinx
#
# spec file for package python3-Sphinx
#
# 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-Sphinx
Version: 1.1.3
Release: 0
Url: http://sphinx.pocoo.org
Summary: Python documentation generator
License: BSD-2-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
Patch0: python3-Sphinx-docs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python3-Jinja2
BuildRequires: python3-devel
BuildRequires: python3-2to3
BuildRequires: python3-distribute
BuildRequires: python3-docutils
Requires: python3-Jinja2
Requires: python3-Pygments
Requires: python3-distribute
Requires: python3-docutils
%if 0%{?suse_version}
Suggests: python3-rst2pdf
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
%endif
%if 0%{?suse_version} && 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)}
%endif
Requires: python(abi) = %{py3_ver}
%if 0%{?suse_version} && 0%{?suse_version} > 1140
BuildRequires: python3-base
%endif
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
%description
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
reStructuredText sources), written by Georg Brandl. It was originally created
for the new Python documentation, and has excellent facilities for Python
project documentation, but C/C++ is supported as well, and more languages are
planned.
Sphinx uses reStructuredText as its markup language, and many of its strengths
come from the power and straightforwardness of reStructuredText and its parsing
and translating suite, the Docutils.
%package doc
Summary: Documentation for %{name}
Group: Documentation/Other
Requires: %{name} = %{version}
%description doc
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
reStructuredText sources), written by Georg Brandl. It was originally created
for the new Python documentation, and has excellent facilities for Python
project documentation, but C/C++ is supported as well, and more languages are
planned.
Sphinx uses reStructuredText as its markup language, and many of its strengths
come from the power and straightforwardness of reStructuredText and its parsing
and translating suite, the Docutils.
%prep
%setup -q -n Sphinx-%{version}
%patch0
sed -i '1d' sphinx/pycode/pgen2/token.py # Remove she-bang line
%build
2to3 . -w --nobackups
python3 setup.py build
sed -i 's/python/python3/g' doc/Makefile
cd doc && make html
rm _build/html/.buildinfo
mv _build/html ..
rm -rf _*
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
for i in %{buildroot}%{_bindir}/*; do
mv "$i" "${i}-python%{py3_ver}"
done
%if 0%{?suse_version} > 1010
%fdupes %{buildroot}%{_prefix}
%endif
%find_lang sphinx
%files -f sphinx.lang
%defattr(-,root,root,-)
%doc AUTHORS CHANGES LICENSE README TODO
%{_bindir}/sphinx-*-python%{py3_ver}
%{python3_sitelib}/sphinx/
%{python3_sitelib}/Sphinx-%{version}-py%{py3_ver}.egg-info
%files doc
%defattr(-,root,root,-)
%doc EXAMPLES html
%changelog