14
0
forked from pool/python-Cython

Convert to libalternatives, bsc#1245883

This commit is contained in:
2025-10-23 11:42:07 +02:00
parent 620f2792c4
commit 47f9aee98b
2 changed files with 23 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Aug 13 12:01:11 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 1 11:44:25 UTC 2025 - Markéta Machová <mmachova@suse.com> Tue Apr 1 11:44:25 UTC 2025 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-Cython # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -17,6 +17,11 @@
%bcond_with test %bcond_with test
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-Cython Name: python-Cython
Version: 3.0.12 Version: 3.0.12
@@ -25,7 +30,7 @@ Summary: The Cython compiler for writing C extensions for the Python lang
License: Apache-2.0 License: Apache-2.0
URL: https://cython.org/ URL: https://cython.org/
# SourceRepository: https://github.com/cython/cython # 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 Source1: python-Cython-rpmlintrc
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
@@ -35,11 +40,16 @@ BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-devel Requires: python-devel
Requires(post): update-alternatives
Requires(postun): update-alternatives
Conflicts: python-Cython < 3 Conflicts: python-Cython < 3
Provides: python-Cython3 = %{version} Provides: python-Cython3 = %{version}
Obsoletes: 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 %python_subpackages
%description %description
@@ -66,6 +76,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
for p in cython cythonize cygdb ; do for p in cython cythonize cygdb ; do
%python_clone -a %{buildroot}%{_bindir}/$p %python_clone -a %{buildroot}%{_bindir}/$p
done done
%python_group_libalternatives cython cythonize cygdb
%{python_expand chmod a+x %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py %{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 sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py
@@ -81,6 +92,9 @@ $python runtests.py -v
} }
%endif %endif
%pre
%python_libalternatives_reset_alternative cython
%post %post
%python_install_alternative cython cythonize cygdb %python_install_alternative cython cythonize cygdb