14
0

- Convert to libalternatives on SLE-16-based and newer systems

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fasttext?expand=0&rev=13
This commit is contained in:
2025-08-19 13:19:52 +00:00
committed by Git OBS Bridge
parent db96e3713d
commit a7b38b1ffa
2 changed files with 34 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Aug 19 13:15:46 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
-------------------------------------------------------------------
Thu Oct 10 05:20:36 UTC 2024 - Jiri Slaby <jslaby@suse.cz>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-fasttext
#
# 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
@@ -20,6 +20,11 @@
%define sover 0
# Using annotation futures and dataclasses
%define skip_python36 1
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-fasttext
Version: 0.9.2
@@ -39,19 +44,26 @@ BuildRequires: %{python_module pybind11-devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: ninja
BuildRequires: python-rpm-macros
Requires: fasttext
Requires: python-numpy
Requires: python-pybind11 >= 2.2
Requires: python-setuptools >= 0.7.0
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
# SECTION test requirements
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pybind11 >= 2.2}
BuildRequires: %{python_module setuptools >= 0.7.0}
# /SECTION
BuildRequires: fdupes
Requires: fasttext
Requires: python-numpy
Requires: python-pybind11 >= 2.2
Requires: python-setuptools >= 0.7.0
%python_subpackages
%description
@@ -106,6 +118,7 @@ export LDFLAGS=-L%{__builddir}
%install
%cmake_install
%pyproject_install
%python_clone -a %{buildroot}/%{_bindir}/fasttext
%{python_expand :
%fdupes %{buildroot}%{$python_sitearch}
}
@@ -115,6 +128,15 @@ export LDFLAGS=-L%{__builddir}
%ldconfig_scriptlets -n libfasttext%{sover}
%pre
%python_libalternatives_reset_alternative fasttext
%post
%python_install_alternative fasttext
%postun
%python_uninstall_alternative fasttext
%files %{python_files}
%license LICENSE
%{python_sitearch}/fasttext
@@ -124,7 +146,7 @@ export LDFLAGS=-L%{__builddir}
%files -n fasttext
%doc README.md docs/
%license LICENSE
%{_bindir}/fasttext
%python_alternative %{_bindir}/fasttext
%files -n fasttext-devel
%dir %{_includedir}/fasttext