Name: lgl-keychron-helper Version: 1.1.0 Release: 1%{?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} </dev/null 2>&1 || : udevadm trigger --subsystem-match=hidraw >/dev/null 2>&1 || : udevadm trigger --subsystem-match=usb >/dev/null 2>&1 || : %postun udevadm control --reload-rules >/dev/null 2>&1 || : udevadm trigger --subsystem-match=hidraw >/dev/null 2>&1 || : udevadm trigger --subsystem-match=usb >/dev/null 2>&1 || : %changelog * 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.