From 98fbb14370956e20fa7feed91515fe3d4219e439 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 31 Jul 2023 12:12:30 +0800 Subject: [PATCH] Use local mirrors for pip --- pip.huaweicloud.conf | 5 +++++ pip.loongarch.conf | 8 ++++++++ python-pip.spec | 14 +++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pip.huaweicloud.conf create mode 100644 pip.loongarch.conf diff --git a/pip.huaweicloud.conf b/pip.huaweicloud.conf new file mode 100644 index 0000000..f2b1c8f --- /dev/null +++ b/pip.huaweicloud.conf @@ -0,0 +1,5 @@ +[global] +index-url = https://repo.huaweicloud.com/repository/pypi/simple + +[install] +trusted-host = https://repo.huaweicloud.com diff --git a/pip.loongarch.conf b/pip.loongarch.conf new file mode 100644 index 0000000..3ef9fd2 --- /dev/null +++ b/pip.loongarch.conf @@ -0,0 +1,8 @@ +[global] +timeout = 60 +index-url = https://pypi.loongnix.cn/loongson/pypi +extra-index-url = https://repo.huaweicloud.com/repository/pypi/simple +[install] +trusted-host = + pypi.loongnix.cn + repo.huaweicloud.com diff --git a/python-pip.spec b/python-pip.spec index c57bc81..9ae6b8b 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,11 +6,13 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 21.3.1 -Release: 2 +Release: 3 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: %{pypi_source} +Source1: pip.huaweicloud.conf +Source2: pip.loongarch.conf BuildArch: noarch Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch Patch2: emit-a-warning-when-running-with-root-privileges.patch @@ -97,9 +99,16 @@ rm %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/RECORD mkdir -p %{buildroot}%{python_wheeldir} install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} +# Set default pip mirror via pip.conf +%ifarch loongarch64 +install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pip.conf +%else +install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pip.conf +%endif %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE.txt +%config(noreplace) %{_sysconfdir}/pip.conf %{_bindir}/pip %{_bindir}/pip3 %{_bindir}/pip-3* @@ -118,6 +127,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* Mon Jul 31 2023 Funda Wang - 21.3.1-3 +- Use local mirrors for pip + * Fri Jul 01 2022 dongyuzhen - 21.3.1-2 - Add patches that are deleted during the upgrade -- Gitee