%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} rm -f Cargo.lock #maturin version (Fedora has 1.9, upstream wants 1.10) sed -i 's/maturin>=1.10/maturin>=1.9/' pyproject.toml #removeing 'generate-import-lib' feature from Cargo.toml. #this feature is for Windows DLLs and is not provided by Fedora's rust-pyo3 package. sed -i 's/"generate-import-lib",//g' Cargo.toml #removing it if it's at the end of a list (cleanup) sed -i 's/, "generate-import-lib"//g' Cargo.toml %cargo_prep %generate_buildrequires %cargo_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 * Mon Dec 15 2025 Sudip Shil - 0.2.0-2 - Initial package using system Rust libraries