f1b9da
%if 0%{?fedora}
f1b9da
%global with_python3 1
f1b9da
%{!?python3_version: %global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")}
f1b9da
%else
f1b9da
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
f1b9da
%endif
f1b9da
f1b9da
%global upstream_name Sphinx
f1b9da
f1b9da
Name:       python-sphinx
f1b9da
Version:    1.1.3
2e7a4a
Release:    11%{?dist}
f1b9da
Summary:    Python documentation generator
f1b9da
f1b9da
Group:      Development/Tools
f1b9da
f1b9da
# Unless otherwise noted, the license for code is BSD
f1b9da
# sphinx/util/stemmer.py Public Domain
f1b9da
# sphinx/pycode/pgen2 Python
f1b9da
# jquery (MIT or GPLv2)
f1b9da
License:    BSD and Public Domain and Python and (MIT or GPLv2)
f1b9da
URL:        http://sphinx.pocoo.org/
f1b9da
Source0:    http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
2e7a4a
f1b9da
# Sent upstream as a fix to work with the next version of docutils
f1b9da
# https://bitbucket.org/birkenfeld/sphinx/issue/998/docutils-010-will-break-sphinx-manpage
f1b9da
Patch0: sphinx-docutils-0.10.patch
2e7a4a
f1b9da
# Fixes quoting issue in inheritance_diagram.py
f1b9da
# Already applied upstream as part of https://bitbucket.org/birkenfeld/sphinx/commits/fc1db93d21a5a535d9d62e5a0c9f0a806a8c117a
f1b9da
Patch1: Sphinx-1.1.3-fix_quoting_in_inheritance.patch
f1b9da
4600bb
Patch2: fix-container-directive-handling.patch
4600bb
2e7a4a
# Enables rebuilding of docs when RHEL is set to FIPS mode.
2e7a4a
# https://bugzilla.redhat.com/show_bug.cgi?id=966954
2e7a4a
Patch3: enable-rebuilding-docs-in-FIPS-mode.patch
2e7a4a
2e7a4a
# Add missing "meta" and "inline" node visitors for the manpage writer
2e7a4a
# which fixes some exception errors when building docs.
2e7a4a
# https://github.com/sphinx-doc/sphinx/commit/0ef7a0a7a36b0c653e535bca77c08027f1a720a8
2e7a4a
# https://bugzilla.redhat.com/show_bug.cgi?id=1291573
2e7a4a
Patch4: inline-node-error-fix.patch
2e7a4a
f1b9da
BuildArch:     noarch
f1b9da
BuildRequires: python2-devel >= 2.4
f1b9da
BuildRequires: python-setuptools
f1b9da
BuildRequires: python-docutils
f1b9da
BuildRequires: python-jinja2
f1b9da
BuildRequires: python-nose
f1b9da
# Test dependencies
f1b9da
BuildRequires: texlive-latex
f1b9da
f1b9da
%if 0%{?with_python3}
f1b9da
BuildRequires: python3-devel
f1b9da
BuildRequires: python3-setuptools
f1b9da
BuildRequires: python3-docutils
f1b9da
BuildRequires: python3-jinja2
f1b9da
BuildRequires: python3-pygments
f1b9da
BuildRequires: python3-nose
f1b9da
%endif # with_python3
f1b9da
f1b9da
Requires:      python-docutils
f1b9da
Requires:      python-jinja2
f1b9da
Requires:      python-pygments
f1b9da
f1b9da
%description
f1b9da
Sphinx is a tool that makes it easy to create intelligent and
f1b9da
beautiful documentation for Python projects (or other documents
f1b9da
consisting of multiple reStructuredText sources), written by Georg
f1b9da
Brandl. It was originally created to translate the new Python
f1b9da
documentation, but has now been cleaned up in the hope that it will be
f1b9da
useful to many other projects.
f1b9da
f1b9da
Sphinx uses reStructuredText as its markup language, and many of its
f1b9da
strengths come from the power and straightforwardness of
f1b9da
reStructuredText and its parsing and translating suite, the Docutils.
f1b9da
f1b9da
Although it is still under constant development, the following
f1b9da
features are already present, work fine and can be seen "in action" in
f1b9da
the Python docs:
f1b9da
f1b9da
    * Output formats: HTML (including Windows HTML Help) and LaTeX,
f1b9da
      for printable PDF versions
f1b9da
    * Extensive cross-references: semantic markup and automatic links
f1b9da
      for functions, classes, glossary terms and similar pieces of
f1b9da
      information
f1b9da
    * Hierarchical structure: easy definition of a document tree, with
f1b9da
      automatic links to siblings, parents and children
f1b9da
    * Automatic indices: general index as well as a module index
f1b9da
    * Code handling: automatic highlighting using the Pygments highlighter
f1b9da
    * Various extensions are available, e.g. for automatic testing of
f1b9da
      snippets and inclusion of appropriately formatted docstrings.
f1b9da
f1b9da
f1b9da
%if 0%{?with_python3}
f1b9da
%package -n python3-sphinx
f1b9da
Summary:    Python documentation generator
f1b9da
Group:      Development/Tools
f1b9da
Requires:      python3-docutils
f1b9da
Requires:      python3-jinja2
f1b9da
Requires:      python3-pygments
f1b9da
f1b9da
%description -n python3-sphinx
f1b9da
Sphinx is a tool that makes it easy to create intelligent and
f1b9da
beautiful documentation for Python projects (or other documents
f1b9da
consisting of multiple reStructuredText sources), written by Georg
f1b9da
Brandl. It was originally created to translate the new Python
f1b9da
documentation, but has now been cleaned up in the hope that it will be
f1b9da
useful to many other projects.
f1b9da
f1b9da
Sphinx uses reStructuredText as its markup language, and many of its
f1b9da
strengths come from the power and straightforwardness of
f1b9da
reStructuredText and its parsing and translating suite, the Docutils.
f1b9da
f1b9da
Although it is still under constant development, the following
f1b9da
features are already present, work fine and can be seen "in action" in
f1b9da
the Python docs:
f1b9da
f1b9da
    * Output formats: HTML (including Windows HTML Help) and LaTeX,
f1b9da
      for printable PDF versions
f1b9da
    * Extensive cross-references: semantic markup and automatic links
f1b9da
      for functions, classes, glossary terms and similar pieces of
f1b9da
      information
f1b9da
    * Hierarchical structure: easy definition of a document tree, with
f1b9da
      automatic links to siblings, parents and children
f1b9da
    * Automatic indices: general index as well as a module index
f1b9da
    * Code handling: automatic highlighting using the Pygments highlighter
f1b9da
    * Various extensions are available, e.g. for automatic testing of
f1b9da
      snippets and inclusion of appropriately formatted docstrings.
f1b9da
%endif # with_python3
f1b9da
f1b9da
f1b9da
%package doc
f1b9da
Summary:    Documentation for %{name}
f1b9da
Group:      Documentation
f1b9da
License:    BSD
f1b9da
Requires:   %{name} = %{version}-%{release}
f1b9da
f1b9da
f1b9da
%description doc
f1b9da
Sphinx is a tool that makes it easy to create intelligent and
f1b9da
beautiful documentation for Python projects (or other documents
f1b9da
consisting of multiple reStructuredText sources), written by Georg
f1b9da
Brandl. It was originally created to translate the new Python
f1b9da
documentation, but has now been cleaned up in the hope that it will be
f1b9da
useful to many other projects.
f1b9da
f1b9da
This package contains documentation in reST and HTML formats.
f1b9da
f1b9da
f1b9da
%prep
f1b9da
%setup -q -n %{upstream_name}-%{version}%{?prerel}
f1b9da
sed '1d' -i sphinx/pycode/pgen2/token.py
f1b9da
f1b9da
%patch0 -p1
f1b9da
%patch1 -p1
4600bb
%patch2 -p1
2e7a4a
%patch3 -p1
2e7a4a
%patch4 -p1
f1b9da
f1b9da
%if 0%{?with_python3}
f1b9da
rm -rf %{py3dir}
f1b9da
cp -a . %{py3dir}
f1b9da
%endif # with_python3
f1b9da
f1b9da
f1b9da
%build
f1b9da
%{__python} setup.py build
f1b9da
%if 0%{?with_python3}
f1b9da
pushd %{py3dir}
f1b9da
%{__python3} setup.py build
f1b9da
popd
f1b9da
%endif # with_python3
f1b9da
f1b9da
pushd doc
f1b9da
make html
f1b9da
make man
f1b9da
rm -rf _build/html/.buildinfo
f1b9da
mv _build/html ..
f1b9da
popd
f1b9da
f1b9da
f1b9da
%install
f1b9da
rm -rf %{buildroot}
f1b9da
f1b9da
# Must do the python3 install first because the scripts in /usr/bin are
f1b9da
# overwritten with every setup.py install (and we want the python2 version
f1b9da
# to be the default for now).
f1b9da
%if 0%{?with_python3}
f1b9da
pushd %{py3dir}
f1b9da
%{__python3} setup.py install --skip-build --root %{buildroot}
f1b9da
for f in %{buildroot}%{_bindir}/sphinx-*;
f1b9da
do
f1b9da
    mv $f $f-%{python3_version}
f1b9da
done
f1b9da
popd
f1b9da
%endif # with_python3
f1b9da
f1b9da
%{__python} setup.py install --skip-build --root %{buildroot}
f1b9da
f1b9da
pushd doc
f1b9da
# Deliver man pages
f1b9da
install -d %{buildroot}%{_mandir}/man1
f1b9da
mv _build/man/sphinx-*.1 %{buildroot}%{_mandir}/man1/
f1b9da
%if 0%{?with_python3}
f1b9da
for f in %{buildroot}%{_mandir}/man1/sphinx-*.1;
f1b9da
do
f1b9da
    cp -p $f $(echo $f | sed -e "s|.1$|-%{python3_version}.1|")
f1b9da
done
f1b9da
%endif # with_python3
f1b9da
popd
f1b9da
f1b9da
# Deliver rst files
f1b9da
rm -rf doc/_build
f1b9da
sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-build|' doc/Makefile
f1b9da
mv doc reST
f1b9da
f1b9da
# Move language files to /usr/share;
f1b9da
# patch to support this incorporated in 0.6.6
f1b9da
pushd %{buildroot}%{python_sitelib}
f1b9da
f1b9da
for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -printf "%f "`;
f1b9da
do
f1b9da
  install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
f1b9da
  install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
f1b9da
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
f1b9da
     %{buildroot}%{_datadir}/sphinx/locale/$lang/
f1b9da
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.mo \
f1b9da
    %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
f1b9da
  rm -rf sphinx/locale/$lang
f1b9da
done
f1b9da
popd
f1b9da
%find_lang sphinx
f1b9da
f1b9da
# Language files; Since these are javascript, it's not immediately obvious to
f1b9da
# find_lang that they need to be marked with a language.
f1b9da
(cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
f1b9da
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
f1b9da
  >> sphinx.lang
f1b9da
f1b9da
f1b9da
%check
f1b9da
make test
f1b9da
%if 0%{?with_python3}
f1b9da
pushd %{py3dir}
f1b9da
make test
f1b9da
popd
f1b9da
%endif # with_python3
f1b9da
f1b9da
f1b9da
%files -f sphinx.lang
f1b9da
%defattr(-,root,root,-)
f1b9da
%doc AUTHORS CHANGES EXAMPLES LICENSE README TODO
f1b9da
%exclude %{_bindir}/sphinx-*-%{python3_version}
f1b9da
%{_bindir}/sphinx-*
f1b9da
%{python_sitelib}/*
f1b9da
%dir %{_datadir}/sphinx/
f1b9da
%dir %{_datadir}/sphinx/locale
f1b9da
%dir %{_datadir}/sphinx/locale/*
f1b9da
%exclude %{_mandir}/man1/sphinx-*-%{python3_version}.1*
f1b9da
%{_mandir}/man1/*
f1b9da
f1b9da
%if 0%{?with_python3}
f1b9da
%files -n python3-sphinx
f1b9da
%doc AUTHORS CHANGES EXAMPLES LICENSE README TODO
f1b9da
%{_bindir}/sphinx-*-%{python3_version}
f1b9da
%{python3_sitelib}/*
f1b9da
%dir %{_datadir}/sphinx/
f1b9da
%dir %{_datadir}/sphinx/locale
f1b9da
%dir %{_datadir}/sphinx/locale/*
f1b9da
%{_mandir}/man1/sphinx-*-%{python3_version}.1*
f1b9da
%endif # with_python3
f1b9da
f1b9da
%files doc
f1b9da
%defattr(-,root,root,-)
f1b9da
%doc html reST
f1b9da
f1b9da
f1b9da
%changelog
2e7a4a
* Wed Mar 30 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.1.3-11
2e7a4a
- Added patch to fix inline node exception error when building docs
2e7a4a
Resolves: rhbz#1291573
2e7a4a
2e7a4a
* Thu Mar 10 2016 Tomas Orsava <torsava@redhat.com> - 1.1.3-10
2e7a4a
- Added patch to enable rebuilding docs in FIPS mode
2e7a4a
Resolves: rhbz#966954
2e7a4a
4600bb
* Mon Jun 22 2015 Matej Stuchlik <mstuchli@redhat.com> - 1.1.3-9
4600bb
- Fix "container" directive handling in the text builder
4600bb
Resolves: rhbz#1065137
4600bb
7cca8a
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1.3-8
7cca8a
- Mass rebuild 2013-12-27
7cca8a
f1b9da
* Sat Mar  9 2013 Michel Salim <salimma@fedoraproject.org> - 1.1.3-7
f1b9da
- Fix inheritance_diagram quoting bug, exposed by the newer, stricter dot
f1b9da
f1b9da
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-6
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f1b9da
f1b9da
* Tue Aug 21 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.3-5
f1b9da
- Fix for use of sphinx's manpage writer with docutils-0.10
f1b9da
f1b9da
* Mon Aug  6 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.3-4
f1b9da
- Rebuild for Python 3.3
f1b9da
f1b9da
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 1.1.3-3
f1b9da
- remove rhel logic from with_python3 conditional
f1b9da
f1b9da
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-2
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f1b9da
f1b9da
* Thu Apr  5 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.3-1
f1b9da
- Update to 1.1.3
f1b9da
f1b9da
* Sun Feb  5 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.2-5
f1b9da
- Move python3 runtime dependencies to the right subpackage
f1b9da
- Properly exclude python3 binaries
f1b9da
f1b9da
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-4
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f1b9da
f1b9da
* Sat Dec 17 2011 Michel Salim <salimma@fedoraproject.org> - 1.1.2-3
f1b9da
- BR on texlive-latex for LaTeX tests
f1b9da
f1b9da
* Thu Dec  8 2011 Michel Salim <salimma@fedoraproject.org> - 1.1.2-2
f1b9da
- Enable python3 subpackage
f1b9da
f1b9da
* Mon Nov 28 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.2-1
f1b9da
- Update to upstream 1.1.2
f1b9da
f1b9da
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-2
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f1b9da
f1b9da
* Tue Jan 18 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0.7-1
f1b9da
- Update to upstream 1.0.7
f1b9da
f1b9da
* Mon Jan 17 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0.6-1
f1b9da
- Update to upstream 1.0.6
f1b9da
f1b9da
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-3
f1b9da
- Fix -doc Makefile to allow regeneration of .rst files
f1b9da
f1b9da
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-2
f1b9da
- Actually include *.js locale files
f1b9da
- Generate manpages
f1b9da
f1b9da
* Fri Sep 17 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-1
f1b9da
- Update to 1.0.4
f1b9da
- Remove BuildRoot and %%clean declarations
f1b9da
f1b9da
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.0-0.1.b2.1
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
f1b9da
f1b9da
* Mon May 31 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.2.b2
f1b9da
- Update to 1.0 beta 2
f1b9da
- Fixes problem building html documentation in non-English locales
f1b9da
f1b9da
* Wed May 26 2010 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.b1
f1b9da
- Update to 1.0 beta 1
f1b9da
f1b9da
* Tue May 25 2010 Michel Salim <salimma@fedoraproject.org> - 0.6.6-1
f1b9da
- Update to 0.6.6
f1b9da
f1b9da
* Fri May 21 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.5-2
f1b9da
- Few minor tweaks to Gareth's spec file update
f1b9da
f1b9da
* Mon May 10 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 0.6.5-1.hp
f1b9da
- Update to 0.6.5
f1b9da
- Initial import of python-sphinx from Fedora Rawhide for use in HP CMS
f1b9da
- Enforce that Sphinx requires Python 2.4 or later via an explicit BR
f1b9da
- Minor tweaks to spec file
f1b9da
- Move language files to %%{_datadir}, idea borrowed from Debian's sphinx
f1b9da
  package
f1b9da
- Deliver man pages for sphinx-build & sphinx-quickstart
f1b9da
- Deliver rst documentation files to reST directory in doc sub-package
f1b9da
- Add %%check section for Python2 and add BR on python-nose
f1b9da
f1b9da
* Wed Jan 13 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
f1b9da
- Update to 0.6.4
f1b9da
- Fixes a problem using autodoc with pylons projects.
f1b9da
f1b9da
* Fri Sep  4 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.3-1
f1b9da
- Update to 0.6.3
f1b9da
f1b9da
* Mon Aug 17 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.2-1
f1b9da
- Update to 0.6.2 -- upstream bugfix requested inside bz#512438
f1b9da
f1b9da
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f1b9da
f1b9da
* Fri Jun 05 2009 Luke Macken <lmacken@redhat.com> - 0.6.1-2
f1b9da
- Add a patch to use our own setuptools package
f1b9da
f1b9da
* Fri Apr 17 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1-1
f1b9da
- Update to 0.6.1
f1b9da
f1b9da
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
f1b9da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f1b9da
f1b9da
* Fri Jan  2 2009 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
f1b9da
- Update to 0.5.1
f1b9da
f1b9da
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
f1b9da
- Rebuild for Python 2.6
f1b9da
f1b9da
* Mon Nov 24 2008 Michel Salim <salimma@fedoraproject.org> - 0.5-1
f1b9da
- Update to 0.5
f1b9da
f1b9da
* Fri Oct 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.3-1
f1b9da
- Update to 0.4.3
f1b9da
f1b9da
* Wed Aug 27 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1.1
f1b9da
- Fix for EL-5 build.
f1b9da
f1b9da
* Mon Aug 25 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.2-1
f1b9da
- Update to 0.4.2
f1b9da
f1b9da
* Mon May 26 2008 Michel Salim <salimma@fedoraproject.org> - 0.3-1
f1b9da
- Update to 0.3
f1b9da
f1b9da
* Fri May  2 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.61950-3
f1b9da
- Split documentation into subpackage
f1b9da
- Exclude C files (not built by default anyway)
f1b9da
f1b9da
* Wed Apr 16 2008 José Matos <jamatos@fc.up.pt> - 0.1.61950-2
f1b9da
- Build html documentation, include it and include the rst
f1b9da
  documentation.
f1b9da
f1b9da
* Thu Mar 27 2008 Michel Salim <michel.sylvan@gmail.com> 0.1.61950-1
f1b9da
- Initial package