From 6075e156e4772381e3c45bee0f639900f08c2c78d0c2f138fc8bd7666a7f65cd Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 4 May 2023 20:03:20 +0000 Subject: [PATCH] Clean up the SPEC file OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=104 --- python-pip.spec | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 35af7bf..d1165c8 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -16,13 +16,7 @@ # -%if 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -%{?!python_module:%define python_module() python3-%{**}} +%{?sle15_python_module_pythons} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -40,7 +34,11 @@ %endif %endif %global skip_python2 1 -%{?sle15_python_module_pythons} +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif Name: python-pip%{psuffix} Version: 23.1.2 Release: 0 @@ -62,15 +60,15 @@ Requires: ca-certificates Requires: coreutils Requires: python-setuptools Requires: python-xml +Recommends: ca-certificates-mozilla +BuildArch: noarch %if %{with libalternatives} -Requires: alts BuildRequires: alts +Requires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives %endif -Recommends: ca-certificates-mozilla -BuildArch: noarch %if %{with test} # Test requirements: BuildRequires: %{python_module PyYAML} @@ -86,11 +84,11 @@ BuildRequires: %{python_module scripttest} BuildRequires: %{python_module setuptools-wheel} BuildRequires: %{python_module virtualenv >= 1.10} BuildRequires: %{python_module wheel} +BuildRequires: ca-certificates +BuildRequires: git-core %if 0%{?suse_version} <= 1500 BuildRequires: %{python_module mock} %endif -BuildRequires: ca-certificates -BuildRequires: git-core %endif %if %{with wheel} BuildRequires: %{python_module wheel} @@ -160,7 +158,7 @@ donttest="test_pip_self_version_check_calls_underlying_implementation" # keep the alternative groups separate. Users could decide to let pip and pip3 point to # different flavors %python_install_alternative pip -%if "%python_flavor" != "python2" +%if "%{python_flavor}" != "python2" %python_install_alternative pip3 %endif