%global python3_pkgversion 3.11 %global pypi_name tomlkit %global common_description %{expand: TOML Kit is a 1.0.0-compliant TOML library. It includes a parser that preserves all comments, indentations, whitespace and internal element ordering, and makes them accessible and editable via an intuitive API. You can also create new TOML documents from scratch using the provided helpers. Part of the implementation has been adapted, improved and fixed from Molten.} Name: python-%{pypi_name} Summary: Style preserving TOML library Version: 0.12.4 Release: 2.ac16.py3.11%{?dist} License: MIT URL: https://github.com/sdispater/tomlkit Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel # test dependencies BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(pyyaml) %description %{common_description} %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} %description -n python%{python3_pkgversion}-%{pypi_name} %{common_description} %prep %autosetup -n %{pypi_name}-%{version} -p1 %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pytest for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Mon May 20 2024 Ding-Yi Chen - 0.12.4-2.ac16.py3.11 - Cut corner packaging