e7e60eb
%if 0%{?fedora}
e7e60eb
%global check_links 1
e7e60eb
%else
e7e60eb
%global check_links 0
e7e60eb
%endif
e7e60eb
e7e60eb
%{!?__python_ver:%global __python_ver 3}
e7e60eb
e7e60eb
%if "%{__python_ver}" != "EMPTY"
e7e60eb
%global main_python 0
e7e60eb
%global python python%{__python_ver}
e7e60eb
%else
e7e60eb
%global main_python 1
e7e60eb
%global python python
e7e60eb
%endif
e7e60eb
e7e60eb
%define pybasever 3.3
e7e60eb
e7e60eb
Summary: Documentation for the Python 3 programming language
e7e60eb
Name: %{python}-docs
e7e60eb
# The Version needs to be in-sync with the "python" package:
e7e60eb
Version: %{pybasever}.2
e7e60eb
Release: 2%{?dist}
e7e60eb
License: Python
e7e60eb
Group: Documentation
e7e60eb
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
e7e60eb
BuildArch: noarch
e7e60eb
e7e60eb
Patch0: python3-docs-use-local-python3-sphinx.patch
e7e60eb
e7e60eb
Requires: %{python} = %{version}
e7e60eb
e7e60eb
BuildRequires: %{python}
e7e60eb
BuildRequires: %{python}-sphinx
e7e60eb
BuildRequires: %{python}-docutils
e7e60eb
BuildRequires: %{python}-pygments
e7e60eb
e7e60eb
%if %{check_links}
e7e60eb
BuildRequires: linkchecker
e7e60eb
%endif
e7e60eb
e7e60eb
URL: http://www.python.org/
e7e60eb
e7e60eb
%description
e7e60eb
The python3-docs package contains documentation on the Python 3
e7e60eb
programming language and interpreter.
e7e60eb
e7e60eb
Install the python3-docs package if you'd like to use the documentation
e7e60eb
for the Python 3 language.
e7e60eb
e7e60eb
%prep
e7e60eb
%setup -q -n Python-%{version}
e7e60eb
e7e60eb
%patch0 -p1
e7e60eb
e7e60eb
%build
e7e60eb
make -C Doc html
e7e60eb
rm Doc/build/html/.buildinfo
e7e60eb
e7e60eb
%install
e7e60eb
mkdir -p $RPM_BUILD_ROOT
e7e60eb
e7e60eb
%check
e7e60eb
# Verify that all of the local links work (see rhbz#670493 - doesn't apply
e7e60eb
# to python3-docs, but only to older python-docs)
e7e60eb
#
e7e60eb
# (we can't check network links, as we shouldn't be making network connections
e7e60eb
# within a build.  Also, don't bother checking the .txt source files; some
e7e60eb
# contain example URLs, which don't work)
e7e60eb
%if %{check_links}
e7e60eb
linkchecker \
e7e60eb
  --ignore-url=^mailto: --ignore-url=^http --ignore-url=^ftp \
e7e60eb
  --ignore-url=.txt\$ \
e7e60eb
  Doc/build/html/index.html
e7e60eb
%endif
e7e60eb
e7e60eb
%files
e7e60eb
%doc Misc/NEWS Misc/HISTORY Misc/README Doc/build/html
e7e60eb
e7e60eb
%changelog
e7e60eb
* Mon Sep 16 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 3.3.2-2
e7e60eb
- Patch docs build to use locally installed python3-sphinx.
e7e60eb
e7e60eb
* Wed Sep 04 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 3.3.2-1
e7e60eb
- Initial package, spec adapted from python-docs.