diff --git a/0001-add-pip-loongarch.conf.patch b/0001-add-pip-loongarch.conf.patch new file mode 100644 index 0000000000000000000000000000000000000000..b527f6df4f471c05ffb24851a7d6b677715957e8 --- /dev/null +++ b/0001-add-pip-loongarch.conf.patch @@ -0,0 +1,49 @@ +From 50fc975fe0f6dfca8cdfa95985543b1661e23b78 Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Tue, 26 Jul 2022 01:40:05 +0000 +Subject: [PATCH] add pip-loongarch.conf + +Signed-off-by: Jingyun Hua +--- + pip/locations.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/pip/locations.py b/pip/locations.py +index e598ef1..3db0391 100644 +--- a/pip/locations.py ++++ b/pip/locations.py +@@ -5,6 +5,7 @@ import os + import os.path + import site + import sys ++import platform + + from distutils import sysconfig + from distutils.command.install import install, SCHEME_KEYS # noqa +@@ -83,6 +84,7 @@ src_prefix = os.path.abspath(src_prefix) + site_packages = sysconfig.get_python_lib() + user_site = site.USER_SITE + user_dir = expanduser('~') ++os_arch = platform.machine() + if WINDOWS: + bin_py = os.path.join(sys.prefix, 'Scripts') + bin_user = os.path.join(user_site, 'Scripts') +@@ -98,6 +100,16 @@ if WINDOWS: + legacy_storage_dir, + config_basename, + ) ++elif os_arch == 'loongarch64': ++ bin_py = os.path.join(sys.prefix, 'bin') ++ bin_user = os.path.join(user_site, 'bin') ++ user_conf = os.path.join(user_dir,'.pip/pip.conf') ++ if os.path.exists(user_conf): ++ config_basename = 'pip.conf' ++ legacy_config_file = user_conf ++ else: ++ config_basename = 'pip-loongarch.conf' ++ legacy_config_file = '/etc/pip3/pip-loongarch.conf' + else: + bin_py = os.path.join(sys.prefix, 'bin') + bin_user = os.path.join(user_site, 'bin') +-- +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/python-pip.spec b/python-pip.spec index 9ad42c0cd7c403444675810d219bc50fa31c9a5e..9f58a52d1667f0e34d40a37037d425391f4b22a6 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -10,11 +10,12 @@ %endif %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) +%define anolis_release .0.1 Name: python-%{srcname} # When updating, update the bundled libraries versions bellow! Version: 9.0.3 -Release: 22%{?dist} +Release: 22%{anolis_release}%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -60,6 +61,7 @@ BuildRequires: bzr %if %{with tests} Source1: pip-%{version}-tests.tar.gz %endif +Source100: pip-loongarch.conf # Patch until the following issue gets implemented upstream: # https://github.com/pypa/pip/issues/1351 @@ -129,6 +131,8 @@ Patch11: CVE-2021-3572.patch # Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2000135 Patch12: skip_yanked_releases.patch +Patch1000: 0001-add-pip-loongarch.conf.patch + %global _description \ pip is a package management system used to install and manage software packages \ written in Python. Many packages can be found in the Python Package Index \ @@ -273,6 +277,8 @@ popd %patch11 -p1 %patch12 -p1 +%patch1000 -p1 + # this goes together with patch4 rm pip/_vendor/certifi/*.pem rm pip/_vendor/requests/*.pem @@ -312,6 +318,9 @@ popd rm %{buildroot}%{_bindir}/pip +install -d %{buildroot}%{_sysconfdir}/pip3/ +install %{SOURCE100} %{buildroot}%{_sysconfdir}/pip3/ + %if %{with doc} install -d %{buildroot}%{_mandir}/man1 install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip3.1 @@ -365,6 +374,7 @@ py.test-%{python3_version} -m 'not network' %{_bindir}/pip-%{python3_version} %dir %{bashcompdir} %{bashcompdir}/pip* +%{_sysconfdir}/pip3/* %if %{with doc} %files doc @@ -382,6 +392,9 @@ py.test-%{python3_version} -m 'not network' %endif %changelog +* Fri Jul 22 2022 huajingyun - 9.0.3-22.0.1 +- Add pypi.loongnix.cn + * Wed Oct 06 2021 Charalampos Stratakis - 9.0.3-22 - Remove bundled windows executables - Resolves: rhbz#2006788