python-pip/python-pip.spec

207 lines
6.3 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:15:19 -04:00
%global srcname pip
2021-12-20 14:35:11 +08:00
%global python_wheelname %{srcname}-%{version}-py3-none-any.whl
2019-09-30 11:15:19 -04:00
%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}
2023-06-09 18:04:43 +08:00
Version: 23.1.2
2023-01-28 16:25:09 +08:00
Release: 1
2019-09-30 11:15:19 -04:00
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
2021-02-02 15:05:27 +08:00
Source0: %{pypi_source}
2019-09-30 11:15:19 -04:00
BuildArch: noarch
2023-01-28 16:25:09 +08:00
Patch1: remove-existing-dist-only-if-path-conflicts.patch
2020-08-25 11:47:20 +08:00
Patch6000: dummy-certifi.patch
2021-07-24 16:58:11 +08:00
2020-09-01 16:05:25 +08:00
Source10: pip-allow-older-versions.patch
2019-09-30 11:15:19 -04:00
%description %{_description}
%package -n python%{python3_pkgversion}-%{srcname}
2019-12-13 16:04:24 +08:00
Summary: %{summary}
2019-09-30 11:15:19 -04:00
BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-setuptools bash-completion ca-certificates
Requires: python%{python3_pkgversion}-setuptools ca-certificates
2021-11-26 05:31:51 +00:00
BuildRequires: python%{python3_pkgversion}-wheel
2019-09-30 11:15:19 -04:00
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Provides: python%{python3_pkgversion}dist(pip) = %{version}
Provides: python%{python3_version}dist(pip) = %{version}
2019-09-30 11:15:19 -04:00
%description -n python%{python3_pkgversion}-%{srcname} %{_description}
%package_help
2019-12-13 16:04:24 +08:00
%package wheel
Summary: The pip wheel
Requires: ca-certificates
%description wheel
A Python wheel of pip to use with venv
2019-09-30 11:15:19 -04:00
%prep
%autosetup -n %{srcname}-%{version} -p1
2021-08-23 15:12:21 +08:00
# this goes together with Patch6000
rm src/pip/_vendor/certifi/*.pem
2023-06-09 18:04:43 +08:00
#sed -i '/\.pem$/d' src/pip.egg-info/SOURCES.txt
sed -i '/html_theme = "furo"/d' docs/html/conf.py
# Remove windows executable binaries
rm -v src/pip/_vendor/distlib/*.exe
sed -i '/\.exe/d' setup.py
2021-08-23 15:12:21 +08:00
2019-09-30 11:15:19 -04:00
%build
%py3_build_wheel
%install
2020-07-28 18:55:50 +08:00
%{__python3} dist/%{python_wheelname}/pip install \
--root %{buildroot} \
--no-deps \
--no-cache-dir \
--no-index \
--ignore-installed \
--find-links dist \
'pip==%{version}'
2020-08-25 11:47:20 +08:00
%if %{with doc}
pushd docs/build/man
install -d %{buildroot}%{_mandir}/man1
for MAN in *1; do
install -pm0644 $MAN %{buildroot}%{_mandir}/man1/$MAN
for pip in "pip3" "pip-3" "pip%{python3_version}" "pip-%{python3_version}"; do
echo ".so $MAN" > %{buildroot}%{_mandir}/man1/${MAN/pip/$pip}
done
done
popd
%endif
# before we ln -s anything, we apply Source10 patch to all pips:
2020-09-01 16:05:25 +08:00
for PIP in %{buildroot}%{_bindir}/pip*; do
patch -p1 --no-backup-if-mismatch $PIP < %{SOURCE10}
done
2020-08-25 11:47:20 +08:00
2019-09-30 11:15:19 -04:00
mkdir -p %{buildroot}%{bashcompdir}
PYTHONPATH=%{buildroot}%{python3_sitelib} \
2020-07-28 18:55:50 +08:00
%{buildroot}%{_bindir}/pip completion --bash \
2019-09-30 11:15:19 -04:00
> %{buildroot}%{bashcompdir}/pip3
2020-08-25 11:47:20 +08:00
# Make bash completion apply to all the 5 symlinks we install
2020-07-28 18:55:50 +08:00
sed -i -e "s/^\\(complete.*\\) pip\$/\\1 pip pip{,-}{3,%{python3_version}}/" \
2019-09-30 11:15:19 -04:00
-e s/_pip_completion/_pip3_completion/ \
%{buildroot}%{bashcompdir}/pip3
2020-08-25 11:47:20 +08:00
# Provide symlinks to executables to comply with Fedora guidelines for Python
2020-07-28 18:55:50 +08:00
ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version}
ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3
2020-08-25 11:47:20 +08:00
2021-02-02 15:05:27 +08:00
# Make sure the INSTALLER is not pip and remove RECORD, otherwise Patch2 won't work
2020-08-25 11:47:20 +08:00
# %%pyproject macros do this for all packages
2021-02-02 15:05:27 +08:00
echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER
rm %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/RECORD
2020-08-25 11:47:20 +08:00
2019-09-30 11:15:19 -04:00
mkdir -p %{buildroot}%{python_wheeldir}
install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
2019-09-30 11:15:19 -04:00
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE.txt
%{_bindir}/pip
2019-09-30 11:15:19 -04:00
%{_bindir}/pip3
2020-08-25 11:47:20 +08:00
%{_bindir}/pip-3*
2019-09-30 11:15:19 -04:00
%{_bindir}/pip%{python3_version}
%{python3_sitelib}/pip*
%dir %{bashcompdir}
%{bashcompdir}/pip3*
%dir %(dirname %{bashcompdir})
%files help
%doc README.rst
2019-12-13 16:04:24 +08:00
%files wheel
%license LICENSE.txt
%dir %{python_wheeldir}/
%{python_wheeldir}/%{python_wheelname}
2019-09-30 11:15:19 -04:00
%changelog
2023-06-09 18:04:43 +08:00
* Fri Jun 9 2023 dillon chen <dillon.chen@gmail.com> - 23.1.2-1
- upgrade version to 23.1.2
2023-01-28 16:25:09 +08:00
* Sat Jan 28 2023 zhuofeng<zhuofeng2@huawei.com> - 22.3.1-1
- upgrade version to 22.3.1
* Wed Aug 03 2022 renhongxun <renhongxun@h-partners.com> - 21.3.1-3
- provides python3.10dist(pip) and python3dist(pip)
* Fri Jul 01 2022 dongyuzhen <dongyuzhen@h-partners.com> - 21.3.1-2
- Add patches that are deleted during the upgrade
2021-12-20 14:35:11 +08:00
* Mon Dec 20 2021 renhongxun<renhongxun@huawei.com> - 21.3.1-1
- upgrade version to 21.3.1
2021-11-26 05:31:51 +00:00
* Fri Nov 26 2021 shixuantong<shixuantong@huawei.com> - 20.3.3-5
- remove python3-pip from BuildRequires
2022-06-17 03:18:29 +00:00
* Mon Aug 23 2021 shixuantong<shixuantong@huawei.com> - 20.3.3-4
2021-08-23 15:12:21 +08:00
- delete bounded certificate
2021-08-19 17:15:19 +08:00
* Thu Aug 19 2021 shixuantong<shixuantong@huawei.com> - 20.3.3-3
- update dummy-certifi.patch
2021-07-24 16:58:11 +08:00
* Sat Jul 24 2021 shixuantong<shixuantong@huawei.com> - 20.3.3-2
- fix CVE-2021-3572
2021-02-02 15:05:27 +08:00
* Tue Feb 02 2021 shixuantong<shixuantong@huawei.com> - 20.3.3-1
- upgrade version to 20.3.3
* Wed Nov 4 2020 wangjie<wangjie294@huawei.com> -20.2.2-3
- Type:NA
- ID:NA
- SUG:NA
- DESC:remove python2
2020-09-01 16:05:25 +08:00
* Tue Sep 1 2020 wenzhanli<wenzhanli2@huawei.com> - 20.2.2-2
- add pip-allow-older-versions.patch
2020-08-25 11:47:20 +08:00
* Tue Aug 25 2020 wenzhanli<wenzhanli2@huawei.com> - 20.2.2-1
- update to 20.2.2 and add python2 require
2020-07-28 18:55:50 +08:00
* Tue Jul 28 2020 jinzhimin<jinzhimin2@huawei.com> - 20.1.1-1
- update to 20.1.1
* Thu Feb 20 2020 chengquan3<chengquan3@huawei.com> - 18.0-12
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Remove incorrect provision of python-wheel
2019-12-13 16:04:24 +08:00
* Sat Nov 16 2019 huzhiyu <huzhiyu1@huawei.com> - 18.0-11
- fix ca-certificate bad requires
* Fri Oct 15 2019 lvying<lvying6@huawei.com> - 18.0-10
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: split same wheel file from python2-pip and python3-pip
2019-09-30 11:15:19 -04:00
* Sun Sep 29 2019 yefei <yefei25@huawei.com> - 18.0-9
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: Synchronize patches
* Sat Sep 28 2019 yefei <yefei25@huawei.com> - 18.0-8
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add bash completion and repair python2 interpreter path
* Wed Sep 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 18.0-7
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: Synchronize a patch
* Mon Sep 23 2019 openEuler Buildteam <buildteam@openeuler.org> - 18.0-6
- Package init