summaryrefslogtreecommitdiff
path: root/hurrycurry-server-git
diff options
context:
space:
mode:
Diffstat (limited to 'hurrycurry-server-git')
-rw-r--r--hurrycurry-server-git/PKGBUILD65
-rw-r--r--hurrycurry-server-git/hurrycurry-registry.service33
-rw-r--r--hurrycurry-server-git/hurrycurry.service34
-rw-r--r--hurrycurry-server-git/hurrycurry.yaml0
-rw-r--r--hurrycurry-server-git/sysusers.conf1
-rw-r--r--hurrycurry-server-git/tmpfiles.conf2
6 files changed, 135 insertions, 0 deletions
diff --git a/hurrycurry-server-git/PKGBUILD b/hurrycurry-server-git/PKGBUILD
new file mode 100644
index 0000000..d6b6234
--- /dev/null
+++ b/hurrycurry-server-git/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: metamuffin <metamuffin@disroot.org>
+
+pkgname=hurrycurry-server-git
+pkgver=r1859.64e2704
+pkgrel=4
+pkgdesc="A game about cooking (server)"
+arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
+url="https://codeberg.org/hurrycurry/hurrycurry"
+license=('AGPL3')
+conflics=('hurrycurry-server')
+provides=('hurrycurry-server')
+makedepends=('rustup' 'deno' 'graphviz' 'godot')
+source=("git+https://codeberg.org/hurrycurry/hurrycurry.git"
+ "hurrycurry.service"
+ "hurrycurry-registry.service"
+ "hurrycurry.yaml"
+ "tmpfiles.conf"
+ "sysusers.conf")
+sha256sums=("SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP")
+
+pkgver() {
+ cd "hurrycurry"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+prepare() {
+ curl 'https://s.metamuffin.org/static/hurrycurry/book.pdf' -o book.pdf
+ cd "hurrycurry"
+ rustup default nightly
+ cargo +nightly fetch --locked --target "$CHOST"
+}
+build() {
+ cd "hurrycurry"
+ cargo +nightly build --frozen --release --target "$CHOST" --bin hurrycurry-server
+ cargo +nightly build --frozen --release --target "$CHOST" --bin hurrycurry-replaytool
+ cargo +nightly build --frozen --release --target "$CHOST" --bin hurrycurry-registry
+ cargo +nightly build --frozen --release --target "$CHOST" --bin hurrycurry-discover
+ make -C data all
+ make -C test-client
+ make -C data recipes/default.svg
+}
+package() {
+ install -Dm755 hurrycurry/target/$CHOST/release/hurrycurry-server "$pkgdir/usr/bin/hurrycurry-server"
+ install -Dm755 hurrycurry/target/$CHOST/release/hurrycurry-replaytool "$pkgdir/usr/bin/hurrycurry-replaytool"
+ install -Dm755 hurrycurry/target/$CHOST/release/hurrycurry-registry "$pkgdir/usr/bin/hurrycurry-registry"
+ install -Dm755 hurrycurry/target/$CHOST/release/hurrycurry-discover "$pkgdir/usr/bin/hurrycurry-discover"
+ install -Dm644 hurrycurry.service "$pkgdir/usr/lib/systemd/system/hurrycurry.service"
+ install -Dm644 hurrycurry-registry.service "$pkgdir/usr/lib/systemd/system/hurrycurry-registry.service"
+ install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/hurrycurry.conf"
+ install -Dm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/hurrycurry.conf"
+ install -Dm644 hurrycurry/COPYING "$pkgdir/usr/share/licenses/hurrycurry-server/COPYING"
+ install -Dm664 hurrycurry/test-client/main.js "$pkgdir/usr/share/hurrycurry/test-client/main.js"
+ install -Dm664 hurrycurry/test-client/index.html "$pkgdir/usr/share/hurrycurry/test-client/index.html"
+ install -dm755 "$pkgdir/usr/share/hurrycurry/test-client/locale"
+ install -Dm664 -t "$pkgdir/usr/share/hurrycurry/test-client/locale" hurrycurry/test-client/locale/*
+ install -Dm644 hurrycurry/data/index.yaml "$pkgdir/usr/share/hurrycurry/data/index.yaml"
+ install -Dm664 -t "$pkgdir/usr/share/hurrycurry/data/recipes" hurrycurry/data/recipes/*.yaml
+ install -Dm664 -t "$pkgdir/usr/share/hurrycurry/data/maps" hurrycurry/data/maps/*.yaml
+ install -Dm664 -t "$pkgdir/usr/share/doc/hurrycurry/recipes" hurrycurry/data/recipes/*.svg
+ install -Dm664 book.pdf "$pkgdir/usr/share/doc/hurrycurry/book.pdf"
+}
diff --git a/hurrycurry-server-git/hurrycurry-registry.service b/hurrycurry-server-git/hurrycurry-registry.service
new file mode 100644
index 0000000..bc50072
--- /dev/null
+++ b/hurrycurry-server-git/hurrycurry-registry.service
@@ -0,0 +1,33 @@
+[Unit]
+Description=hurrycurry server registry service
+After=network.target
+Wants=network-online.target
+
+[Service]
+Environment=XDG_DATA_HOME=/var/lib
+ExecStart=/usr/bin/hurrycurry-registry
+User=hurrycurry
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+NoNewPrivileges=yes
+PrivateDevices=true
+PrivateTmp=true
+ProtectClock=yes
+ProtectControlGroups=yes
+ProtectHome=true
+ProtectHostname=yes
+ProtectKernelLogs=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+ProtectSystem=full
+RestrictAddressFamilies=~AF_PACKET AF_NETLINK
+RestrictNamespaces=yes
+RestrictSUIDSGID=yes
+RestrictRealtime=yes
+Restart=always
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
diff --git a/hurrycurry-server-git/hurrycurry.service b/hurrycurry-server-git/hurrycurry.service
new file mode 100644
index 0000000..8e888e2
--- /dev/null
+++ b/hurrycurry-server-git/hurrycurry.service
@@ -0,0 +1,34 @@
+[Unit]
+Description=hurrycurry game server
+After=network.target
+Wants=network-online.target
+
+[Service]
+WorkingDirectory=/usr/share/hurrycurry
+Environment=XDG_DATA_HOME=/var/lib
+ExecStart=/usr/bin/hurrycurry-server
+User=hurrycurry
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+NoNewPrivileges=yes
+PrivateDevices=true
+PrivateTmp=true
+ProtectClock=yes
+ProtectControlGroups=yes
+ProtectHome=true
+ProtectHostname=yes
+ProtectKernelLogs=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+ProtectSystem=full
+RestrictAddressFamilies=~AF_PACKET AF_NETLINK
+RestrictNamespaces=yes
+RestrictSUIDSGID=yes
+RestrictRealtime=yes
+Restart=always
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
diff --git a/hurrycurry-server-git/hurrycurry.yaml b/hurrycurry-server-git/hurrycurry.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/hurrycurry-server-git/hurrycurry.yaml
diff --git a/hurrycurry-server-git/sysusers.conf b/hurrycurry-server-git/sysusers.conf
new file mode 100644
index 0000000..026ba33
--- /dev/null
+++ b/hurrycurry-server-git/sysusers.conf
@@ -0,0 +1 @@
+u hurrycurry - "hurrycurry game server" - -
diff --git a/hurrycurry-server-git/tmpfiles.conf b/hurrycurry-server-git/tmpfiles.conf
new file mode 100644
index 0000000..e14fa40
--- /dev/null
+++ b/hurrycurry-server-git/tmpfiles.conf
@@ -0,0 +1,2 @@
+d /var/lib/hurrycurry 0700 hurrycurry hurrycurry - -
+d /var/lib/hurrycurry-registry 0700 hurrycurry hurrycurry - -