%bcond_without check %global pname hid-parser %global commit 7d947404d8259bc42fbb81dd0d81bd6d315e4ef0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global snapshotdate 20210228 Name: python-hid-parser Version: 0.0.3 Release: 3.%{snapshotdate}git%{shortcommit}%{?dist} Summary: Parse HID report descriptors License: MIT URL: https://github.com/usb-tools/python-hid-parser Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildArch: noarch BuildRequires: python3-devel %global _desc %{expand: python-hid-parser is a typed pure Python library to parse HID report descriptors. } %description %_desc %package -n python3-%{pname} Summary: %{summary} %description -n python3-%{pname} %_desc %prep %autosetup -n %{name}-%{commit} %generate_buildrequires %if %{with check} %pyproject_buildrequires -x test %else %pyproject_buildrequires %endif %build %pyproject_wheel %install %pyproject_install %pyproject_save_files hid_parser %if %{with check} %check %pytest %endif %files -n python3-%{pname} -f %{pyproject_files} %doc README.md %license LICENSE %changelog * Fri Apr 21 2023 Dominik Mierzejewski - 0.0.3-3.20210228git7d94740 - update to latest git HEAD * Wed Mar 08 2023 Dominik Mierzejewski - 0.0.3-2 - use automatic BuildRequires generation - conditionalize running tests * Fri Jan 06 2023 Dominik Mierzejewski - 0.0.3-1 - initial build for Fedora