SHA256
1
0
forked from pool/python-numpy

Accepting request 920176 from devel:languages:python:numeric

revert - Use libalternatives instead of update-alternatives.

OBS-URL: https://build.opensuse.org/request/show/920176
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=94
This commit is contained in:
Matej Cepl 2021-09-19 17:42:02 +00:00 committed by Git OBS Bridge
parent 72ffe75e2f
commit b54abb607a
2 changed files with 2 additions and 40 deletions

View File

@ -1,8 +1,3 @@
-------------------------------------------------------------------
Sun Aug 22 16:28:30 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Fri Jul 16 15:14:36 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@ -1,5 +1,5 @@
#
# spec file for package python-numpy
# spec file
#
# Copyright (c) 2021 SUSE LLC
#
@ -16,12 +16,6 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%global flavor @BUILD_FLAVOR@%{nil}
%define ver 1.21.0
%define _ver 1_21_0
@ -125,13 +119,9 @@ 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
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
%endif
%python_subpackages
%description
@ -204,14 +194,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_exec setup.py install --prefix=%{p_prefix} --root=%{buildroot}
%if !%{with hpc}
%if ! %{with libalternatives}
%python_clone -a %{buildroot}%{_bindir}/f2py
%else
%python_clone %{buildroot}%{_bindir}/f2py
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/f2py
mkdir -p %{buildroot}%{_datadir}/libalternatives/f2py
%python_expand echo "binary=%{_bindir}/f2py-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/f2py/10%{$python_version_nodots}.conf
%endif
%python_clone -a %{buildroot}%{_bindir}/f2py
%endif
%if 0%{?suse_version}
@ -300,33 +283,17 @@ popd
%endif
%if %{without hpc}
%if %{with libalternatives}
%pre
# removing old update-alternatives entries
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
%python_uninstall_alternative f2py
fi
%else
%post
%python_install_alternative f2py
%postun
%python_uninstall_alternative f2py
%endif
%endif
%files %{python_files}
%doc README.md THANKS.txt
%if %{without hpc}
%if ! 0%{with libalternatives}
%python_alternative %{_bindir}/f2py
%else
%dir %{_datadir}/libalternatives
%dir %{_datadir}/libalternatives/f2py
%{_datadir}/libalternatives/f2py/10%python_version_nodots.conf
%{_bindir}/f2py
%{_bindir}/f2py-%python_version
%endif
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
%{_bindir}/f2py3
%endif