diff --git a/pip/python3.11-pip.spec b/pip/python3.11-pip.spec index 7713084..b2bc9e3 100644 --- a/pip/python3.11-pip.spec +++ b/pip/python3.11-pip.spec @@ -2,15 +2,17 @@ %global python3_pkgversion 3.11 %bcond_with tests +%bcond_with docs %global srcname pip -%global base_version 23.1.2 +%global base_version 24.0 %global upstream_version %{base_version}%{?prerel} %global python_wheel_name %{srcname}-%{upstream_version}-py3-none-any.whl %global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) %global python_wheel_dir %{_datadir}/python%{python3_pkgversion}-wheels %global python_wheel_pkg_prefix python%{python3_pkgversion} +%global sphinx_bin %{_bindir} sphinx-build-3 Name: python%{python3_pkgversion}-%{srcname} Version: %{base_version}%{?prerel:~%{prerel}} @@ -50,7 +52,7 @@ Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: https://pip.pypa.io/ Source0: https://github.com/pypa/pip/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz -%if 0%{?rhel} <= 8 +%if 0%{?rhel} <= 8 && %{without docs} # To generate the man pages for RHEL8 on a system with Python >= 3.7 # rhpkg prep # cd into the pip folder @@ -160,10 +162,13 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros # adds the dependency on python3-rpm-generators, so we require it manually # Note that the package prefix is always python3-, even if we build for 3.X BuildRequires: python3-rpm-generators -%if 0%{?rhel} == 9 +%if 0%{?rhel} >= 9 && %{without docs} # We utilize the main Python's stack sphinx to build the manual pages BuildRequires: python3-sphinx %endif #rhel9 +%if %{with docs} +BuildRequires: python%{python3_pkgversion}-pip +%endif BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: bash-completion BuildRequires: python%{python3_pkgversion}-wheel @@ -240,7 +245,7 @@ A Python wheel of pip to use with venv. # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem -%if 0%{?rhel} == 9 +%if 0%{?rhel} == 9 || %{with docs} # Remove unneeded doc dependencies sed -i '/myst_parser/d;/sphinx_copybutton/d;/sphinx_inline_tabs/d;/sphinxcontrib.towncrier/d' docs/html/conf.py %endif #rhel9 @@ -252,13 +257,18 @@ ln -s %{python_wheel_dir} tests/data/common_wheels rm -v src/pip/_vendor/distlib/*.exe sed -i '/\.exe/d' setup.py +%if %{with docs} +pip%{python3_pkgversion} install sphinx +%global sphinx_bin sphinx-build +%endif + %build %py3_build_wheel -%if 0%{?rhel} == 9 +%if 0%{?rhel} == 9 || %{with docs} # Build the man pages export PYTHONPATH=./src/ -sphinx-build-3 -b man docs/man docs/build/man -c docs/html +%{sphinx_bin} -b man docs/man docs/build/man -c docs/html %endif #rhel9 %install @@ -280,7 +290,7 @@ sphinx-build-3 -b man docs/man docs/build/man -c docs/html 'pip==%{upstream_version}' # Install the man pages -%if 0%{?rhel} <= 8 +%if 0%{?rhel} <= 8 && %{without docs} tar -xvf %{SOURCE1} %endif #rhel8 pushd docs/build/man