%bcond_without python2 %global srcname pip %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl %global python_wheeldir %{_datadir}/python-wheels %global _description \ pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes. %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.1.1 Release: 1 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: http://www.pip-installer.org Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch Patch1: emit-a-warning-when-running-with-root-privileges.patch Patch2: remove-existing-dist-only-if-path-conflicts.patch Patch3: dummy-certifi.patch Source1: pip-allow-different-versions.patch %description %{_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-setuptools bash-completion ca-certificates Requires: python%{python3_pkgversion}-setuptools ca-certificates BuildRequires: python%{python3_pkgversion}-pip python%{python3_pkgversion}-wheel %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} %{_description} %package_help %package wheel Summary: The pip wheel Requires: ca-certificates %description wheel A Python wheel of pip to use with venv %prep %autosetup -n %{srcname}-%{version} -p1 # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem # tests expect wheels in here ln -s %{python_wheeldir} tests/data/common_wheels sed -i -e 's/csv23/csv/g' tests/lib/wheel.py %build %py3_build_wheel %install %{__python3} dist/%{python_wheelname}/pip install \ --root %{buildroot} \ --no-deps \ --no-cache-dir \ --no-index \ --ignore-installed \ --find-links dist \ 'pip==%{version}' for PIP in %{buildroot}%{_bindir}/pip*; do patch -p1 $PIP < %{SOURCE1} done mkdir -p %{buildroot}%{bashcompdir} PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{buildroot}%{_bindir}/pip completion --bash \ > %{buildroot}%{bashcompdir}/pip3 sed -i -e "s/^\\(complete.*\\) pip\$/\\1 pip pip{,-}{3,%{python3_version}}/" \ -e s/_pip_completion/_pip3_completion/ \ %{buildroot}%{bashcompdir}/pip3 ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version} ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3 echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER mkdir -p %{buildroot}%{python_wheeldir} install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE.txt %{_bindir}/pip %{_bindir}/pip3 %{_bindir}/pip-3 %{_bindir}/pip%{python3_version} %{_bindir}/pip-%{python3_version} %{python3_sitelib}/pip* %dir %{bashcompdir} %{bashcompdir}/pip3* %dir %(dirname %{bashcompdir}) %files help %doc README.rst %files wheel %license LICENSE.txt %dir %{python_wheeldir}/ %{python_wheeldir}/%{python_wheelname} %changelog * Tue Jul 28 2020 jinzhimin - 20.1.1-1 - update to 20.1.1 * Thu Feb 20 2020 chengquan3 - 18.0-12 - Type:bugfix - ID:NA - SUG:NA - DESC: Remove incorrect provision of python-wheel * Sat Nov 16 2019 huzhiyu - 18.0-11 - fix ca-certificate bad requires * Fri Oct 15 2019 lvying - 18.0-10 - Type:enhancement - ID:NA - SUG:NA - DESC: split same wheel file from python2-pip and python3-pip * Sun Sep 29 2019 yefei - 18.0-9 - Type:enhancement - ID:NA - SUG:NA - DESC: Synchronize patches * Sat Sep 28 2019 yefei - 18.0-8 - Type:enhancement - ID:NA - SUG:NA - DESC: add bash completion and repair python2 interpreter path * Wed Sep 25 2019 openEuler Buildteam - 18.0-7 - Type:enhancement - ID:NA - SUG:NA - DESC: Synchronize a patch * Mon Sep 23 2019 openEuler Buildteam - 18.0-6 - Package init