From 83698b6e1cada5c4e52274e9ee40e46d3054429036657f3a9ad0b1d6a9ca90cb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 15 Jan 2025 12:59:49 +0000 Subject: [PATCH 1/2] - Use libalternatives instead of update-alternatives, bsc#1235782 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyserial?expand=0&rev=41 --- python-pyserial.changes | 5 +++++ python-pyserial.spec | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/python-pyserial.changes b/python-pyserial.changes index 9822a00..55c8d63 100644 --- a/python-pyserial.changes +++ b/python-pyserial.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 15 12:05:07 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1235782 + ------------------------------------------------------------------- Tue Sep 24 11:27:17 UTC 2024 - ecsos diff --git a/python-pyserial.spec b/python-pyserial.spec index bac09cb..8de5f27 100644 --- a/python-pyserial.spec +++ b/python-pyserial.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyserial # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?sle15_python_module_pythons} Name: python-pyserial Version: 3.5 @@ -27,12 +33,18 @@ URL: https://github.com/pyserial/pyserial Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz # PATCH-FIX-UPSTREAM - pyserial/pyserial#757 - Replace deprecated unittest.findTestCases function Patch1: https://github.com/pyserial/pyserial/pull/757.patch#/replace-deprecated-unittest-function.patch +BuildRequires: %{python_module base} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives -Requires(preun):update-alternatives +Requires(preun): update-alternatives +%endif Provides: python-serial = %{version} Obsoletes: python-serial < %{version} BuildArch: noarch @@ -53,8 +65,7 @@ Documentation, examples, and help files for %{name}. %endif %prep -%setup -q -n pyserial-%{version} -%patch -P 1 -p1 +%autosetup -p1 -n pyserial-%{version} # Unnecessary rm serial/tools/list_ports_windows.py \ @@ -92,6 +103,10 @@ rm documentation/_build/doctrees/environment.pickle %check %python_exec test/run_all_tests.py +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative normalizer + %post %python_install_alternative pyserial-miniterm %python_install_alternative pyserial-ports From 483208799b0597f349471d5a9b3e7272a5d74797fed006528b4559465d704e6f Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Fri, 17 Jan 2025 09:04:10 +0000 Subject: [PATCH 2/2] - fix alternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyserial?expand=0&rev=42 --- python-pyserial.changes | 5 +++++ python-pyserial.spec | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python-pyserial.changes b/python-pyserial.changes index 55c8d63..e593df2 100644 --- a/python-pyserial.changes +++ b/python-pyserial.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 17 09:03:51 UTC 2025 - Nico Krapp + +- fix alternatives + ------------------------------------------------------------------- Wed Jan 15 12:05:07 UTC 2025 - Nico Krapp diff --git a/python-pyserial.spec b/python-pyserial.spec index 8de5f27..2de2961 100644 --- a/python-pyserial.spec +++ b/python-pyserial.spec @@ -105,7 +105,8 @@ rm documentation/_build/doctrees/environment.pickle %pre # If libalternatives is used: Removing old update-alternatives entries. -%python_libalternatives_reset_alternative normalizer +%python_libalternatives_reset_alternative pyserial-miniterm +%python_libalternatives_reset_alternative pyserial-ports %post %python_install_alternative pyserial-miniterm