%global pypi_name dissect.cstruct %global pypi_name_with_underscore %(echo "%{pypi_name}" | sed "s/\\./_/g") Name: python-%{pypi_name} Version: 4.6 Release: %autorelease Summary: Dissect module implementing a parser for C-like structures License: Apache-2.0 URL: https://github.com/fox-it/dissect.cstruct Source: %{pypi_source %{pypi_name_with_underscore}} BuildArch: noarch BuildRequires: python3-devel %global common_description %{expand: A Dissect module implementing a parser for C-like structures. Structure parsing in Python made easy. With cstruct, you can write C-like structures and use them to parse binary data, either as file-like objects or byte-strings.} %description %{common_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{common_description} %prep %autosetup -p1 -n %{pypi_name_with_underscore}-%{version} %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files dissect %check %tox %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md %{_bindir}/cstruct-stubgen %changelog %autochangelog