From c96fc808a39f70fa6aa7552f4807056419fb851553eb551f04339cd9eb7cd38a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 Oct 2021 00:24:58 +0000 Subject: [PATCH 1/2] Accepting request 923254 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923254 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=96 --- python-numpy.changes | 5 +++++ python-numpy.spec | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index 2734f8a..9132f16 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 10:05:18 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Sep 20 16:51:56 UTC 2021 - Ben Greiner diff --git a/python-numpy.spec b/python-numpy.spec index 566de86..f545a0b 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-numpy # # Copyright (c) 2021 SUSE LLC # @@ -16,6 +16,13 @@ # +# +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %global flavor @BUILD_FLAVOR@%{nil} %define ver 1.21.2 %define _ver 1_21_2 @@ -86,7 +93,7 @@ BuildRequires: %{python_module pytest >= 6.2.4} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module testsuite} -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 BuildRequires: unzip %if 0%{?suse_version} BuildRequires: fdupes @@ -116,9 +123,14 @@ BuildRequires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel BuildRequires: lua-lmod BuildRequires: suse-hpc Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives %endif +%endif %python_subpackages %description @@ -279,6 +291,10 @@ rm -Rf %{buildroot}%{$python_sitearch}/numpy/.pytest_cache popd %endif +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative f2py + %if %{without hpc} %post %python_install_alternative f2py From 4b609746f3fe6075510e37217484132c6a3ee118744d29a0091a1f8c8b36496d Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 12 Oct 2021 07:12:08 +0000 Subject: [PATCH 2/2] Accepting request 923599 from home:bnavigator:branches:devel:languages:python:numeric - The update- and libalternatives logic is required in the standard build, not the hpc flavor OBS-URL: https://build.opensuse.org/request/show/923599 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=97 --- python-numpy.changes | 6 ++++++ python-numpy.spec | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index 9132f16..e9ac3a0 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 6 19:16:45 UTC 2021 - Ben Greiner + +- The update- and libalternatives logic is required in the standard + build, not the hpc flavor + ------------------------------------------------------------------- Thu Sep 30 10:05:18 UTC 2021 - Stefan Schubert diff --git a/python-numpy.spec b/python-numpy.spec index f545a0b..1f6d499 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -1,5 +1,5 @@ # -# spec file for package python-numpy +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -117,19 +117,19 @@ Recommends: libopenblas_pthreads0 # Protect it from substitution %define oldpy_numpy python-numpy Conflicts: %{oldpy_numpy} <= 1.12.0 + %if %{with libalternatives} +BuildRequires: alts +Requires: alts + %else +Requires(post): update-alternatives +Requires(postun):update-alternatives + %endif %else BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel BuildRequires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel BuildRequires: lua-lmod BuildRequires: suse-hpc Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc -%if %{with libalternatives} -Requires: alts -BuildRequires: alts -%else -Requires(post): update-alternatives -Requires(postun):update-alternatives -%endif %endif %python_subpackages @@ -291,11 +291,11 @@ rm -Rf %{buildroot}%{$python_sitearch}/numpy/.pytest_cache popd %endif +%if %{without hpc} %pre # If libalternatives is used: Removing old update-alternatives entries. %python_libalternatives_reset_alternative f2py -%if %{without hpc} %post %python_install_alternative f2py