File sonix-flasher.spec of Package sonix-flasher
#
# spec file for package sonix-flasher
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: sonix-flasher
Version: 0.2.5+git4.20230509
Release: 0
Summary: Firmware tool for SN32F260/SN32F240B based keyboards
License: djbware
Group: Hardware/Other
URL: https://github.com/SonixQMK/sonix-flasher
Source: %{name}-%{version}.tar.gz
Source1: 52-sonix-flasher.rules
Requires: python3-fbs
BuildArch: noarch
%description
Firmware tool for SN32F260/SN32F240B based keyboards
%prep
%autosetup
rm -rf .github .gitignore
%build
%install
mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_datadir}
cp -a ../%{name}-%{version} %{buildroot}/%{_datadir}/%{name}
cat > %{buildroot}/%{_bindir}/%{name} <<EOF
#!/bin/sh
cd %{_datadir}/%{name}
exec fbs run
EOF
chmod 755 %{buildroot}/%{_bindir}/%{name}
install -m 644 -D -t %{buildroot}%{_prefix}/lib/udev/rules.d %{SOURCE1}
%files
%doc README.md
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_prefix}/lib/udev/rules.d/*
%changelog