File python-qmk.spec of Package python-qmk

# Created by pyp2rpm-3.3.5
%global pypi_name qmk
%global github_name qmk_cli
%global github_user qmk

Name:           python-%{pypi_name}
Version:        1.0.0
Release:        1%{?dist}
Summary:        A program to help you work with qmk_firmware

License:        MIT
URL:            https://github.com/qmk/qmk_cli
Source0:        https://github.com/%{github_user}/%{github_name}/archive/%{version}/%{github_name}-%{version}.tar.gz
Patch0:         python-qmk-fix_requires.patch
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3dist(pip) >= 19
BuildRequires:  python3dist(packaging)
BuildRequires:  python3dist(toml)
BuildRequires:  python3dist(setuptools) >= 42
BuildRequires:  python3dist(wheel)
BuildRequires:  python3dist(milc)

%description
A program to help users work with QMK Firmware.


%package -n     python3-%{pypi_name}
Summary:        %{summary} (Python library)
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
A program to help users work with QMK Firmware.

This package contains Python library.


%package -n     %{pypi_name}
Summary:        %{summary} (command line utility)
Requires:       python3-%{pypi_name} = %{?epoch:%{epoch}:}%{version}


%description -n %{pypi_name}
A program to help users work with QMK Firmware.

This package contains command line utility.


%prep
%autosetup -n %{github_name}-%{version} -p1

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files qmk_cli

%check
export QMK_HOME="$HOME/qmk_firmware"
%pyproject_check_import

%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE
%doc README.md

%files -n %{pypi_name}
%license LICENSE
%doc README.md
%{_bindir}/%{pypi_name}