File python-sphinx.spec of Package python-sphinx

#
# spec file for package python-sphinx (Version 1.0.6)
#
# Copyright (c) 2011 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/
#

# norootforbuild

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define mod_name sphinx

Name:           python-%{mod_name}
Version:        1.0.6
Release:        1
Url:            http://sphinx.pocoo.org/
Summary:        Python documentation generator
License:        BSD
Group:          Development/Languages/Python
Source:         Sphinx-%{version}.tar.bz2
Source1:        python-%{mod_name}-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  docutils
BuildRequires:  python-jinja2
BuildRequires:  python-setuptools
Requires:       docutils
Requires:       python-jinja2
Requires:       python-pygments
%if 0%{?suse_version}
Suggests:       python-rst2pdf
%py_requires
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArch:      noarch
%endif
%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.


Authors:
--------
    Georg Brandl <georg@python.org>

%package        doc
Summary:        Documentation for %{name}
Group:          Documentation/Other
License:        BSD
Requires:       %{name} = %{version}-%{release}

%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.

This package contains documentation in rST and HTML formats.


Authors:
--------
    Georg Brandl <georg@python.org>

%prep
%setup -n Sphinx-%{version}

%build
export CFLAGS="%{optflags}"
python setup.py build
cd doc
make html
rm _build/html/.buildinfo
mv _build/html ..
rm -rf _*

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?suse_version: --record-rpm=INSTALLED_FILES}

%clean
rm -rf %{buildroot}

%files %{?suse_version: -f INSTALLED_FILES}
%defattr(-,root,root,-)
%doc AUTHORS CHANGES LICENSE README TODO
%if 0%{!?suse_version:1}
%{_bindir}/%{mod_name}*
%python_sitelib/Sphinx*
%python_sitelib/%{mod_name}*
%endif

%files doc
%defattr(-,root,root,-)
%doc EXAMPLES html

%changelog