%global python3_pkgversion 3.11 %global pypi_name httpcore %if %{defined fedora} #bcond_without tests %endif Name: python-%{pypi_name} Version: 1.0.5 Release: 2.ac14.py3.11%{?dist} Summary: Minimal low-level HTTP client License: BSD URL: https://github.com/encode/httpcore Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description The HTTP Core package provides a minimal low-level HTTP client, which does one thing only: Sending HTTP requests. It does not provide any high level model abstractions over the API, does not handle redirects, multipart uploads, building authentication headers, transparent HTTP caching, URL parsing, etc. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if %{with tests} BuildRequires: %{py3_dist pytest pytest-asyncio pytest-httpbin pytest-trio anyio} %endif %description -n python%{python3_pkgversion}-%{pypi_name} The HTTP Core package provides a minimal low-level HTTP client, which does one thing only: Sending HTTP requests. It does not provide any high level model abstractions over the API, does not handle redirects, multipart uploads, building authentication headers, transparent HTTP caching, URL parsing, etc. %prep %autosetup -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info %generate_buildrequires %pyproject_buildrequires %{?with_tests:-x http2,socks} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %if %{with tests} %pytest -Wdefault %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}-%{pypi_name} -f %{pyproject_files} %license LICENSE.md %doc README.md %changelog * Thu Apr 18 2024 Ding-Yi Chen - 1.0.5-2.ac14.py3.11 - Cut corner packaging