build: add systemd unit and udev rules

This commit is contained in:
Danny Robson 2019-02-23 21:48:41 +11:00
parent 4eddc80cd0
commit 2215082b87
6 changed files with 43 additions and 1 deletions

31
CMakeLists.txt Normal file
View File

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.10.0)
project(quimby
VERSION 0.0.1
HOMEPAGE_URL "https://nerdcruft.net"
LANGUAGES CXX
)
install(
FILES
systemd/system/quimby.service
DESTINATION
/usr/lib/systemd/system/
)
install(
FILES
udev/quimby.rules
DESTINATION
/etc/udev/rules.d/
)
install(
PROGRAMS
quimby-relay
quimby-cleanup
quimby-setup
DESTINATION
bin
)
include (CPack)

View File

@ -125,7 +125,7 @@ files = {
}
name = 'pitooth'
name = 'quimby'
root = os.path.join('/sys/kernel/config/usb_gadget/', name)
try:
os.mkdir(root)

View File

@ -0,0 +1,10 @@
[Unit]
Description=Quimby Input Forwarder
Requires=bluetooth.service
[Service]
Type=simple
ExecStartPre=/usr/local/bin/quimby-setup quimby
ExecStart=/usr/local/bin/quimby-relay /dev/input/event0 /dev/hidg0
ExecStop=/usr/local/bin/quimby-cleanup quimby

1
udev/quimby.rules Normal file
View File

@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="input", KERNEL=="event0", TAG+="systemd", ENV{SYSTEMD_WANTS}="quimby.service"