File python3-doc.spec of Package python3-base

#
# spec file for package python3-doc
#
# Copyright (c) 2013 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/
#


Name:           python3-doc
Url:            http://www.python.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  xz
Summary:        Additional Package Documentation for Python.
License:        Python-2.0
Group:          Development/Languages/Python
Version:        3.3.3
Release:        0
BuildArch:      noarch
%define         tarversion     %{version}
%define         tarname        Python-%{tarversion}
%define         pyname         python3
%define pyver   3.3.3
Enhances:       %{pyname}=%{pyver}
Source0:        http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz
# docs for current version are regenerated every day
# this messes with autobuild "file changed" checks
#Source1:        http://docs.python.org/3/archives/python-%{version}-docs-html.tar.bz2
#Source2:        http://docs.python.org/3/archives/python-%{version}-docs-pdf-a4.tar.bz2
#Source3:        http://docs.python.org/3/archives/python-%{version}-docs-pdf-letter.tar.bz2
Source1:        python-%{version}-docs-html.tar.bz2
Source2:        python-%{version}-docs-pdf-a4.tar.bz2
Source3:        python-%{version}-docs-pdf-letter.tar.bz2
Provides:       pyth_doc
Provides:       pyth_ps
Obsoletes:      pyth_doc
Obsoletes:      pyth_ps

# for consistency:
### COMMON-PATCH-BEGIN ###

# implement "--record-rpm" option for distutils installations
Patch01:        Python-3.0b1-record-rpm.patch
# support lib-vs-lib64 distinction
Patch02:        Python-3.3.0b2-multilib.patch
# securing usage of readlink/realpath in PySys_SetArgv
Patch03:        python-2.6b1-canonicalize2.patch
# support finding packages in /usr/local, install to /usr/local by default
Patch04:        python-3.3.0b1-localpath.patch
# replace DATE, TIME and COMPILER by fixed definitions to aid reproducible builds
Patch06:        python-3.3.0b1-fix_date_time_compiler.patch
# fix wrong include path in curses-panel module
Patch07:        python-3.3.0b1-curses-panel.patch
# POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test
Patch09:        python-3.3.0b1-test-posix_fadvise.patch
# Add missing bits for aarch64 in libffi
Patch10:        ctypes-libffi-aarch64.patch
# Disable SO_REUSEPORT constant in tests, because it's not supported on older kernels
Patch11:        python-3.3.2-no-REUSEPORT.patch
# Disable global and distutils sysconfig comparison test, we deviate from the default depending on optflags
Patch12:        python-3.3.3-skip-distutils-test_sysconfig_module.patch
# Add support for ppc64le (ELFv2) to libffi copy for ctypes
Patch13:        libffi-ppc64le.diff
### COMMON-PATCH-END ###
### COMMON-DEF-BEGIN ###

# the versions are autogenerated from pre_checkin.sh
# based on the current source tarball
%define         python_version  3.3

%define         python_version_abitag   33
%define         python_version_soname   3_3

%define         sitedir         %{_libdir}/python%{python_version}

# three possible ABI kinds: m - pymalloc, d - debug build
# see PEP 3149
%define         abi_kind m
# python ABI version - used in some file names
%define         python_abi %{python_version}%{abi_kind}
# soname ABI tag defined in PEP 3149
%define         abi_tag %{python_version_abitag}%{abi_kind}

%define         so_version %{python_version_soname}%{abi_kind}1_0

%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}.so
### COMMON-DEF-END ###

%description
Tutorial, Global Module Index, Language Reference, Library Reference,
Extending and Embedding Reference, Python/C API Reference, Documenting
Python, and Macintosh Module Reference in HTML format.



%package pdf
Provides:       pyth_pdf
Obsoletes:      pyth_pdf
Summary:        Python PDF Documentation
Group:          Development/Languages/Python

%description pdf
Tutorial, Global Module Index, Language Reference, Library Reference,
Extending and Embedding Reference, Python/C API Reference, Documenting
Python, and Macintosh Module Reference in PDF format.



Authors:
--------
    Guido van Rossum <guido@python.org>

%prep
%setup -q -n %{tarname}

# for consistency
### COMMON-PREP-BEGIN ###

%patch01 -p1
%patch02 -p1
#%%patch03
#- canonicalize disabled, needs testing whether the exploit still works
%patch04
%patch06 -p1
%patch07
%patch09 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p0

# drop Autoconf version requirement
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac

### COMMON-PREP-END ###

%build
# nothing to do (...whistles innocently)

%install
export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{pyname}
install -d -m 755 $PDOCS/Misc
install -d -m 755 $PDOCS/paper-a4 $PDOCS/paper-letter $PDOCS/html
tar xfj %{S:1} -C $PDOCS/html
( cd $PDOCS/html; mv python-%{version}-docs-html/* . ; rm -rf python-%{version}-docs-html) 
tar xfj %{S:2} -C $PDOCS/paper-a4
( cd $PDOCS/paper-a4; mv docs-pdf/* . ; rm -rf docs-pdf) 
tar xfj %{S:3} -C $PDOCS/paper-letter
( cd $PDOCS/paper-letter; mv docs-pdf/* . ; rm -rf docs-pdf) 
install -c -m 644 Misc/ACKS                             $PDOCS/ACKS.txt
for i in Misc/* ; do
  [ -f $i ] && install -c -m 644 $i                 $PDOCS/Misc/
done

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644, root, root, 755)
%dir %{_docdir}/%{pyname}
%doc %{_docdir}/%{pyname}/Misc
%doc %{_docdir}/%{pyname}/html
%doc %{_docdir}/%{pyname}/ACKS.txt

%files pdf
%defattr(644, root, root, 755)
%doc %{_docdir}/%{pyname}/paper-a4
%doc %{_docdir}/%{pyname}/paper-letter

%changelog