# Needed for Python bootstrap #bcond_without tests %global python3_pkgversion 3.11 Name: python-pyproject-hooks Version: 1.0.0 Release: 2.ac12.py3.11%{?dist} Summary: Wrappers to call pyproject.toml-based build backend hooks # SPDX License: MIT URL: https://pypi.org/project/pyproject_hooks/ Source: %{pypi_source pyproject_hooks} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %global _description %{expand: This is a low-level library for calling build-backends in pyproject.toml-based project. It provides the basic functionality to help write tooling that generates distribution files from Python projects.} %description %_description %package -n python%{python3_pkgversion}-pyproject-hooks Summary: %{summary} %description -n python%{python3_pkgversion}-pyproject-hooks %_description %prep %autosetup -p1 -n pyproject_hooks-%{version} sed -i "/flake8/d" dev-requirements.txt %generate_buildrequires %pyproject_buildrequires %{?with_tests:dev-requirements.txt} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files pyproject_hooks %check %pyproject_check_import %if %{with tests} %pytest %endif 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}-pyproject-hooks -f %{pyproject_files} %doc README.rst %license LICENSE %changelog * Tue Apr 16 2024 Ding-Yi Chen - 1.0.0-2.ac12.py3.11 - Cut corner packaging