12818e8
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
12818e8
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
12818e8
12818e8
%define upstream_name Sphinx
12818e8
12818e8
Name:           python-sphinx
81a7a27
Version:        0.5.1
d7d8397
Release:        1%{?dist}
12818e8
Summary:        Python documentation generator
12818e8
12818e8
Group:          Development/Tools
12818e8
License:        BSD
12818e8
URL:            http://sphinx.pocoo.org/
12818e8
Source0:        http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
12818e8
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
12818e8
12818e8
BuildArch:      noarch
12818e8
BuildRequires:  python-devel python-docutils python-jinja python-setuptools
12818e8
Requires:       python-docutils python-jinja python-pygments
12818e8
12818e8
12818e8
%description
12818e8
Sphinx is a tool that makes it easy to create intelligent and
12818e8
beautiful documentation for Python projects (or other documents
12818e8
consisting of multiple reStructuredText sources), written by Georg
12818e8
Brandl. It was originally created to translate the new Python
12818e8
documentation, but has now been cleaned up in the hope that it will be
12818e8
useful to many other projects.
12818e8
12818e8
Sphinx uses reStructuredText as its markup language, and many of its
12818e8
strengths come from the power and straightforwardness of
12818e8
reStructuredText and its parsing and translating suite, the Docutils.
12818e8
12818e8
Although it is still under constant development, the following
12818e8
features are already present, work fine and can be seen "in action" in
12818e8
the Python docs:
12818e8
12818e8
    * Output formats: HTML (including Windows HTML Help) and LaTeX,
12818e8
      for printable PDF versions
12818e8
    * Extensive cross-references: semantic markup and automatic links
12818e8
      for functions, classes, glossary terms and similar pieces of
12818e8
      information
12818e8
    * Hierarchical structure: easy definition of a document tree, with
12818e8
      automatic links to siblings, parents and children
12818e8
    * Automatic indices: general index as well as a module index
12818e8
    * Code handling: automatic highlighting using the Pygments highlighter
12818e8
    * Various extensions are available, e.g. for automatic testing of
12818e8
      snippets and inclusion of appropriately formatted docstrings.
12818e8
12818e8
12818e8
%package       doc
63cb852
Summary:       Documentation for %{name}
12818e8
Group:         Documentation
12818e8
License:       BSD
12818e8
Requires:      %{name} = %{version}-%{release}
12818e8
12818e8
12818e8
%description   doc
12818e8
Sphinx is a tool that makes it easy to create intelligent and
12818e8
beautiful documentation for Python projects (or other documents
12818e8
consisting of multiple reStructuredText sources), written by Georg
12818e8
Brandl. It was originally created to translate the new Python
12818e8
documentation, but has now been cleaned up in the hope that it will be
12818e8
useful to many other projects.
12818e8
12818e8
This package contains documentation in rST and HTML formats
12818e8
12818e8
12818e8
%prep
12818e8
%setup -q -n %{upstream_name}-%{version}
12818e8
12818e8
12818e8
%build
12818e8
%{__python} setup.py build
12818e8
cd doc
12818e8
make html
12818e8
mv _build/html ..
12818e8
rm -rf _*
12818e8
12818e8
12818e8
%install
12818e8
rm -rf $RPM_BUILD_ROOT
12818e8
# Fix EOL delimiters
12818e8
sed -i 's|\r||g' LICENSE
12818e8
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
12818e8
81a7a27
# Language files; not under /usr/share, need to be handled manually
81a7a27
(cd $RPM_BUILD_ROOT && find . -name 'sphinx.mo') | sed -e 's|^.||' | sed -e \
81a7a27
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
81a7a27
  >> %{name}.lang
81a7a27
12818e8
12818e8
%clean
12818e8
rm -rf $RPM_BUILD_ROOT
12818e8
12818e8
81a7a27
%files -f %{name}.lang
12818e8
%defattr(-,root,root,-)
12818e8
%doc AUTHORS CHANGES LICENSE README TODO
12818e8
%{_bindir}/sphinx-*
12818e8
%{python_sitelib}/sphinx
12818e8
%{python_sitelib}/*.egg-info
12818e8
12818e8
%files doc
12818e8
%defattr(-,root,root,-)
12818e8
%doc doc html
12818e8
12818e8
12818e8
%changelog
81a7a27
* Fri Jan  2 2009 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
81a7a27
- Update to 0.5.1
81a7a27
81a7a27
* Mon Nov 24 2008 Michel Salim <salimma@fedoraproject.org> - 0.5-1
81a7a27
- Update to 0.5
81a7a27
d7d8397
* Fri Oct 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.3-1
d7d8397
- Update to 0.4.3
d7d8397
4c83e0b
* Wed Aug 27 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1.1
4c83e0b
- Fix for EL-5 build.
4c83e0b
63cb852
* Mon Aug 25 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.2-1
63cb852
- Update to 0.4.2
63cb852
12818e8
* Mon May 26 2008 Michel Salim <salimma@fedoraproject.org> - 0.3-1
12818e8
- Update to 0.3
12818e8
12818e8
* Fri May  2 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.61950-3
12818e8
- Split documentation into subpackage
12818e8
- Exclude C files (not built by default anyway)
12818e8
12818e8
* Wed Apr 16 2008 José Matos <jamatos@fc.up.pt> - 0.1.61950-2
12818e8
- Build html documentation, include it and include the rst
12818e8
  documentation.
12818e8
12818e8
* Thu Mar 27 2008 Michel Salim <michel.sylvan@gmail.com> 0.1.61950-1
12818e8
- Initial package