%global python3_pkgversion 3.11 %global srcname socksio %global _description %{expand: Client-side sans-I/O SOCKS proxy implementation. Supports SOCKS4, SOCKS4A, and SOCKS5. socksio is a sans-I/O library similar to h11 or h2, this means the library itself does not handle the actual sending of the bytes through the network, it only deals with the implementation details of the SOCKS protocols so you can use it in any I/O library you want.} Name: python-%{srcname} Version: 1.0.0 Release: 2.ac14.py3.11%{?dist} Summary: Client-side sans-I/O SOCKS proxy implementation License: MIT URL: https://github.com/sethmlarson/socksio Source: %pypi_source # downstream-only patch Patch: 0001-Relax-flit_core-dependency.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %description %{_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: %{py3_dist pytest} %description -n python%{python3_pkgversion}-%{srcname} %{_description} %prep %autosetup -n %{srcname}-%{version} -p 1 # drop coverage addopts rm pytest.ini %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{srcname} %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}-%{srcname} -f %{pyproject_files} %doc README.md CHANGELOG.md # flit does not mark licenses as License-Files yet %license %{python3_sitelib}/*.dist-info/LICENSE %changelog * Thu Apr 18 2024 Ding-Yi Chen - 1.0.0-2.ac14.py3.11 - Cut corner packaging