From 0686c7f7e0167d24c911932e854d305a592cc9f35ce68d135abe99ddb8d2b870 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 5 Oct 2021 22:23:25 +0000 Subject: [PATCH] Accepting request 923224 from home:schubi2 - Use libalternatives instead of update-alternatives. - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923224 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipython?expand=0&rev=71 --- python-ipython.changes | 5 +++++ python-ipython.spec | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/python-ipython.changes b/python-ipython.changes index ff2bff0..ecb3582 100644 --- a/python-ipython.changes +++ b/python-ipython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 4 08:59:34 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Wed Sep 15 05:36:58 UTC 2021 - Arun Persaud diff --git a/python-ipython.spec b/python-ipython.spec index 2098835..d7279fa 100644 --- a/python-ipython.spec +++ b/python-ipython.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-ipython # # Copyright (c) 2021 SUSE LLC # @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -42,7 +48,7 @@ BuildRequires: %{python_module backcall} BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools >= 18.5} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-Pygments Requires: python-backcall Requires: python-base >= 3.7 @@ -82,8 +88,13 @@ BuildRequires: %{python_module ipython-iptest = %{version}} BuildRequires: desktop-file-utils BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif %if %{with ico} BuildRequires: icoutils %endif @@ -216,6 +227,15 @@ popd %endif %if !%{with test} + +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative ipython + +%pre iptest +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative iptest + %post %python_install_alternative ipython ipython3 ipython.1.gz ipython3.1.gz %desktop_database_post @@ -254,7 +274,6 @@ popd %files %{python_files iptest} %python_alternative %{_bindir}/iptest %python_alternative %{_bindir}/iptest3 - %endif %endif