Name: lgl-keychron-helper Version: 1.2.0 Release: 3%{?dist} Summary: Linux desktop helper for configuring supported Keychron devices via Keychron Launcher # The bundled Electron runtime and its shared libraries are prebuilt binaries, not # compiled by Fedora's own toolchain, so RPM's automatic debuginfo/GDB-index # generation (find-debuginfo.sh) fails against them (objcopy can't add a # .gdb_index section). Disabling debuginfo package generation is the standard # fix for RPMs that bundle prebuilt binaries like this (also done by VS Code, # and unofficial Slack/Discord RPMs, for the same reason). %global debug_package %{nil} License: MIT URL: https://github.com/linuxgamerlife/lgl-keychron-helper # .copr/Makefile's srpm target builds this tarball locally with `git archive # --prefix=%%{name}-%%{version}/ HEAD`, so it matches %%autosetup's default # assumption below (no -n override needed). This decouples RPM releases from # GitHub tags/releases entirely — COPR's SCM build method just checks out the # repo at whatever commit is configured and archives HEAD directly; bumping # this spec's Version (and packaging a new build) is the only thing required # for a release, no separate git tag or GitHub release needed. Source0: %{name}-%{version}.tar.gz # BuildArch is only valid as "noarch"; a real arch name there breaks # rpmbuild's SRPM generation ("No compatible architectures found for build"). # This package bundles prebuilt x86_64-only Electron binaries, so restrict # eligible build architectures with ExclusiveArch instead. ExclusiveArch: x86_64 BuildRequires: nodejs >= 22 BuildRequires: npm BuildRequires: desktop-file-utils BuildRequires: systemd-rpm-macros Requires: polkit Requires: systemd-udev # @electron/packager downloads a prebuilt Electron binary during `npm ci` # (electron's own postinstall step), so %build needs network access. Source0 # above no longer needs any fetch at all (it's built locally by .copr/Makefile # before rpmbuild ever runs), but %build's own npm-driven download still needs # COPR's "Enable networking during builds" project option, since Fedora's # official koji/mock build environment disables network access during # %build/%install by default otherwise. Vendoring node_modules would be needed # to make this hermetic; that's a deliberate follow-up, not done here. %description LGL Keychron Helper is a Linux desktop wrapper for the official Keychron Launcher web app. It bundles the Chromium/Electron runtime Launcher requires, provides WebHID device access, and guides users through Linux USB permissions via narrow, audited udev rules installed through PolicyKit. %prep %autosetup %build npm ci npm run package %install rm -rf %{buildroot} # Application payload: the bundled Electron runtime + compiled app, as produced # by `npm run package` (scripts/package.mjs). A private application directory, # not shared libraries for ld.so — %%{_prefix}/lib, not the arch-suffixed # %%{_libdir} (/usr/lib64 on x86_64). install -d %{buildroot}%{_prefix}/lib/%{name} cp -a out/%{name}-linux-x64/. %{buildroot}%{_prefix}/lib/%{name}/ # @electron/packager creates its output directory (and only that top-level # directory) with mode 0700 — fine for a local dev output folder, but cp -a # preserves that into the buildroot, which would block every non-root user # from even traversing into the installed app directory. Individual file # permissions are already correct; only the directory traversal bit is wrong. chmod -R a+rX %{buildroot}%{_prefix}/lib/%{name} # Thin launcher script on PATH. install -d %{buildroot}%{_bindir} cat > %{buildroot}%{_bindir}/%{name} <&2 udevadm trigger --wait-daemon=10 --settle --subsystem-match=hidraw || \ echo "warning: could not apply Keychron HID permissions to connected devices" >&2 udevadm trigger --wait-daemon=10 --settle --subsystem-match=usb || \ echo "warning: could not apply USB DFU permissions to connected devices" >&2 %postun udevadm control --reload-rules || echo "warning: could not reload udev rules" >&2 udevadm trigger --wait-daemon=10 --settle --subsystem-match=hidraw || \ echo "warning: could not refresh HID permissions on connected devices" >&2 udevadm trigger --wait-daemon=10 --settle --subsystem-match=usb || \ echo "warning: could not refresh USB permissions on connected devices" >&2 %changelog * Sun Sep 06 2026 LinuxGamerLife - 1.2.0-3 - Add a File-menu action that restores both device-permission rules through one authenticated, verified operation. - Fall back to the bundled installer when an older installed RPM does not contain the combined helper. * Sun Sep 06 2026 LinuxGamerLife - 1.2.0-2 - Wait for udev to apply the packaged HID and USB rules to connected devices, and expose scriptlet failures instead of silently discarding them. * Sun Sep 06 2026 LinuxGamerLife - 1.2.0-1 - Fix firmware updates over WebUSB (K4 HE DFU mode, K9 Max): the app was missing a select-usb-device permission handler entirely, not blocked by an upstream Electron bug as previously documented. New device picker lets the user choose the correct USB device, since Electron's Linux WebUSB backend doesn't expose enough descriptor data to auto-identify it. - Fix File > Remove Device Permissions to also remove the USB firmware-update udev rule, not just the HID one — now via a single combined pkexec authentication prompt, with a post-removal check that both rules are actually gone. - Guide the user through installing the USB firmware-update udev rule via pkexec if it's missing when picking a device, same as the existing HID permission flow. - Add a permanent "Toggle Developer Tools" menu item (View menu) for future debugging; the custom menu had been silently dropping the default Ctrl+Shift+I/F12 shortcut. - Fix chrome-sandbox setuid bit actually being applied: the previous %files ordering let a later directory glob silently override the %attr(4755) fix from 1.0.1, so the sandbox was never actually configured despite that fix shipping. * Sun Sep 06 2026 LinuxGamerLife - 1.1.0-1 - Add a second udev rule (70-lgl-usb-dfu.rules) granting access to any USB DFU-class bootloader device, so firmware-flashing tools work for any Keychron board that uses one, without a per-chip rule update. Installed automatically by this package, same as the existing HID rule. * Sat Jul 18 2026 LinuxGamerLife - 1.0.1-1 - New app icon. - Fix About popup height/resize behavior. - Clarify Remove Device Permissions popup for Fedora RPM users. * Fri Jul 17 2026 LinuxGamerLife - 1.0.0-1 - Initial RPM release.