summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris-Barboris2023-08-30 22:25:54 +0300
committerBoris-Barboris2023-08-30 22:25:54 +0300
commit501c47f0c01e6f6e6d42d3c552d71038ac02d6ff (patch)
treea2973522ea90a923f4a38e533cfffb9a539d8182
downloadaur-501c47f0c01e6f6e6d42d3c552d71038ac02d6ff.tar.gz
initial package version
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD58
-rw-r--r--evdev-proxy.service32
4 files changed, 117 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cba084306734
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = evdev-proxy-git
+ pkgdesc = Service that proxies evdev events from real to virtual devices
+ pkgver = 0.1.1.r1.3241460
+ pkgrel = 1
+ url = https://github.com/PapaTutuWawa/evdev-proxy
+ arch = i686
+ arch = pentium4
+ arch = x86_64
+ arch = arm
+ arch = armv7h
+ arch = armv6h
+ arch = aarch64
+ license = GPL3
+ makedepends = git
+ makedepends = cargo
+ makedepends = binutils
+ depends = gcc-libs
+ source = git+https://github.com/PapaTutuWawa/evdev-proxy
+ source = evdev-proxy.service
+ sha256sums = SKIP
+ sha256sums = 3fb50f83f9e9e501ae148c635bb142ebefd4fd18bd5b98a6ebb609fbe27f50b7
+
+pkgname = evdev-proxy-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b2bf683a9be0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+src
+pkg
+evdev-proxy
+*.pkg.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..44cf4a2f3302
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Boris-Barboris < ismailsiege at gmail dot com >
+pkgname=evdev-proxy-git
+pkgver=0.1.1.r1.3241460
+pkgrel=1
+pkgdesc="Service that proxies evdev events from real to virtual devices"
+arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
+url="https://github.com/PapaTutuWawa/evdev-proxy"
+license=('GPL3')
+depends=('gcc-libs')
+makedepends=('git' 'cargo' 'binutils')
+source=('git+https://github.com/PapaTutuWawa/evdev-proxy'
+ 'evdev-proxy.service')
+sha256sums=('SKIP'
+ '3fb50f83f9e9e501ae148c635bb142ebefd4fd18bd5b98a6ebb609fbe27f50b7')
+
+pkgver() {
+ cd "$srcdir/${pkgname%-git}"
+ printf "%s" "$(git describe --tags --long | sed 's/v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
+}
+
+prepare() {
+ export RUSTUP_TOOLCHAIN=stable
+ export CARGO_TARGET_DIR=target
+
+ cd "$srcdir/${pkgname%-git}"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}
+
+build() {
+ export RUSTUP_TOOLCHAIN=stable
+ export CARGO_TARGET_DIR=target
+
+ cd "$srcdir/${pkgname%-git}"
+ cargo build --release --frozen
+ strip target/release/evdev-proxy
+}
+
+# Testing is not strictly required as it is done by the CI/CD workflow on the git repository.
+# check() {
+# cd "$srcdir/${pkgname%-git}"
+# export RUSTUP_TOOLCHAIN=stable
+# export CARGO_TARGET_DIR=target
+# cargo test --release --frozen
+# }
+
+package() {
+ cd "$srcdir/${pkgname%-git}"
+
+ install -Dm755 target/release/evdev-proxy -t "${pkgdir}/usr/bin/"
+
+ # Install license and readme.
+ install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname%-git}/"
+
+ # Install default config, udev ruleset and systemd service
+ install -Dm644 config.toml -t "${pkgdir}/etc/${pkgname%-git}/"
+ install -Dm644 70-uinput-evdev-proxy.rules -t "${pkgdir}/etc/udev/rules.d/"
+ install -Dm644 ../evdev-proxy.service -t "${pkgdir}/usr/lib/systemd/system/"
+}
diff --git a/evdev-proxy.service b/evdev-proxy.service
new file mode 100644
index 000000000000..bb4160377925
--- /dev/null
+++ b/evdev-proxy.service
@@ -0,0 +1,32 @@
+[Unit]
+Description=Evdev proxy device daemon
+After=systemd-udevd.service
+Wants=multi-user.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/evdev-proxy
+Restart=always
+RestartSec=2
+Environment=RUST_BACKTRACE=1
+
+MemoryDenyWriteExecute=yes
+NoNewPrivileges=yes
+# Breaks AF_NETLINK connectivity to udev
+# PrivateNetwork=yes
+
+ProtectControlGroups=yes
+ProtectHome=yes
+ProtectHostname=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+ProtectKernelLogs=yes
+ProtectSystem=strict
+
+RestrictAddressFamilies=AF_NETLINK
+RestrictNamespaces=yes
+RestrictRealtime=yes
+RestrictSUIDSGID=yes
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file