diff --git a/python-pybind11.changes b/python-pybind11.changes index 7186fdb..38bd741 100644 --- a/python-pybind11.changes +++ b/python-pybind11.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Oct 16 20:47:43 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Sat Oct 16 19:47:43 UTC 2021 - Ben Greiner diff --git a/python-pybind11.spec b/python-pybind11.spec index e262ead..cad24a9 100644 --- a/python-pybind11.spec +++ b/python-pybind11.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pybind11 Version: 2.8.0 @@ -30,10 +36,15 @@ BuildRequires: %{python_module setuptools} BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc-c++ -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 BuildRequires: %{python_module numpy if (%python-base without python36-base)} +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -91,6 +102,10 @@ rm tests/test_embed/test_interpreter.py export PYTHONPATH=${PWD}/build/tests/ %pytest -k 'not (tests_build_wheel or tests_build_global_wheel)' +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pybind11-config + %post %python_install_alternative pybind11-config