diff --git a/0001-use-pip-loongarch.conf-on-loongarch64.patch b/0001-use-pip-loongarch.conf-on-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..2e22a764eba65f5f9405329350c0b48042ae6276 --- /dev/null +++ b/0001-use-pip-loongarch.conf-on-loongarch64.patch @@ -0,0 +1,50 @@ +From db095b8f44332d2418aed63c745ffe117bee09c0 Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Tue, 26 Jul 2022 02:40:38 +0000 +Subject: [PATCH] use pip-loongarch.conf on loongarch64. + +Signed-off-by: Jingyun Hua +--- + src/pip/_internal/configuration.py | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/pip/_internal/configuration.py b/src/pip/_internal/configuration.py +index 858c660..1d9709a 100644 +--- a/src/pip/_internal/configuration.py ++++ b/src/pip/_internal/configuration.py +@@ -19,6 +19,7 @@ import locale + import logging + import os + import sys ++import platform + + from pip._vendor.six.moves import configparser + +@@ -76,6 +77,7 @@ kinds = enum( + + CONFIG_BASENAME = 'pip.ini' if WINDOWS else 'pip.conf' + ++os_arch = platform.machine() + + def get_configuration_files(): + global_config_files = [ +@@ -84,7 +86,15 @@ def get_configuration_files(): + ] + + site_config_file = os.path.join(sys.prefix, CONFIG_BASENAME) +- legacy_config_file = os.path.join( ++ ++ if os_arch == 'loongarch64': ++ user_conf = os.path.join(expanduser('~'),'.pip/pip.conf') ++ if os.path.exists(user_conf): ++ legacy_config_file = user_conf ++ else: ++ legacy_config_file = '/etc/pip38/pip-loongarch.conf' ++ else: ++ legacy_config_file = os.path.join( + expanduser('~'), + 'pip' if WINDOWS else '.pip', + CONFIG_BASENAME, +-- +2.27.0 + diff --git a/pip-loongarch.conf b/pip-loongarch.conf new file mode 100644 index 0000000000000000000000000000000000000000..fd77def5ba76999eaf35282ded8010919afa7038 --- /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://pypi.org/simple +[install] +trusted-host = + pypi.loongnix.cn + pypi.org diff --git a/python3x-pip.spec b/python3x-pip.spec index ad494bae41089a86d78512fce63fd7eba7e5b0cc..9bae93cc79a795ea5431f71b744f8e55cdd9e1e2 100644 --- a/python3x-pip.spec +++ b/python3x-pip.spec @@ -11,12 +11,13 @@ %endif %global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) +%define anolis_release .0.1 Name: python3x-%{srcname} # When updating, update the bundled libraries versions bellow! # You can use vendor_meta.sh in the dist git repo Version: 19.3.1 -Release: 5%{?dist} +Release: 5%{anolis_release}%{?dist} Summary: A tool for installing and managing Python packages # We bundle a lot of libraries with pip, which itself is under MIT license. @@ -70,6 +71,8 @@ Source1: https://github.com/pypa/pypa-docs-theme/archive/%{pypa_theme_com Source2: https://github.com/python/python-docs-theme/archive/2018.2.tar.gz %endif +Source100: pip-loongarch.conf + # Downstream only patch # Emit a warning to the user if pip install is run with root privileges # Issue upstream: https://github.com/pypa/pip/issues/4288 @@ -101,6 +104,7 @@ Patch6: CVE-2021-3572.patch # Upstream fix: https://github.com/urllib3/urllib3/commit/2d4a3fee6de2fa45eb82169361918f759269b4ec Patch7: CVE-2021-33503.patch +Patch1000: 0001-use-pip-loongarch.conf-on-loongarch64.patch # Downstream only patch # Users might have local installations of pip from using # `pip install --user --upgrade pip` on older/newer versions. @@ -256,6 +260,7 @@ popd %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch1000 -p1 # this goes together with patch4 rm src/pip/_vendor/certifi/*.pem @@ -292,6 +297,9 @@ rm docs/build/html/.buildinfo --root %{buildroot} \ --no-deps +install -d %{buildroot}%{_sysconfdir}/pip38 +install %{SOURCE100} %{buildroot}%{_sysconfdir}/pip38 + %if %{with doc} pushd docs/build/man install -d %{buildroot}%{_mandir}/man1 @@ -401,6 +409,7 @@ fi %{_bindir}/pip%{python3_version} %{_bindir}/pip-%{python3_version} %{python3_sitelib}/pip* +%{_sysconfdir}/pip38/* %dir %{bashcompdir} %{bashcompdir}/pip3.8 %ghost %{_bindir}/pip3 @@ -420,6 +429,9 @@ fi %{python_wheeldir}/%{python_wheelname} %changelog +* Fri Jul 22 2022 huajingyun - 19.3.1-5.0.1 +- Add pypi.loongnix.cn + * Thu Oct 14 2021 Charalampos Stratakis - 19.3.1-5 - Remove bundled windows executables - Resolves: rhbz#2006789