summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatcom8862020-08-09 12:09:40 +0200
committersatcom8862020-08-09 12:09:40 +0200
commitd235b1b9904a90df9a808363cbc8f1b38358eaee (patch)
tree1153f9fcda22c939b20843cac9f5b18c39d4ccfd
downloadaur-d235b1b9904a90df9a808363cbc8f1b38358eaee.tar.gz
Initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--77-controlloid-uinput.rules1
-rw-r--r--PKGBUILD47
-rw-r--r--controlloid-server.service8
-rwxr-xr-xcontrolloid-server.sh12
-rw-r--r--controlloid.sysusers1
6 files changed, 100 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ed39b985c9b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = controlloid-server-git
+ pkgdesc = The server for the Android app Controlloid.
+ pkgver = r23.1137a81
+ pkgrel = 1
+ url = https://github.com/experiment322/controlloid-server
+ arch = x86_64
+ arch = i686
+ arch = armv6
+ arch = armv7
+ arch = aarch64
+ license = GPLv3
+ makedepends = make
+ makedepends = git
+ makedepends = gcc
+ makedepends = cmake
+ depends = websocketd
+ depends = iproute2
+ provides = controlloid-server
+ source = controlloid-server::git+https://github.com/experiment322/controlloid-server
+ source = controlloid-server.sh
+ source = controlloid-server.service
+ source = controlloid.sysusers
+ source = 77-controlloid-uinput.rules
+ md5sums = SKIP
+ md5sums = 533ff33f7024a3efbf27584e01a86c79
+ md5sums = 32f432c01af51b24a5382a5a0718dc61
+ md5sums = 75a9fb6c38015c6da123e7633a216ec5
+ md5sums = 76b1380215f173064b7c89553394c372
+
+pkgname = controlloid-server-git
+
diff --git a/77-controlloid-uinput.rules b/77-controlloid-uinput.rules
new file mode 100644
index 00000000000..a866308a74a
--- /dev/null
+++ b/77-controlloid-uinput.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="controlloid"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..be00faf5b4a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: satcom886 <rostik.medved@gmail.com>
+
+pkgname=controlloid-server-git
+pkgver=r23.1137a81
+pkgrel=1
+pkgdesc="The server for the Android app Controlloid."
+arch=('x86_64' 'i686' 'armv6' 'armv7' 'aarch64')
+url="https://github.com/experiment322/controlloid-server"
+license=('GPLv3')
+groups=()
+depends=('websocketd' 'iproute2')
+makedepends=('make' 'git' 'gcc' 'cmake')
+optdepends=()
+provides=('controlloid-server')
+source=("controlloid-server::git+https://github.com/experiment322/controlloid-server"
+ "controlloid-server.sh"
+ "controlloid-server.service"
+ "controlloid.sysusers"
+ "77-controlloid-uinput.rules")
+md5sums=('SKIP'
+ '533ff33f7024a3efbf27584e01a86c79'
+ '32f432c01af51b24a5382a5a0718dc61'
+ '75a9fb6c38015c6da123e7633a216ec5'
+ '76b1380215f173064b7c89553394c372')
+
+pkgver() {
+ cd "$srcdir/controlloid-server"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cmake \
+ -S "$srcdir/controlloid-server/src/linux/" \
+ -B "$srcdir/controlloid-server/src/linux/cmake-build-release" \
+ -DCMAKE_BUILD_TYPE='None' \
+ -DCMAKE_INSTALL_PREFIX="/usr/bin/controlloid"
+ make "$srcdir/controlloid-server/src/linux/cmake-build-release"
+}
+
+package() {
+ install -Dm 755 "${srcdir}/controlloid-server.sh" "${pkgdir}/usr/bin/controlloid-server"
+ install -Dm 644 "${srcdir}/77-controlloid-uinput.rules" "${pkgdir}/usr/lib/udev/rules.d/77-controlloid-uinput.rules"
+ install -Dm 644 "${srcdir}/controlloid.sysusers" "${pkgdir}/usr/lib/sysusers.d/controlloid-server.conf"
+ install -Dm 644 "${srcdir}/controlloid-server.service" "${pkgdir}/usr/lib/systemd/user/controlloid-server.service"
+ cd "$srcdir/controlloid-server/src/linux/cmake-build-release"
+ make DESTDIR="$pkgdir/" install
+} \ No newline at end of file
diff --git a/controlloid-server.service b/controlloid-server.service
new file mode 100644
index 00000000000..7da21cd07e6
--- /dev/null
+++ b/controlloid-server.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=The server for the Android app Controlloid
+
+[Service]
+ExecStart=/usr/bin/controlloid-server
+
+[Install]
+WantedBy=default.target \ No newline at end of file
diff --git a/controlloid-server.sh b/controlloid-server.sh
new file mode 100755
index 00000000000..0844691d473
--- /dev/null
+++ b/controlloid-server.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# cd "$(dirname "${BASH_SOURCE[0]}")"
+
+LINK_FORMAT=$(printf '\e[34;4m')
+RESET_FORMAT=$(printf '\e[0m')
+
+echo "Server addresses:"
+ip -4 -o addr show scope global | awk '{gsub(/\/.*/,"",$4); print $2, "http://"$4":31415/"}' | sort | sed "s/\(http.\+\)/${LINK_FORMAT}\1${RESET_FORMAT}/"
+echo ""
+
+echo "Starting server..."
+websocketd --binary --port 31415 --staticdir=. /usr/bin/controlloid/bin/ws_handler
diff --git a/controlloid.sysusers b/controlloid.sysusers
new file mode 100644
index 00000000000..b87656fb98d
--- /dev/null
+++ b/controlloid.sysusers
@@ -0,0 +1 @@
+g controlloid 2997 \ No newline at end of file