From 47f9aee98b021a75e494ccb153d9f048a0ab59d80c848b184370beb813dc4431 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 23 Oct 2025 11:42:07 +0200 Subject: [PATCH] Convert to libalternatives, bsc#1245883 --- python-Cython.changes | 5 +++++ python-Cython.spec | 22 ++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/python-Cython.changes b/python-Cython.changes index 7653332..37ecb48 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 13 12:01:11 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems + ------------------------------------------------------------------- Tue Apr 1 11:44:25 UTC 2025 - Markéta Machová diff --git a/python-Cython.spec b/python-Cython.spec index 2cbed8e..60e40ac 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -1,7 +1,7 @@ # # spec file for package python-Cython # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,6 +17,11 @@ %bcond_with test +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-Cython Version: 3.0.12 @@ -25,7 +30,7 @@ Summary: The Cython compiler for writing C extensions for the Python lang License: Apache-2.0 URL: https://cython.org/ # SourceRepository: https://github.com/cython/cython -Source: https://files.pythonhosted.org/packages/source/C/Cython/cython-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/c/cython/cython-%{version}.tar.gz Source1: python-Cython-rpmlintrc BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} @@ -35,11 +40,16 @@ BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros Requires: python-devel -Requires(post): update-alternatives -Requires(postun): update-alternatives Conflicts: python-Cython < 3 Provides: python-Cython3 = %{version} Obsoletes: python-Cython3 < %{version} +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %python_subpackages %description @@ -66,6 +76,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" for p in cython cythonize cygdb ; do %python_clone -a %{buildroot}%{_bindir}/$p done +%python_group_libalternatives cython cythonize cygdb %{python_expand chmod a+x %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py @@ -81,6 +92,9 @@ $python runtests.py -v } %endif +%pre +%python_libalternatives_reset_alternative cython + %post %python_install_alternative cython cythonize cygdb