%global forgeurl https://github.com/whereswaldon/kfreestyle2d %global commit 930dacf1d740e704622bb79fd058f2c6e3f4364a Name: kfreestyle2d Version: 0 %forgemeta Release: 4%{?dist} Summary: Unofficial Kinesis Freestyle 2 Userspace Linux Driver License: MIT URL: %{forgeurl} Source0: %{forgesource} Source1: kfreestyle2d@.service Source2: kfreestyle2d.rules BuildRequires: gcc BuildRequires: systemd-rpm-macros Requires: systemd-udev %description The Kinesis Freestyle 2 keyboard is a fantastic split keyboard for people who don't want RSI in their wrists. It has four multimedia keys on F8-F11 that do not work in Linux. This is a simple program that enables those keys. %prep %forgeautosetup # Use our CFLAGS sed -i -e '/^CC =/d ; /^CFLAGS =/d' makefile %build %{set_build_flags} %make_build %install install -D -p %{name} %{buildroot}%{_libexecdir}/%{name}/%{name} mkdir -p %{buildroot}%{_unitdir} install -D -p %{SOURCE1} %{buildroot}%{_userunitdir}/kfreestyle2d@.service install -D -p %{SOURCE2} %{buildroot}%{_udevrulesdir}/60-%{name}.rules %post if [ $1 -eq 1 ]; then # Initial installation udevadm control --reload udevadm trigger -s hidraw -p "ID_MODEL_FROM_DATABASE=Kinesis Freestyle 2" fi %postun # Upgrades and final removals udevadm control --reload udevadm trigger -s hidraw -p "ID_MODEL_FROM_DATABASE=Kinesis Freestyle 2" %files %license LICENSE %doc README.md %dir %{_libexecdir}/%{name}/ %attr(0755,-,-) %{_libexecdir}/%{name}/%{name} %{_userunitdir}/*.service %{_udevrulesdir}/*.rules %changelog * Sat Apr 20 2024 Aurelien Bompard - 0-1.20240420git930dacf - Initial package