Add debian packaging (dpkg-buildpackage)

- debian/control, rules, changelog, copyright
- postinst/prerm for systemd service enable/disable
- Makefile: add PREFIX support for packaging
- .gitignore: exclude build artifacts
This commit is contained in:
楼湘缘
2026-06-27 16:00:56 +08:00
parent 6c1bde1568
commit c9f379df04
9 changed files with 103 additions and 1 deletions
+9
View File
@@ -1,2 +1,11 @@
kbd
*.o
/*.deb
/*.ddeb
/*.buildinfo
/*.changes
/debian/files
/debian/*.debhelper*
/debian/*.substvars
/debian/fa608-kbd*
/debian/debhelper-build-stamp
+3 -1
View File
@@ -11,8 +11,10 @@ all: $(TARGET)
$(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
PREFIX ?= /usr/local
install: $(TARGET)
install -D -m 0755 $(TARGET) $(DESTDIR)/usr/local/bin/$(TARGET)
install -D -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
clean:
rm -f $(TARGET)
+8
View File
@@ -0,0 +1,8 @@
fa608-kbd (1.0.0) unstable; urgency=medium
* Initial release.
* ITE51368 HID feature report to switch EC mode.
* Brightness + RGB effect control via sysfs.
* systemd service for boot-time init.
-- 楼湘缘 <2216918339@qq.com> Sat, 27 Jun 2026 15:50:00 +0800
+28
View File
@@ -0,0 +1,28 @@
Source: fa608-kbd
Section: utils
Priority: optional
Maintainer: 楼湘缘 <2216918339@qq.com>
Build-Depends: debhelper-compat (= 13), libhidapi-dev, pkg-config
Standards-Version: 4.6.2
Homepage: https://gitee.com/louxian-yuan/fa608-kbd
Package: fa608-kbd
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, libhidapi-hidraw0
Description: ASUS TUF FA608 keyboard backlight CLI (INESE/中文)
kbd is a tiny C utility for controlling the keyboard backlight
on ASUS TUF Gaming A16 FA608 laptops.
.
It switches the ITE51368 (0B05:19B6) I2C HID keyboard controller
from Windows Dynamic Lighting mode to Embedded Controller mode,
then provides brightness and RGB effect control via sysfs.
.
Includes a systemd service for boot-time initialization.
.
一款轻量级 C 命令行工具,用于控制 ASUS TUF Gaming A16 FA608
笔记本的键盘背光。
.
通过发送 HID feature report 将 ITE51368 键盘控制器切换到 EC
模式,随后提供亮度调节和 RGB 灯效控制功能。
.
含 systemd 开机自动初始化服务。
+26
View File
@@ -0,0 +1,26 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: fa608-kbd
Source: https://gitee.com/louxian-yuan/fa608-kbd
Files: *
Copyright: 2026 楼湘缘
License: MIT
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
systemctl daemon-reload 2>/dev/null || true
systemctl enable kbd-init.service 2>/dev/null || true
systemctl start kbd-init.service 2>/dev/null || true
fi
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
systemctl stop kbd-init.service 2>/dev/null || true
systemctl disable kbd-init.service 2>/dev/null || true
fi
Vendored Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_build:
$(MAKE) PREFIX=/usr
override_dh_auto_install:
$(MAKE) install PREFIX=/usr DESTDIR=debian/fa608-kbd
override_dh_install:
dh_install
mkdir -p debian/fa608-kbd/lib/systemd/system
cp kbd-init.service debian/fa608-kbd/lib/systemd/system/
+1
View File
@@ -0,0 +1 @@
3.0 (native)