From 327b4973938121a0624e8f88e064cba04315a52a27a6057688e3ab7bed5f2da4 Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Wed, 27 Oct 2021 12:48:51 +0000 Subject: [PATCH] Accepting request 927769 from home:schubi2 - Use libalternatives instead of update-alternatives. Ben, the latest updates regarding python-macros, python36-ipython715 and rpmlint are available now. Are there still open points now ? OBS-URL: https://build.opensuse.org/request/show/927769 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-server?expand=0&rev=38 --- python-jupyter-server.changes | 5 +++++ python-jupyter-server.spec | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/python-jupyter-server.changes b/python-jupyter-server.changes index 802de3f..6dc10b7 100644 --- a/python-jupyter-server.changes +++ b/python-jupyter-server.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Oct 17 18:39:09 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Sun Oct 17 17:39:09 UTC 2021 - Ben Greiner diff --git a/python-jupyter-server.spec b/python-jupyter-server.spec index 5cfaf38..f81b7c5 100644 --- a/python-jupyter-server.spec +++ b/python-jupyter-server.spec @@ -16,6 +16,13 @@ # +# +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-jupyter-server @@ -48,7 +55,7 @@ BuildRequires: %{python_module websocket-client} # We need the full stdlib BuildRequires: %{pythons} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-Jinja2 Requires: python-Send2Trash Requires: python-anyio >= 3.1.0 @@ -65,8 +72,13 @@ Requires: python-terminado >= 0.8.3 Requires: python-tornado >= 6.1 Requires: python-traitlets >= 4.2.1 Requires: python-websocket-client +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif Provides: python-jupyter_server = %{version}-%{release} Obsoletes: python-jupyter_server < %{version}-%{release} # SECTION extras_require test @@ -92,6 +104,7 @@ languages, sharing, and interactive widgets. %package test Summary: The backend to Jupyter web applications - test requirements +Group: Development/Languages/Python Requires: python-ipykernel Requires: python-jupyter-server = %{version} Requires: python-pytest >= 6 @@ -130,6 +143,10 @@ if [ -e ~/.local/share/jupyter ]; then fi %pytest jupyter_server +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative jupyter-server + %post %python_install_alternative jupyter-server