b92d893
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
b92d893
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
b92d893
%endif
b92d893
b92d893
%global upstream_name Sphinx
b92d893
b92d893
Name:       python-sphinx
f1b1a64
Version:    0.6.6
f1b1a64
Release:    1%{?dist}
b92d893
Summary:    Python documentation generator
b92d893
b92d893
Group:      Development/Tools
b92d893
License:    BSD
b92d893
URL:        http://sphinx.pocoo.org/
b92d893
Source0:    http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
b92d893
b92d893
BuildRoot:     %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
b92d893
BuildArch:     noarch
b92d893
BuildRequires: python2-devel >= 2.4
b92d893
BuildRequires: python-setuptools
b92d893
BuildRequires: python-docutils
b92d893
BuildRequires: python-jinja2
b92d893
BuildRequires: python-nose
b92d893
Requires:      python-docutils
b92d893
Requires:      python-jinja2
b92d893
Requires:      python-pygments
6e4984e
6e4984e
6e4984e
%description
6e4984e
Sphinx is a tool that makes it easy to create intelligent and
6e4984e
beautiful documentation for Python projects (or other documents
6e4984e
consisting of multiple reStructuredText sources), written by Georg
6e4984e
Brandl. It was originally created to translate the new Python
6e4984e
documentation, but has now been cleaned up in the hope that it will be
6e4984e
useful to many other projects.
6e4984e
6e4984e
Sphinx uses reStructuredText as its markup language, and many of its
6e4984e
strengths come from the power and straightforwardness of
6e4984e
reStructuredText and its parsing and translating suite, the Docutils.
6e4984e
6e4984e
Although it is still under constant development, the following
6e4984e
features are already present, work fine and can be seen "in action" in
6e4984e
the Python docs:
6e4984e
6e4984e
    * Output formats: HTML (including Windows HTML Help) and LaTeX,
6e4984e
      for printable PDF versions
6e4984e
    * Extensive cross-references: semantic markup and automatic links
6e4984e
      for functions, classes, glossary terms and similar pieces of
6e4984e
      information
6e4984e
    * Hierarchical structure: easy definition of a document tree, with
6e4984e
      automatic links to siblings, parents and children
6e4984e
    * Automatic indices: general index as well as a module index
6e4984e
    * Code handling: automatic highlighting using the Pygments highlighter
6e4984e
    * Various extensions are available, e.g. for automatic testing of
6e4984e
      snippets and inclusion of appropriately formatted docstrings.
6e4984e
6e4984e
b92d893
%package doc
b92d893
Summary:    Documentation for %{name}
b92d893
Group:      Documentation
b92d893
License:    BSD
b92d893
Requires:   %{name} = %{version}-%{release}
6e4984e
6e4984e
b92d893
%description doc
6e4984e
Sphinx is a tool that makes it easy to create intelligent and
6e4984e
beautiful documentation for Python projects (or other documents
6e4984e
consisting of multiple reStructuredText sources), written by Georg
6e4984e
Brandl. It was originally created to translate the new Python
6e4984e
documentation, but has now been cleaned up in the hope that it will be
6e4984e
useful to many other projects.
6e4984e
b92d893
This package contains documentation in reST and HTML formats.
6e4984e
6e4984e
6e4984e
%prep
6e4984e
%setup -q -n %{upstream_name}-%{version}
b92d893
sed '1d' -i sphinx/pycode/pgen2/token.py
6e4984e
6e4984e
%build
6e4984e
%{__python} setup.py build
b92d893
pushd doc
6e4984e
make html
b92d893
rm -rf _build/html/.buildinfo
6e4984e
mv _build/html ..
6e4984e
rm -rf _*
b92d893
popd
6e4984e
6e4984e
6e4984e
%install
b92d893
rm -rf %{buildroot}
b92d893
b92d893
%{__python} setup.py install --skip-build --root %{buildroot}
b92d893
b92d893
b92d893
pushd doc
b92d893
# Deliver man pages
b92d893
install -d %{buildroot}%{_mandir}/man1
b92d893
mv sphinx-*.1 %{buildroot}%{_mandir}/man1/
b92d893
popd
6e4984e
b92d893
# Deliver rst files
b92d893
mv doc reST
b92d893
b92d893
# Move language files to /usr/share in association with %patch1
b92d893
pushd %{buildroot}%{python_sitelib}
b92d893
b92d893
for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -printf "%f "`;
b92d893
do
b92d893
  install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
b92d893
  install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
b92d893
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
b92d893
     %{buildroot}%{_datadir}/sphinx/locale/$lang/
b92d893
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.mo \
b92d893
    %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
b92d893
  rm -rf sphinx/locale/$lang
b92d893
done
b92d893
popd
b92d893
%find_lang sphinx
b92d893
b92d893
# Language files; Since these are javascript, it's not immediately obvious to
b92d893
# find_lang that they need to be marked with a language.
b92d893
(cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
b92d893
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
b92d893
  >> sphinx.lang
7382e0c
6e4984e
6e4984e
%clean
b92d893
rm -rf %{buildroot}
6e4984e
6e4984e
b92d893
%check
b92d893
make test
b92d893
b92d893
b92d893
%files -f sphinx.lang
6e4984e
%defattr(-,root,root,-)
b92d893
%doc AUTHORS CHANGES EXAMPLES LICENSE README TODO
6e4984e
%{_bindir}/sphinx-*
b92d893
%{python_sitelib}/*
b92d893
%{_datadir}/sphinx/
b92d893
%exclude %{_datadir}/sphinx/locale/*/sphinx.js
b92d893
%{_mandir}/man1/*
6e4984e
6e4984e
%files doc
6e4984e
%defattr(-,root,root,-)
b92d893
%doc html reST
6e4984e
6e4984e
6e4984e
%changelog
f1b1a64
* Tue May 25 2010 Michel Salim <salimma@fedoraproject.org> - 0.6.6-1
f1b1a64
- Update to 0.6.6
f1b1a64
b92d893
* Fri May 21 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.5-2
b92d893
- Few minor tweaks to Gareth's spec file update
b92d893
b92d893
* Mon May 10 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 0.6.5-1.hp
b92d893
- Update to 0.6.5
b92d893
- Initial import of python-sphinx from Fedora Rawhide for use in HP CMS
b92d893
- Enforce that Sphinx requires Python 2.4 or later via an explicit BR
b92d893
- Minor tweaks to spec file
b92d893
- Move language files to %%{_datadir}, idea borrowed from Debian's sphinx
b92d893
  package
b92d893
- Deliver man pages for sphinx-build & sphinx-quickstart
b92d893
- Deliver rst documentation files to reST directory in doc sub-package
b92d893
- Add %%check section for Python2 and add BR on python-nose
b92d893
d78b82c
* Wed Jan 13 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
d78b82c
- Update to 0.6.4
d78b82c
- Fixes a problem using autodoc with pylons projects.
d78b82c
80ae6c2
* Fri Sep  4 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.3-1
80ae6c2
- Update to 0.6.3
80ae6c2
1945206
* Mon Aug 17 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.2-1
1945206
- Update to 0.6.2 -- upstream bugfix requested inside bz#512438
1945206
e2484de
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
e2484de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e2484de
3107038
* Fri Jun 05 2009 Luke Macken <lmacken@redhat.com> - 0.6.1-2
3107038
- Add a patch to use our own setuptools package
3107038
746537f
* Fri Apr 17 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1-1
746537f
- Update to 0.6.1
746537f
0852abb
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
0852abb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
0852abb
807d85b
* Fri Jan  2 2009 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
807d85b
- Update to 0.5.1
807d85b
29e36a1
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
29e36a1
- Rebuild for Python 2.6
29e36a1
7382e0c
* Mon Nov 24 2008 Michel Salim <salimma@fedoraproject.org> - 0.5-1
7382e0c
- Update to 0.5
7382e0c
35a7eb1
* Fri Oct 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.3-1
35a7eb1
- Update to 0.4.3
35a7eb1
bf53c8f
* Wed Aug 27 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1.1
bf53c8f
- Fix for EL-5 build.
bf53c8f
39a4bdc
* Mon Aug 25 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.2-1
39a4bdc
- Update to 0.4.2
39a4bdc
6e4984e
* Mon May 26 2008 Michel Salim <salimma@fedoraproject.org> - 0.3-1
6e4984e
- Update to 0.3
6e4984e
6e4984e
* Fri May  2 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.61950-3
6e4984e
- Split documentation into subpackage
6e4984e
- Exclude C files (not built by default anyway)
6e4984e
6e4984e
* Wed Apr 16 2008 José Matos <jamatos@fc.up.pt> - 0.1.61950-2
6e4984e
- Build html documentation, include it and include the rst
6e4984e
  documentation.
6e4984e
6e4984e
* Thu Mar 27 2008 Michel Salim <michel.sylvan@gmail.com> 0.1.61950-1
6e4984e
- Initial package