Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SPECS/python-kenlm/2000-drop-cmake-dep.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,2 +1,2 @@
[build-system]
-requires = ["setuptools", "wheel", "cmake>=3.10"]
+requires = ["setuptools", "wheel"]
52 changes: 52 additions & 0 deletions SPECS/python-kenlm/python-kenlm.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors
# SPDX-FileContributor: Suyun <ziyu.oerv@isrc.iscas.ac.cn>
#
# SPDX-License-Identifier: MulanPSL-2.0

%global srcname kenlm

Name: python-%{srcname}
Version: 0.3.0
Release: %autorelease
Summary: KenLM: Faster and Smaller Language Model Queries
License: LGPL-3.0-or-later AND LGPL-2.1-or-later
URL: https://github.com/kpu/kenlm
#!RemoteAsset: sha256:c4628bb9fb63c8a6f9240035b8b037385cfc404cb72e933cf48878291edac1e8
Source0: https://files.pythonhosted.org/packages/source/k/%{srcname}/%{srcname}-%{version}.tar.gz
Patch0: 2000-drop-cmake-dep.patch
BuildSystem: pyproject

BuildOption(install): -l %{srcname} -L

BuildRequires: pyproject-rpm-macros
BuildRequires: pkgconfig(python3)
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: python3dist(cython)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(liblzma)

Provides: python3-%{srcname}
%python_provide python3-%{srcname}

%description
KenLM is a library for estimating, filtering, and querying
language models with significantly lower memory usage.

%prep
%autosetup -n %{srcname}-%{version}

%generate_buildrequires
%pyproject_buildrequires

%build -p
cython -3 --cplus python/kenlm.pyx -o python/kenlm.cpp

%files -f %{pyproject_files}
%{python3_sitearch}/libkenlm.so
%license LICENSE COPYING COPYING.3 COPYING.LESSER.3

%changelog
%autochangelog
Loading