From a9296b5348f9fc019ed2fa08500bff14a2831094ca94ff4d1003a2518e74c128 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Wed, 6 Oct 2021 09:12:54 +0000 Subject: [PATCH] Accepting request 923309 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923309 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-nbformat?expand=0&rev=19 --- python-nbformat.changes | 5 +++++ python-nbformat.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-nbformat.changes b/python-nbformat.changes index d8e23ee..1efd7cc 100644 --- a/python-nbformat.changes +++ b/python-nbformat.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 8 14:22:22 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Sat Apr 10 20:48:39 UTC 2021 - Ben Greiner diff --git a/python-nbformat.spec b/python-nbformat.spec index 6c63034..d073040 100644 --- a/python-nbformat.spec +++ b/python-nbformat.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-%{**}} %define doc_ver 5.0.4 Name: python-nbformat @@ -29,10 +35,15 @@ URL: https://github.com/jupyter/nbformat Source: %{url}/archive/%{version}.tar.gz#/nbformat-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 BuildRequires: unzip +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif Requires: jupyter-nbformat = %{version} Requires: python-ipython_genutils Requires: python-jsonschema > 2.5.0 @@ -89,6 +100,10 @@ This package provides the jupyter components. # we don't have the alternative validator, cannot fallback from it %pytest -k "not (fastjsonschema or test_fallback_validator_with_iter_errors_using_ref)" +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative jupyter-trust + %post %python_install_alternative jupyter-trust