2006-12-18 23:17:38 +00:00
#
2011-02-17 17:32:10 +00:00
# spec file for package python-doc
2006-12-18 23:17:38 +00:00
#
2024-01-08 13:39:18 +00:00
# Copyright (c) 2024 SUSE LLC
2006-12-18 23:17:38 +00:00
#
2008-08-08 00:47:35 +00:00
# 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.
2018-09-27 14:11:14 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2006-12-18 23:17:38 +00:00
#
2021-11-02 19:29:32 +00:00
2006-12-18 23:17:38 +00:00
Name : python-doc
2020-04-23 09:28:38 +00:00
Version : 2.7.18
2011-12-08 13:04:48 +00:00
Release : 0
Summary : Additional Package Documentation for Python
2013-07-08 13:12:23 +00:00
License : Python-2.0
2006-12-18 23:17:38 +00:00
Group : Development/Languages/Python
2023-04-30 18:18:35 +00:00
URL : https://www.python.org/
2013-11-21 15:55:48 +00:00
%define tarname Python-%{version}
2013-06-03 15:40:08 +00:00
Source0 : %{tarname} .tar.xz
2013-06-04 13:31:26 +00:00
# docs for current version are regenerated every day
# this messes with autobuild "file changed" checks
2023-05-24 20:56:16 +00:00
#Source2: https://docs.python.org/%%{version}/archives/python-%%{pyver}-docs-pdf-a4.tar.bz2
#Source3: https://docs.python.org/%%{version}/archives/python-%%{pyver}-docs-pdf-letter.tar.bz2
2013-11-21 15:55:48 +00:00
Source2 : python-%{version} -docs-pdf-a4.tar.bz2
Source3 : python-%{version} -docs-pdf-letter.tar.bz2
2021-09-25 21:16:13 +00:00
# For Patch 66
Source66 : recursion.tar
2020-04-27 07:04:57 +00:00
%if 0%{?suse_version} >= 1500
BuildRequires : python3-Sphinx
%else
2014-12-15 15:06:19 +00:00
BuildRequires : python-Sphinx
2020-04-27 07:04:57 +00:00
%endif
2013-06-03 15:40:08 +00:00
BuildRequires : xz
2012-04-17 14:57:13 +00:00
# COMMON-PATCH-BEGIN
Patch1 : python-2.7-dirs.patch
Patch2 : python-distutils-rpm-8.patch
2013-06-03 15:40:08 +00:00
Patch3 : python-2.7.5-multilib.patch
2012-04-17 14:57:13 +00:00
Patch4 : python-2.5.1-sqlite.patch
2013-05-09 16:15:40 +00:00
Patch5 : python-2.7.4-canonicalize2.patch
2012-04-17 14:57:13 +00:00
Patch7 : python-2.6-gettext-plurals.patch
Patch8 : python-2.6b3-curses-panel.patch
Patch13 : python-2.7.2-fix_date_time_compiler.patch
2019-12-03 11:26:41 +00:00
Patch17 : remove-static-libpython.patch
2012-08-06 16:21:50 +00:00
# PATCH-FEATURE-OPENSUSE python-bundle-lang.patch bnc#617751 dimstar@opensuse.org -- gettext: when looking in default_localedir also check in locale-bundle.
Patch20 : python-bundle-lang.patch
2019-12-03 11:26:41 +00:00
Patch24 : python-bsddb6.patch
2015-02-25 16:42:06 +00:00
# PATCH-FIX-UPSTREAM accept directory-based CA paths as well
Patch33 : python-2.7.9-ssl_ca_path.patch
2022-11-22 20:56:11 +00:00
# PATCH-FEATURE-SLE disable SSL verification-by-default in http clients
Patch34 : python-2.7.9-sles-disable-verification-by-default.patch
2018-05-22 08:06:13 +00:00
# PATCH-FIX-UPSTREAM do not use non-ASCII filename in test_ssl.py
Patch35 : do-not-use-non-ascii-in-test_ssl.patch
2017-03-24 17:13:29 +00:00
# PATCH-FIX-UPSTREAM bmwiedemann@suse.de -- allow python packages to build reproducibly
Patch38 : reproducible.patch
2018-02-02 12:44:43 +00:00
# bypass boo#1078485 random failing tests
Patch40 : python-skip_random_failing_tests.patch
2018-02-20 13:42:29 +00:00
# PATCH-FIX-UPSTREAM sorted tar https://github.com/python/cpython/pull/2263
Patch41 : python-sorted_tar.patch
2018-10-29 15:14:27 +00:00
# https://github.com/python/cpython/pull/9624 (https://bugs.python.org/issue34834)
Patch47 : openssl-111-middlebox-compat.patch
# PATCH-FIX-SUSE python default SSLContext doesn't contain OP_CIPHER_SERVER_PREFERENCE
Patch48 : openssl-111-ssl_options.patch
2019-01-20 01:08:59 +00:00
# PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 mcepl@suse.com
2019-11-12 14:04:49 +00:00
# gh#python/cpython#11569
2019-01-20 01:08:59 +00:00
# Fix segfault in ssl's cert parser
Patch49 : CVE-2019-5010-null-defer-x509-cert-DOS.patch
2019-04-08 22:40:36 +00:00
# PATCH-FIX-UPSTREAM bpo36160-init-sysconfig_vars.patch gh#python/cpython#12131 mcepl@suse.com
# Initialize sysconfig variables in test_site.
Patch50 : bpo36160-init-sysconfig_vars.patch
2019-11-12 14:04:49 +00:00
# PATCH-FIX-UPSTREAM CVE-2017-18207.patch gh#python/cpython#4437 psimons@suse.com
# Add check for channels of wav file in Lib/wave.py
Patch51 : CVE-2017-18207.patch
# PATCH-FIX-UPSTREAM gh#python/cpython#12341
2019-09-25 15:35:20 +00:00
Patch55 : bpo36302-sort-module-sources.patch
2019-11-12 14:04:49 +00:00
# Fix installation in /usr/local (boo#1071941), adapted from Fedora
# https://src.fedoraproject.org/rpms/python3/blob/master/f/00251-change-user-install-location.patch
# Set values of prefix and exec_prefix in distutils install command
# to /usr/local if executable is /usr/bin/python* and RPM build
# is not detected to make pip and distutils install into separate location
Patch56 : adapted-from-F00251-change-user-install-location.patch
2020-01-28 14:39:17 +00:00
# Switch couple of tests failing on acient SLE-12
Patch57 : python-2.7.17-switch-off-failing-SSL-tests.patch
2020-02-08 22:22:43 +00:00
# PATCH-FIX-UPSTREAM CVE-2020-8492-urllib-ReDoS.patch bsc#1162367 mcepl@suse.com
# Fixes Python urrlib allowed an HTTP server to conduct Regular
# Expression Denial of Service (ReDoS)
Patch58 : CVE-2020-8492-urllib-ReDoS.patch
# PATCH-FIX-UPSTREAM CVE-2019-9674-zip-bomb.patch bsc#1162825 mcepl@suse.com
# Improve documentation warning against the possible zip bombs
Patch59 : CVE-2019-9674-zip-bomb.patch
2020-05-30 12:23:29 +00:00
# PATCH-FIX-UPSTREAM configure_PYTHON_FOR_REGEN.patch bsc#1078326 mcepl@suse.com
# PYTHON_FOR_REGEN value is set very weird upstream
Patch60 : configure_PYTHON_FOR_REGEN.patch
2021-01-31 18:01:03 +00:00
# PATCH-FIX-SLE CVE-2021-3177-buf_ovrfl_PyCArg_repr.patch bsc#1181126 mcepl@suse.com
# buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution
Patch61 : CVE-2021-3177-buf_ovrfl_PyCArg_repr.patch
2021-02-26 22:02:43 +00:00
# PATCH-FIX-UPSTREAM CVE-2021-23336-only-amp-as-query-sep.patch bsc#[0-9]+ mcepl@suse.com
# this patch makes things totally awesome
Patch62 : CVE-2021-23336-only-amp-as-query-sep.patch
2021-08-26 21:32:53 +00:00
# PATCH-FIX-UPSTREAM CVE-2021-3737-fix-HTTP-client-infinite-line-reading-after-a-HTTP-100-Continue.patch boo#1189241 gh#python/cpython#25916
Patch63 : CVE-2021-3737-fix-HTTP-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
2021-08-26 06:56:34 +00:00
# PATCH-FIX-UPSTREAM CVE-2021-3733-fix-ReDoS-in-request.patch boo#1189287 gh#python/cpython#24391
Patch64 : CVE-2021-3733-fix-ReDoS-in-request.patch
# PATCH-FIX-UPSTREAM sphinx-update-removed-function.patch bpo#35293 gh#python/cpython#22198 -- fix doc build
Patch65 : sphinx-update-removed-function.patch
2021-09-25 21:16:13 +00:00
# PATCH-FIX-UPSTREAM CVE-2019-20907_tarfile-inf-loop.patch bsc#1174091 mcepl@suse.com
# avoid possible infinite loop in specifically crafted tarball (CVE-2019-20907)
# REQUIRES SOURCE 66
Patch66 : CVE-2019-20907_tarfile-inf-loop.patch
# PATCH-FIX-UPSTREAM CVE-2020-26116-httplib-header-injection.patch bsc#1177211
# Fixes httplib to disallow control characters in method to avoid header
# injection
Patch67 : CVE-2020-26116-httplib-header-injection.patch
2022-02-06 07:47:48 +00:00
# PATCH-FIX-UPSTREAM CVE-2021-4189-ftplib-trust-PASV-resp.patch bsc#1194146 mcepl@suse.com
# Make ftplib not trust the PASV response. (gh#python/cpython#24838)
Patch68 : CVE-2021-4189-ftplib-trust-PASV-resp.patch
2022-02-09 16:55:07 +00:00
# PATCH-FIX-UPSTREAM CVE-2022-0391-urllib_parse-newline-parsing.patch bsc#1195396 mcepl@suse.com
# whole long discussion is on bpo#43882
# fix for santization URLs containing ASCII newline and tabs in urllib.parse
Patch69 : CVE-2022-0391-urllib_parse-newline-parsing.patch
2022-06-09 16:47:44 +00:00
# PATCH-FIX-UPSTREAM CVE-2015-20107-mailcap-unsafe-filenames.patch bsc#1198511 mcepl@suse.com
# avoid the command injection in the mailcap module.
Patch70 : CVE-2015-20107-mailcap-unsafe-filenames.patch
2022-09-07 04:48:27 +00:00
# PATCH-FIX-UPSTREAM CVE-2021-28861 bsc#1202624
# Coerce // to / in Lib/BaseHTTPServer.py
Patch71 : CVE-2021-28861-double-slash-path.patch
2022-09-15 07:46:07 +00:00
Patch72 : bpo34990-2038-problem-compileall.patch
2022-11-09 19:07:01 +00:00
# PATCH-FIX-UPSTREAM CVE-2022-45061-DoS-by-IDNA-decode.patch bsc#1205244 mcepl@suse.com
# Avoid DoS by decoding IDNA for too long domain names
Patch73 : CVE-2022-45061-DoS-by-IDNA-decode.patch
2023-01-19 08:45:16 +00:00
# PATCH-FIX-UPSTREAM skip_unverified_test.patch mcepl@suse.com
# switching verification off on the old SLE doesn't work
Patch74 : skip_unverified_test.patch
2023-03-01 22:01:21 +00:00
# PATCH-FIX-UPSTREAM CVE-2023-24329-blank-URL-bypass.patch bsc#1208471 mcepl@suse.com
# blocklist bypass via the urllib.parse component when supplying
# a URL that starts with blank characters
Patch75 : CVE-2023-24329-blank-URL-bypass.patch
2023-05-24 20:56:16 +00:00
# PATCH-FIX-OPENSUSE PygmentsBridge-trime_doctest_flags.patch mcepl@suse.com
# Build documentation even without PygmentsBridge.trim_doctest_flags
Patch76 : PygmentsBridge-trime_doctest_flags.patch
2024-01-08 13:39:18 +00:00
# PATCH-FIX-UPSTREAM CVE-2023-27043-email-parsing-errors.patch bsc#1210638 mcepl@suse.com
# Detect email address parsing errors and return empty tuple to
2024-04-16 20:26:40 +00:00
# indicate the parsing error (old API), modified for fixing bsc#1222537,
# so that email.utils.parseaddr accepts unicode string
2024-01-08 13:39:18 +00:00
Patch77 : CVE-2023-27043-email-parsing-errors.patch
2023-09-14 21:54:10 +00:00
# PATCH-FIX-UPSTREAM CVE-2022-48565-plistlib-XML-vulns.patch bsc#1214685 mcepl@suse.com
# Reject entity declarations in plists
Patch78 : CVE-2022-48565-plistlib-XML-vulns.patch
2023-09-13 12:22:49 +00:00
# PATCH-FIX-UPSTREAM CVE-2023-40217-avoid-ssl-pre-close.patch gh#python/cpython#108315
Patch79 : CVE-2023-40217-avoid-ssl-pre-close.patch
2023-09-16 16:30:00 +00:00
# PATCH-FIX-UPSTREAM CVE-2022-48566-compare_digest-more-constant.patch bsc#1214691 mcepl@suse.com
# Make compare_digest more constant-time
Patch80 : CVE-2022-48566-compare_digest-more-constant.patch
2024-05-19 06:56:12 +00:00
# PATCH-FIX-OPENSUSE CVE-2023-52425-libexpat-2.6.0-remove-failing-tests.patch bpo#3151 mcepl@suse.com
# We don't have fix for bpo#3151 and it is just not supported
Patch81 : CVE-2023-52425-libexpat-2.6.0-remove-failing-tests.patch
2024-05-18 16:51:08 +00:00
# PATCH-FIX-UPSTREAM CVE-2024-0450-zipfile-avoid-quoted-overlap-zipbomb.patch bsc#1221854 mcepl@suse.com
# detecting the vulnerability of the "quoted-overlap" zipbomb (from gh#python/cpython!110016).
2024-05-19 06:56:12 +00:00
Patch82 : CVE-2024-0450-zipfile-avoid-quoted-overlap-zipbomb.patch
2012-04-17 14:57:13 +00:00
# COMMON-PATCH-END
2021-08-26 06:56:34 +00:00
Provides : pyth_doc = %{version}
Provides : pyth_ps = %{version}
Obsoletes : pyth_doc < %{version}
Obsoletes : pyth_ps < %{version}
2011-12-08 13:04:48 +00:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
BuildArch : noarch
2013-11-21 15:55:48 +00:00
Enhances: python = %{version}
2016-12-02 15:37:55 +00:00
Provides : python2-doc = %{version}
2006-12-18 23:17:38 +00:00
%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
Summary : Python PDF Documentation
Group : Development/Languages/Python
2021-08-26 06:56:34 +00:00
Provides : pyth_pdf = %{version}
Obsoletes : pyth_pdf < %{version}
2016-12-02 15:37:55 +00:00
Provides : python2-doc-pdf = %{version}
2006-12-18 23:17:38 +00:00
%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.
%prep
%setup -q -n %{tarname}
2012-04-17 14:57:13 +00:00
# COMMON-PREP-BEGIN
2023-11-27 17:09:47 +00:00
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 7 -p1
%patch -P 8 -p1
%patch -P 13 -p1
%patch -P 17 -p1
%patch -P 20 -p1
%patch -P 24 -p1
%patch -P 33 -p1
2022-11-22 20:56:11 +00:00
%if %{suse_version} < 1500 && !0%{?is_opensuse}
2023-11-27 17:09:47 +00:00
%patch -P 34 -p1
2022-11-22 20:56:11 +00:00
%endif
2023-11-27 17:09:47 +00:00
%patch -P 35 -p1
%patch -P 38 -p1
2018-02-02 12:44:43 +00:00
%ifarch ppc ppc64 ppc64le
2023-11-27 17:09:47 +00:00
%patch -P 40 -p1
2018-02-02 12:44:43 +00:00
%endif
2023-11-27 17:09:47 +00:00
%patch -P 41 -p1
2023-06-07 10:42:55 +00:00
%if %{suse_version} >= 1500 || (0%{?sle_version} && 0%{?sle_version} >= 120400)
2023-11-27 17:09:47 +00:00
%patch -P 47 -p1
%patch -P 48 -p1
2023-06-07 15:44:38 +00:00
%endif
2023-06-07 18:49:34 +00:00
# SLE-12 needs to skip more
%if %{suse_version} == 1315
2023-11-27 17:09:47 +00:00
%patch -P 57 -p1
2020-01-28 14:39:17 +00:00
%endif
2023-11-27 17:09:47 +00:00
%patch -P 49 -p1
%patch -P 50 -p1
%patch -P 51 -p1
%patch -P 55 -p1
%patch -P 56 -p1
%patch -P 58 -p1
%patch -P 59 -p1
%patch -P 60 -p1
%patch -P 61 -p1
%patch -P 62 -p1
%patch -P 63 -p1
%patch -P 64 -p1
%patch -P 65 -p1
%patch -P 66 -p1
%patch -P 67 -p1
%patch -P 68 -p1
%patch -P 69 -p1
%patch -P 70 -p1
%patch -P 71 -p1
%patch -P 72 -p1
%patch -P 73 -p1
2023-01-19 08:45:16 +00:00
%if 0%{?sle_version} && 0%{?sle_version} < 150000
2023-11-27 17:09:47 +00:00
%patch -P 74 -p1
2023-01-19 08:45:16 +00:00
%endif
2023-11-27 17:09:47 +00:00
%patch -P 75 -p1
%patch -P 76 -p1
2024-01-08 13:39:18 +00:00
%patch -P 77 -p1
2023-11-27 17:09:47 +00:00
%patch -P 78 -p1
%patch -P 79 -p1
%patch -P 80 -p1
2024-05-18 16:51:08 +00:00
%patch -P 81 -p1
2024-05-19 06:56:12 +00:00
%patch -P 82 -p1
2021-09-25 21:16:13 +00:00
# For patch 66
cp -v %{SOURCE66} Lib/test/recursion.tar
2013-05-09 16:15:40 +00:00
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.ac
2012-04-17 14:57:13 +00:00
# COMMON-PREP-END
2006-12-18 23:17:38 +00:00
%build
2014-12-17 13:10:23 +00:00
TODAY_DATE=`date -r %{S:0} " + % B % d , % Y " `
# TODO use not date of tarball but date of latest patch
2014-12-15 15:06:19 +00:00
pushd Doc
2014-12-17 13:10:23 +00:00
sed -i " s / ^ t o d a y = . * / t o d a y = ' $ T O D A Y _ D A T E ' / " conf.py
%if 0%{?suse_version} < 1320
# lower sphinx version requirement, docs seem to work fine with 1.1
sed -i " s / ^ n e e d s _ s p h i n x = . * / n e e d s _ s p h i n x = ' 1 . 1 ' / " conf.py
%endif
2014-12-15 15:06:19 +00:00
make html
popd
2006-12-18 23:17:38 +00:00
%install
2011-12-08 13:04:48 +00:00
export PDOCS=%{buildroot} %{_docdir} /python
2006-12-18 23:17:38 +00:00
install -d -m 755 $PDOCS/Misc
2014-12-15 15:06:19 +00:00
rm Doc/build/html/.buildinfo
mv Doc/build/html $PDOCS/html
2011-12-08 13:04:48 +00:00
tar xfj %{SOURCE2} -C $PDOCS
2009-03-11 15:45:20 +00:00
mv $PDOCS/docs-pdf $PDOCS/paper-a4
2011-12-08 13:04:48 +00:00
tar xfj %{SOURCE3} -C $PDOCS
2009-03-11 15:45:20 +00:00
mv $PDOCS/docs-pdf $PDOCS/paper-letter
2013-05-09 16:15:40 +00:00
# this is part of main package
2021-01-31 18:01:03 +00:00
#install -c -m 644 README $PDOCS/README
2006-12-18 23:17:38 +00:00
for i in Misc/* ; do
2011-12-08 13:04:48 +00:00
[ -f $i ] && install -c -m 644 $i $PDOCS/Misc/
2006-12-18 23:17:38 +00:00
done
%files
2011-12-08 13:04:48 +00:00
%defattr (644,root,root,755)
%dir %{_docdir} /python
%doc %{_docdir} /python/Misc
%doc %{_docdir} /python/html
2023-05-24 20:56:16 +00:00
#%%doc %%{_docdir}/python/README
2006-12-18 23:17:38 +00:00
%files pdf
2011-12-08 13:04:48 +00:00
%defattr (644,root,root,755)
%doc %{_docdir} /python/paper-a4
%doc %{_docdir} /python/paper-letter
2008-03-11 16:57:23 +00:00
2007-03-23 20:32:32 +00:00
%changelog