From ec3cef513335f49214b9b7d467bb48823d92ab7a27711c638138aa4458dc42f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 9 Jun 2025 09:33:51 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpath-rw?expand=0&rev=17 --- python-jsonpath-rw.changes | 5 +++++ python-jsonpath-rw.spec | 17 ++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python-jsonpath-rw.changes b/python-jsonpath-rw.changes index a9c7454..0a60dc3 100644 --- a/python-jsonpath-rw.changes +++ b/python-jsonpath-rw.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jun 9 09:27:29 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Fri May 30 08:59:24 UTC 2025 - Markéta Machová diff --git a/python-jsonpath-rw.spec b/python-jsonpath-rw.spec index e0bc023..ef8758d 100644 --- a/python-jsonpath-rw.spec +++ b/python-jsonpath-rw.spec @@ -16,11 +16,8 @@ # -# detritus in /etc/alternatives from brp-python-bytecompile must be removed -%define __os_install_post %(echo '%__os_install_post; \ - rm -f %{buildroot}%{_sysconfdir}/alternatives/jsonpath.pyo; \ - rm -f %{buildroot}%{_sysconfdir}/alternatives/jsonpath.pyc') %define modname jsonpath-rw +%bcond_without libalternatives Name: python-jsonpath-rw Version: 1.4.0 Release: 0 @@ -34,12 +31,12 @@ BuildRequires: %{python_module ply} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: %{python_module wheel} +BuildRequires: alts BuildRequires: python-rpm-macros +Requires: alts Requires: python-decorator Requires: python-ply >= 3.4 Requires: python-six -Requires(post): alts -Requires(postun): alts BuildArch: noarch %python_subpackages @@ -64,11 +61,9 @@ sed -i '/^#!/ d' jsonpath_rw/bin/jsonpath.py %pyproject_install %python_clone -a %{buildroot}%{_bindir}/jsonpath.py -%post -%python_install_alternative jsonpath.py - -%postun -%python_uninstall_alternative jsonpath.py +%pre +# removing old update-alternatives entries +%python_libalternatives_reset_alternative jsonpath.py %files %{python_files} %doc README.rst