Blob Blame History Raw
%if 0%{?fedora}
%global check_links 1
%else
%global check_links 0
%endif

%{!?__python_ver:%global __python_ver 3}

%if "%{__python_ver}" != "EMPTY"
%global main_python 0
%global python python%{__python_ver}
%else
%global main_python 1
%global python python
%endif

%define pybasever 3.3

Summary: Documentation for the Python 3 programming language
Name: %{python}-docs
# The Version needs to be in-sync with the "python" package:
Version: %{pybasever}.2
Release: 2%{?dist}
License: Python
Group: Documentation
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
BuildArch: noarch

Patch0: python3-docs-use-local-python3-sphinx.patch

Requires: %{python} = %{version}

BuildRequires: %{python}
BuildRequires: %{python}-sphinx
BuildRequires: %{python}-docutils
BuildRequires: %{python}-pygments

%if %{check_links}
BuildRequires: linkchecker
%endif

URL: http://www.python.org/

%description
The python3-docs package contains documentation on the Python 3
programming language and interpreter.

Install the python3-docs package if you'd like to use the documentation
for the Python 3 language.

%prep
%setup -q -n Python-%{version}

%patch0 -p1

%build
make -C Doc html
rm Doc/build/html/.buildinfo

%install
mkdir -p $RPM_BUILD_ROOT

%check
# Verify that all of the local links work (see rhbz#670493 - doesn't apply
# to python3-docs, but only to older python-docs)
#
# (we can't check network links, as we shouldn't be making network connections
# within a build.  Also, don't bother checking the .txt source files; some
# contain example URLs, which don't work)
%if %{check_links}
linkchecker \
  --ignore-url=^mailto: --ignore-url=^http --ignore-url=^ftp \
  --ignore-url=.txt\$ \
  Doc/build/html/index.html
%endif

%files
%doc Misc/NEWS Misc/HISTORY Misc/README Doc/build/html

%changelog
* Mon Sep 16 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 3.3.2-2
- Patch docs build to use locally installed python3-sphinx.

* Wed Sep 04 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 3.3.2-1
- Initial package, spec adapted from python-docs.