%global pypi_name pytricia Name: python-pytricia Version: 1.3.0 Release: %autorelease Summary: A library for fast IP address lookup in Python License: LGPL-3.0-or-later URL: https://github.com/jsommers/pytricia Source: %{pypi_source %{pypi_name} %{version} tar.gz} # This is the version 1.3.0 test file from the git repo Source1: test.py BuildRequires: python3-devel BuildRequires: gcc BuildRequires: python3dist(setuptools) BuildRequires: python3dist(wheel) %description Pytricia is a new python module to store IP prefixes in a patricia tree. %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{summary} %prep %autosetup -n %{pypi_name}-%{version} cp %{SOURCE1} . %generate_buildrequires %pyproject_buildrequires %build # Disable assertions in the C extensions in production build export CFLAGS="${CFLAGS:-} -DNDEBUG" %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pyproject_check_import PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} -m unittest test.py %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md %license COPYING %license COPYING.LESSER %changelog %autochangelog