diff --git a/anda/system/cros-keyboard-map/anda.hcl b/anda/system/cros-keyboard-map/anda.hcl new file mode 100644 index 0000000000..137fe0fbf1 --- /dev/null +++ b/anda/system/cros-keyboard-map/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "cros-keyboard-map.spec" + } + labels { + nightly = "1" + } +} \ No newline at end of file diff --git a/anda/system/cros-keyboard-map/cros-keyboard-map.spec b/anda/system/cros-keyboard-map/cros-keyboard-map.spec new file mode 100644 index 0000000000..ff4a2c9467 --- /dev/null +++ b/anda/system/cros-keyboard-map/cros-keyboard-map.spec @@ -0,0 +1,89 @@ +%global commit 1889baff16c08ddf2382d95ca18caa37001d5971 +%global commit_date 20240418 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global debug_package %{nil} +%define __os_install_post %{nil} + +Name: cros-keyboard-map +Version: %commit_date.%shortcommit +Release: 1%?dist + +License: BSD-3-Clause +Summary: Utility to generate keyd configurations for use on Chromebooks +URL: https://github.com/WeirdTreeThing/cros-keyboard-map +Source0: https://github.com/WeirdTreeThing/cros-keyboard-map/archive/%commit/cros-keyboard-map-%commit.tar.gz + +%{?systemd_requires} +BuildRequires: systemd-rpm-macros +Requires: keyd python3 + +%description +Set of tools designed to help develop and debug software and firmware on Intel platforms with AudioDSP onboard. + +Related to alsa-utils which is also set of utilities but targets AdvancedLinuxSoundArchitecture (ALSA) audience in more general fashion. + +%prep +%autosetup -n cros-keyboard-map-%commit + +%install +mkdir -p %buildroot/etc/cros-keyboard-map/configs +install -Dm755 cros-keyboard-map.py %buildroot/etc/cros-keyboard-map/cros-keyboard-map.py +cp configs/* %buildroot/etc/cros-keyboard-map/configs + +mkdir -p %buildroot/usr/bin +tee %buildroot/usr/bin/um-generate-cros-keymap < /dev/null) +then + cp /etc/cros-keyboard-map/configs/cros-pixel.conf /etc/cros-keyboard-map/current.config +elif (grep -E "^(Sarien|Arcada)$" /sys/class/dmi/id/product_name &> /dev/null) +then + cp /etc/cros-keyboard-map/configs/cros-sarien.conf /etc/cros-keyboard-map/current.config +else + python3 /etc/cros-keyboard-map/cros-keyboard-map.py --file /etc/cros-keyboard-map/current.config +fi + +mkdir -p /etc/keyd +if [[ -f /etc/keyd/default.conf ]]; then + rm /etc/keyd/default.conf +fi +ln -s /etc/cros-keyboard-map/current.config /etc/keyd/default.conf +EOF + +mkdir -p %buildroot/etc/systemd/system +tee %buildroot/etc/systemd/system/cros-keyboard-map.service < +- Initial package. diff --git a/anda/system/cros-keyboard-map/update.rhai b/anda/system/cros-keyboard-map/update.rhai new file mode 100644 index 0000000000..46a9eeca30 --- /dev/null +++ b/anda/system/cros-keyboard-map/update.rhai @@ -0,0 +1,7 @@ +if filters.contains("nightly") { + rpm.global("commit", gh_commit("WeirdTreeThing/cros-keyboard-map")); + if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); + } +}