From 5224813656fdf14e51c81b50e3ea26da71536b56 Mon Sep 17 00:00:00 2001 From: Suyun Date: Sun, 3 May 2026 16:07:24 +0800 Subject: [PATCH] SPECS: Add python-rjieba --- SPECS/python-rjieba/python-rjieba.spec | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SPECS/python-rjieba/python-rjieba.spec diff --git a/SPECS/python-rjieba/python-rjieba.spec b/SPECS/python-rjieba/python-rjieba.spec new file mode 100644 index 000000000..d80a13d5b --- /dev/null +++ b/SPECS/python-rjieba/python-rjieba.spec @@ -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 +# +# SPDX-License-Identifier: MulanPSL-2.0 + +%global srcname rjieba + +Name: python-%{srcname} +Version: 0.2.1 +Release: %autorelease +Summary: jieba-rs Python binding +License: MIT +URL: https://github.com/messense/rjieba-py +#!RemoteAsset: sha256:af96d4a14f24b68e053024ab993ec008c868d85598f8af928f2424ff4d86bc44 +Source0: https://files.pythonhosted.org/packages/source/r/%{srcname}/%{srcname}-%{version}.tar.gz +#!RemoteAsset: sha256:c8bd8b356407b49f20161165441e7e821c215e5e2f3c9f95276de5253456ecb0 +Source1: https://github.com/software-vendor/python-rjieba-vendor/releases/download/vendor-%{version}/rjieba-%{version}-vendor.tar.bz2 +BuildSystem: pyproject + +BuildOption(prep): -a1 +BuildOption(install): -l %{srcname} -L + +BuildRequires: pyproject-rpm-macros +BuildRequires: pkgconfig(python3) +BuildRequires: rust +BuildRequires: python3dist(maturin) + +Provides: python3-%{srcname} +%python_provide python3-%{srcname} + +%description +%{summary}. + +%prep -a +mkdir -p .cargo +cat > .cargo/config.toml <<'EOF' +[source.crates-io] +replace-with = "vendored-sources" +[source.vendored-sources] +directory = "vendor" +EOF + +%generate_buildrequires +%pyproject_buildrequires + +%files -f %{pyproject_files} +%doc README.md +%license LICENSE + +%changelog +%autochangelog