%global pypi_name unicode-segmentation-rs %global srcname unicode_segmentation_rs Name: python-%{pypi_name} Version: 0.2.0 Release: 1%{?dist} Summary: Unicode segmentation and width for Python using Rust License: MIT URL: https://github.com/WeblateOrg/unicode-segmentation-rs Source0: https://files.pythonhosted.org/packages/source/u/%{srcname}/%{srcname}-%{version}.tar.gz Source1: unicode-segmentation-rs-%{version}-vendor.tar.xz BuildRequires: python3-devel BuildRequires: python3-maturin BuildRequires: cargo BuildRequires: rust BuildRequires: gcc %description Python bindings for the Rust unicode-segmentation and unicode-width crates. It provides functions to correctly split strings by words, sentences, or grapheme clusters according to Unicode Standard Annex #29. %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{description} %prep %autosetup -n %{srcname}-%{version} -a 1 # --- FIX START --- # Relax maturin requirement because Fedora only has 1.9.6 # Upstream asks for 1.10, but 1.9 works fine. sed -i 's/maturin>=1.10/maturin>=1.9/' pyproject.toml # --- FIX END --- # Safety check if [ ! -f .cargo/config.toml ]; then echo "ERROR: .cargo/config.toml not found! Please check how you created the vendor tarball." exit 1 fi %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{srcname} %check %pyproject_check_import %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Wed Dec 10 2025 Sudip Shil - 0.2.0-1 - Initial package