%global pypi_name unicode-segmentation-rs %global srcname unicode_segmentation_rs Name: python-%{pypi_name} Version: 0.2.0 Release: 2%{?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 BuildRequires: python3-devel BuildRequires: rust-packaging BuildRequires: gcc %description Python bindings for the Rust unicode-segmentation and unicode-width crates. %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{description} %prep %autosetup -n %{srcname}-%{version} # Remove the lock file so we use Fedora's system versions of crates rm -f Cargo.lock # Fix maturin version requirement (Fedora has 1.9.x, upstream asks for 1.10) sed -i 's/maturin>=1.10/maturin>=1.9/' pyproject.toml # Configure cargo to use local Fedora registry instead of crates.io %cargo_prep %generate_buildrequires # This calculates BuildRequires based on Cargo.toml %cargo_generate_buildrequires # This calculates BuildRequires based on pyproject.toml %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 * Mon Dec 15 2025 Sudip Shil - 0.2.0-1 - Initial package using system Rust libraries