%define pypiname rfc6555 %global commit e969a3f37bf673502b0759c56d4d3ee380ec672b %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define min_python_version 3.5 %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif Name: python3-%{pypiname} Version: 0.1.0 Release: %mkrel 2 Group: Development Summary: Python implementation of RFC 6555 License: Apache 2.0 URL: https://pypi.org/project/rfc6555/ Source0: https://github.com/sethmlarson/rfc6555/releases/download/v%{version}/%{pypiname}-%{version}.tar.gz BuildArch: noarch BuildRequires: pkgconfig(python3) >= %min_python_version %if 0%{!?py3_build:1} BuildRequires: python3dist(build) %endif BuildRequires: python3dist(setuptools) BuildRequires: python3dist(wheel) Requires: python3 >= %min_python_version %description Synchronous Python implementation of the Happy Eyeballs Algorithm described in RFC 6555. Provided with a single file and dead-simple API to allow easy vendoring and integration into other projects. %prep %autosetup -p1 -n %{pypiname}-%{version} %build %if 0%{?py3_build:1} %py3_build %else %__python3 -m build -nwx %endif %install %if 0%{?py3_install:1} %py3_install %else mkdir -p %{buildroot}%{python3_sitelib} cp -fp %{pypiname}.py %{buildroot}%{python3_sitelib} cp -fpr %{pypiname}.egg-info %{buildroot}%{python3_sitelib}/%{pypiname}-%{version}-py%{python3_version}.egg-info %endif %check %files %license LICENSE %doc *.rst %{python3_sitelib}/%{pypiname}.py %exclude %{python3_sitelib}/__pycache__ %{python3_sitelib}/%{pypiname}-*-py%{python3_version}.egg-info %changelog