From 3756b8af4255e19cd3b002edca4c443cc60654b54838ef2a778ca1087cca2d99 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 6 Apr 2020 21:42:47 +0000 Subject: [PATCH] - Use update-alternatives for /usr/bin/f2py OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=50 --- python-numpy.changes | 5 +++++ python-numpy.spec | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index 7296f32..24326cb 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 6 21:42:29 UTC 2020 - Matej Cepl + +- Use update-alternatives for /usr/bin/f2py + ------------------------------------------------------------------- Sat Mar 28 16:39:11 UTC 2020 - Arun Persaud diff --git a/python-numpy.spec b/python-numpy.spec index 33de1fb..deda28c 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -113,6 +113,8 @@ 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 +Requires(post): update-alternatives +Requires(postun): update-alternatives %endif %python_subpackages @@ -189,6 +191,8 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" %{?with_hpc:module load openblas} %python_exec setup.py install --prefix=%{p_prefix} --root=%{buildroot} +%python_clone -a %{buildroot}%{p_prefix}/bin/f2py +rm -v %{buildroot}%{p_prefix}/bin/f2py3* %if 0%{?suse_version} %fdupes %{buildroot}%{p_prefix} @@ -252,13 +256,17 @@ pushd testing popd %endif +%post +%python_install_alternative f2py + +%postun +%python_uninstall_alternative f2py + %files %{python_files} %doc README.md THANKS.txt -%python3_only %{p_bindir}/f2py3* -%python3_only %{p_bindir}/f2py +%python_alternative %{p_bindir}/f2py %if %{without hpc} %{python_sitearch}/numpy/ -%{python_sitearch}/numpy/LICENSE.txt %{python_sitearch}/numpy-%{version}-py*.egg-info %license %{python_sitearch}/numpy/LICENSE.txt %exclude %{python_sitearch}/numpy/core/include/ @@ -267,7 +275,6 @@ popd %exclude %{python_sitearch}/numpy/core/lib/libnpymath.a %else %{p_python_sitearch}/numpy/ -%{p_python_sitearch}/numpy/LICENSE.txt %{p_python_sitearch}/numpy-%{version}-py*.egg-info %license %{p_python_sitearch}/numpy/LICENSE.txt %exclude %{p_python_sitearch}/numpy/core/include/