|
|
|
@ -48,6 +48,16 @@ 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
|
|
|
|
|
# To generate the man pages for RHEL8 on a system with Python >= 3.7
|
|
|
|
|
# rhpkg prep
|
|
|
|
|
# cd into the pip folder
|
|
|
|
|
# sed -i '/myst_parser/d;/sphinx_copybutton/d;/sphinx_inline_tabs/d;/sphinxcontrib.towncrier/d' docs/html/conf.py
|
|
|
|
|
# sphinx-build-3 -b man docs/man docs/build/man -c docs/html
|
|
|
|
|
# tar -czf pip-22.3.1-man.tar.gz --exclude=".[^/]*" -v docs/build/man
|
|
|
|
|
# mv pip-22.3.1-man.tar.gz ..
|
|
|
|
|
Source1: pip-%{base_version}-man.tar.gz
|
|
|
|
|
%endif #rhel8
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
# Prevent removing of the system packages installed under /usr/lib
|
|
|
|
@ -154,8 +164,10 @@ 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
|
|
|
|
|
# We utilize the main Python's stack sphinx to build the manual pages
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
%endif #rhel9
|
|
|
|
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
|
|
|
BuildRequires: bash-completion
|
|
|
|
|
BuildRequires: python%{python3_pkgversion}-wheel
|
|
|
|
@ -183,11 +195,6 @@ BuildRequires: python%{python3_pkgversion}-installer
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pip has to require explicit version of python that provides
|
|
|
|
|
# filters in tarfile module (fix for CVE-2007-4559).
|
|
|
|
|
Requires: python%{python3_pkgversion} >= 3.11.4-3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This was previously required and we keep it recommended because a lot of
|
|
|
|
|
# sdists installed via pip will try to import setuptools.
|
|
|
|
|
# But pip doesn't actually require setuptools.
|
|
|
|
@ -196,6 +203,16 @@ Requires: python%{python3_pkgversion} >= 3.11.4-3
|
|
|
|
|
# Side note: pip bundles pkg_resources from setuptools for internal usage.
|
|
|
|
|
Recommends: python%{python3_pkgversion}-setuptools
|
|
|
|
|
|
|
|
|
|
# Require alternatives version that implements the --keep-foreign flag
|
|
|
|
|
Requires(postun): alternatives >= 1.19.1-1
|
|
|
|
|
|
|
|
|
|
# python3.11 installs the alternatives master symlink to which we attach a slave
|
|
|
|
|
# pip has to require explicit version of python that provides
|
|
|
|
|
# filters in tarfile module (fix for CVE-2007-4559).
|
|
|
|
|
Requires: python%{python3_pkgversion} >= 3.11.4-3
|
|
|
|
|
Requires(post): python%{python3_pkgversion}
|
|
|
|
|
Requires(postun): python%{python3_pkgversion}
|
|
|
|
|
|
|
|
|
|
# Virtual provides for the packages bundled by pip:
|
|
|
|
|
%{bundled %{python3_pkgversion}}
|
|
|
|
|
|
|
|
|
@ -227,8 +244,10 @@ A Python wheel of pip to use with venv.
|
|
|
|
|
# this goes together with patch4
|
|
|
|
|
rm src/pip/_vendor/certifi/*.pem
|
|
|
|
|
|
|
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
# tests expect wheels in here
|
|
|
|
|
ln -s %{python_wheel_dir} tests/data/common_wheels
|
|
|
|
@ -240,9 +259,11 @@ sed -i '/\.exe/d' setup.py
|
|
|
|
|
%build
|
|
|
|
|
%py3_build_wheel
|
|
|
|
|
|
|
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
|
# Build the man pages
|
|
|
|
|
export PYTHONPATH=./src/
|
|
|
|
|
sphinx-build-3 -b man docs/man docs/build/man -c docs/html
|
|
|
|
|
%endif #rhel9
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
# The following is similar to %%pyproject_install, but we don't have
|
|
|
|
@ -263,6 +284,9 @@ sphinx-build-3 -b man docs/man docs/build/man -c docs/html
|
|
|
|
|
'pip==%{upstream_version}'
|
|
|
|
|
|
|
|
|
|
# Install the man pages
|
|
|
|
|
%if 0%{?rhel} == 8
|
|
|
|
|
tar -xvf %{SOURCE1}
|
|
|
|
|
%endif #rhel8
|
|
|
|
|
pushd docs/build/man
|
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
|
|
|
|
for MAN in *1; do
|
|
|
|
@ -303,11 +327,17 @@ install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
|
|
|
|
|
rm %{buildroot}%{_bindir}/pip
|
|
|
|
|
rm %{buildroot}%{_bindir}/pip3
|
|
|
|
|
|
|
|
|
|
# All ghost files controlled by alternatives need to exist for the files
|
|
|
|
|
# section check to succeed
|
|
|
|
|
touch %{buildroot}%{_bindir}/pip3
|
|
|
|
|
touch %{buildroot}%{_bindir}/pip-3
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
|
# Verify bundled provides are up to date
|
|
|
|
|
%{_rpmconfigdir}/pythonbundles.py src/pip/_vendor/vendor.txt --namespace 'python%{python3_pkgversion}dist' \
|
|
|
|
|
--compare-with '%{bundled %{python3_pkgversion}}'
|
|
|
|
|
%endif #rhel9
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
# Upstream tests
|
|
|
|
@ -322,6 +352,32 @@ pytest_k='not completion'
|
|
|
|
|
--deselect tests/functional --deselect tests/lib/test_lib.py
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%post -n python%{python3_pkgversion}-%{srcname}
|
|
|
|
|
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
|
|
|
|
|
%{_bindir}/pip3 \
|
|
|
|
|
pip3 \
|
|
|
|
|
%{_bindir}/pip%{python3_version}
|
|
|
|
|
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
|
|
|
|
|
%{_bindir}/pip-3 \
|
|
|
|
|
pip-3 \
|
|
|
|
|
%{_bindir}/pip-%{python3_version}
|
|
|
|
|
|
|
|
|
|
%postun -n python%{python3_pkgversion}-%{srcname}
|
|
|
|
|
# Do this only during uninstall process (not during update)
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
|
# Only remove the slave links if the master link for python3 still exists.
|
|
|
|
|
# Due to a possible bug in yum, python3.11 gets removed before python3.11-pip
|
|
|
|
|
# even though we have declared Requires(postun): python3.11
|
|
|
|
|
EXISTS=`alternatives --display python3 | \
|
|
|
|
|
grep -c "^/usr/bin/python%{python3_version} - priority [0-9]*"`
|
|
|
|
|
|
|
|
|
|
if [ $EXISTS -ne 0 ]; then
|
|
|
|
|
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
|
|
|
|
|
pip3
|
|
|
|
|
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
|
|
|
|
|
pip-3
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%files -n python%{python3_pkgversion}-%{srcname}
|
|
|
|
|
%doc README.rst
|
|
|
|
@ -335,6 +391,8 @@ pytest_k='not completion'
|
|
|
|
|
%{python3_sitelib}/pip*
|
|
|
|
|
%dir %{bashcompdir}
|
|
|
|
|
%{bashcompdir}/pip%{python3_pkgversion}
|
|
|
|
|
%ghost %{_bindir}/pip3
|
|
|
|
|
%ghost %{_bindir}/pip-3
|
|
|
|
|
|
|
|
|
|
%files -n %{python_wheel_pkg_prefix}-%{srcname}-wheel
|
|
|
|
|
%license LICENSE.txt
|
|
|
|
@ -345,11 +403,11 @@ pytest_k='not completion'
|
|
|
|
|
%changelog
|
|
|
|
|
* Wed Feb 14 2024 Tomáš Hrnčiar <thrnciar@redhat.com> - 22.3.1-5
|
|
|
|
|
- Require Python with tarfile filters
|
|
|
|
|
Resolves: RHEL-25455
|
|
|
|
|
Resolves: RHEL-25453
|
|
|
|
|
|
|
|
|
|
* Tue Aug 08 2023 Petr Viktorin <pviktori@redhat.com> - 22.3.1-4
|
|
|
|
|
- Use tarfile.data_filter for extracting (CVE-2007-4559, PEP-721, PEP-706)
|
|
|
|
|
Resolves: RHBZ#2218247
|
|
|
|
|
Resolves: RHBZ#2218249
|
|
|
|
|
|
|
|
|
|
* Mon Mar 06 2023 Lumír Balhar <lbalhar@redhat.com> - 22.3.1-3
|
|
|
|
|
- Fix changelog to contain Fedora contributors
|
|
|
|
|