%global common_description %{expand: ASGI is a standard for Python asynchronous web apps and servers to communicate with each other, and positioned as an asynchronous successor to WSGI. This package includes ASGI base libraries, such as: * Sync-to-async and async-to-sync function wrappers, asgiref.sync * Server base classes, asgiref.server * A WSGI-to-ASGI adapter, in asgiref.wsgi} %bcond tests 0 %global python3_pkgversion 3.11 Name: python-asgiref Version: 3.7.2 Release: 2.ac12.py3.11%{?dist} Summary: ASGI specs, helper code, and adapters # main source code is BSD-3-Clause # bundled async-timeout is Apache-2.0 License: BSD-3-Clause AND Apache-2.0 URL: https://github.com/django/asgiref Source: %{pypi_source asgiref} BuildArch: noarch %description %{common_description} %package -n python%{python3_pkgversion}-asgiref Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel # https://github.com/django/asgiref/commit/9c6df6e02700092eb19adefff3552d44388f69b8 # This code is modified and probably cannot be unvendored. Provides: bundled(python3dist(async-timeout)) == 3.0.1 %description -n python%{python3_pkgversion}-asgiref %{common_description} %prep %autosetup -n asgiref-%{version} # avoid additional mypy build requirement sed '/^\s*mypy\s*>=/d' -i setup.cfg %generate_buildrequires %pyproject_buildrequires %{?with_tests:} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files asgiref %check %if %{with tests} %pytest --verbose %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}-asgiref -f %{pyproject_files} %doc README.rst %changelog * Mon Apr 15 2024 Ding-Yi Chen - 3.7.2-2.ac12.py3.11 - Cut corner packaging