From 015f5afef66e86e54afceb2473a0b4cdd330420c95485cc05d33a8106179806b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 7 Apr 2020 13:08:50 +0000 Subject: [PATCH] - Do not use alternatives on HPC as it is pain to get it working OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=52 --- python-numpy.changes | 5 +++++ python-numpy.spec | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index c933362..37970bf 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 7 13:08:32 UTC 2020 - Tomáš Chvátal + +- Do not use alternatives on HPC as it is pain to get it working + ------------------------------------------------------------------- Tue Apr 7 11:55:43 UTC 2020 - Tomáš Chvátal diff --git a/python-numpy.spec b/python-numpy.spec index 5bab68c..9b8cbd1 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -192,7 +192,9 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" %python_exec setup.py install --prefix=%{p_prefix} --root=%{buildroot} -%prepare_alternative f2py +%if !%{with hpc} +%python_clone -a %{buildroot}%{p_bindir}/f2py +%endif %if 0%{?suse_version} %fdupes %{buildroot}%{p_prefix} @@ -256,21 +258,19 @@ pushd testing popd %endif +%if %{without hpc} %post -# can't use `python_install_alternative` because it also installs f2py3 -PRIO=$(echo %{python_version} | tr -d .) -%install_alternative f2py %{_bindir}/f2py%{python_version} $PRIO +%python_install_alternative f2py %postun -%uninstall_alternative f2py %{_bindir}/f2py%{python_version} +%python_uninstall_alternative f2py +%endif %files %{python_files} %doc README.md THANKS.txt -%ghost %{_sysconfdir}/alternatives/f2py -%{p_bindir}/f2py -%{p_bindir}/f2py%{python_version} -%python3_only %{p_bindir}/f2py3 %if %{without hpc} +%python_alternative %{bindir}/f2py +%python3_only %{bindir}/f2py3* %{python_sitearch}/numpy/ %{python_sitearch}/numpy-%{version}-py*.egg-info %license %{python_sitearch}/numpy/LICENSE.txt @@ -279,6 +279,7 @@ PRIO=$(echo %{python_version} | tr -d .) %exclude %{python_sitearch}/numpy/f2py/src/ %exclude %{python_sitearch}/numpy/core/lib/libnpymath.a %else +%python3_only %{p_bindir}/f2py* %{p_python_sitearch}/numpy/ %{p_python_sitearch}/numpy-%{version}-py*.egg-info %license %{p_python_sitearch}/numpy/LICENSE.txt