6e4984e
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
6e4984e
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
6e4984e
6e4984e
%define upstream_name Sphinx
6e4984e
6e4984e
Name:           python-sphinx
24df39f
Version:        0.6.3
8353038
Release:        1%{?dist}
6e4984e
Summary:        Python documentation generator
6e4984e
6e4984e
Group:          Development/Tools
6e4984e
License:        BSD
6e4984e
URL:            http://sphinx.pocoo.org/
6e4984e
Source0:        http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
8353038
Patch0:         %{name}-setuptools.patch
6e4984e
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
6e4984e
6e4984e
BuildArch:      noarch
8353038
BuildRequires:  python-devel python-docutils python-jinja2 python-setuptools
8353038
Requires:       python-docutils python-jinja2 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
6e4984e
%package       doc
d8df43c
Summary:       Documentation for %{name}
6e4984e
Group:         Documentation
6e4984e
License:       BSD
6e4984e
Requires:      %{name} = %{version}-%{release}
6e4984e
6e4984e
6e4984e
%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
6e4984e
This package contains documentation in rST and HTML formats
6e4984e
6e4984e
6e4984e
%prep
6e4984e
%setup -q -n %{upstream_name}-%{version}
8353038
%patch0 -p0 -b .setuptools
6e4984e
6e4984e
6e4984e
%build
6e4984e
%{__python} setup.py build
6e4984e
cd doc
6e4984e
make html
6e4984e
mv _build/html ..
6e4984e
rm -rf _*
6e4984e
6e4984e
6e4984e
%install
6e4984e
rm -rf $RPM_BUILD_ROOT
6e4984e
# Fix EOL delimiters
6e4984e
sed -i 's|\r||g' LICENSE
6e4984e
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
6e4984e
7382e0c
# Language files; not under /usr/share, need to be handled manually
7382e0c
(cd $RPM_BUILD_ROOT && find . -name 'sphinx.mo') | sed -e 's|^.||' | sed -e \
7382e0c
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
7382e0c
  >> %{name}.lang
7382e0c
6e4984e
6e4984e
%clean
6e4984e
rm -rf $RPM_BUILD_ROOT
6e4984e
6e4984e
7382e0c
%files -f %{name}.lang
6e4984e
%defattr(-,root,root,-)
6e4984e
%doc AUTHORS CHANGES LICENSE README TODO
6e4984e
%{_bindir}/sphinx-*
6e4984e
%{python_sitelib}/sphinx
6e4984e
%{python_sitelib}/*.egg-info
6e4984e
6e4984e
%files doc
6e4984e
%defattr(-,root,root,-)
6e4984e
%doc doc html
6e4984e
6e4984e
6e4984e
%changelog
24df39f
* Fri Sep  4 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.3-1
24df39f
- Update to 0.6.3
24df39f
8353038
* Mon Aug 17 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.2-1
8353038
- Update to 0.6.2 -- upstream bugfix requested inside bz#512438
8353038
8353038
* Fri Jun 05 2009 Luke Macken <lmacken@redhat.com> - 0.6.1-2
8353038
- Add a patch to use our own setuptools package
8353038
8353038
* Fri Apr 17 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1-1
8353038
- Update to 0.6.1
8353038
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