%global python3_pkgversion 3.11 # TODO adjust once this is implemented: # https://bugzilla.redhat.com/show_bug.cgi?id=1935266 %global modname jaraco %global projname %{modname}.context %global pkgname %{modname}-context #bcond_without tests Name: python-%{pkgname} Version: 4.3.0 Release: 2.ac16.py3.11%{?dist} Summary: Context managers by jaraco License: MIT URL: https://github.com/jaraco/%{projname} Source0: %{pypi_source %{projname}} Patch1: 0001-Disable-linters.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %global _description %{expand: Context managers by jaraco.} %description %_description %package -n python%{python3_pkgversion}-%{pkgname} Summary: %{summary} %description -n python%{python3_pkgversion}-%{pkgname} %_description %prep %autosetup -n %{projname}-%{version} %generate_buildrequires %if %{with tests} %pyproject_buildrequires -t %else %pyproject_buildrequires %endif %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{modname} %check %if %{with tests} %else %pyproject_check_import %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}-%{pkgname} -f %{pyproject_files} %license LICENSE %doc README.rst CHANGES.rst %changelog * Mon May 13 2024 Ding-Yi Chen - 4.3.0-2.ac16.py3.11 - Cut corner packaging