diff options
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 42 | ||||
-rw-r--r-- | ufw-valheim | 4 | ||||
-rw-r--r-- | valheim-server.service | 31 | ||||
-rw-r--r-- | valheim.sysusers | 2 | ||||
-rw-r--r-- | valheim.tmpfiles | 2 |
7 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0b1059a22f7d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = valheim-server + pkgdesc = Dedicated server for the Valheim PC game + pkgver = 0.148.7 + pkgrel = 1 + url = https://www.valheimgame.com/ + arch = x86_64 + license = custom:IronGateLicense + makedepends = steamcmd + depends = zlib + depends = gcc-libs + depends = lib32-glibc + backup = etc/ufw/applications.d/ufw-valheim + source = valheim-server.service + source = ufw-valheim + source = valheim.sysusers + source = valheim.tmpfiles + sha512sums = 25b73635f8ab8080fecc7cfa578efb49473563e89bc167243b821b1a6eb44d9eac33568df3d50f57d7d9c1d9de0290c22d91523abaa86cca8008503de20704b2 + sha512sums = 8c07f061baef278ca6b5bc6da111bf650c835c1b06a6c166f48f2fddea7e26b7c21a02628dfd1e9aa369ad16eb7f2387412b81465a4db5210a17e756f16f208a + sha512sums = c7d47a634e3c75a993e7eecef05b85fc1440316f82f88142cac0774ba56f5822463912e74207dfbdf3b419523fa5e1062da70bd5d1df50e1937e37ba44979613 + sha512sums = 86830550c1953137b876258db948af319181760a496c69c3580047f58c18746d70d720a2cfb34650a657a5944b41f1d73bf8aa8d003ffa459056755a2edda8af + +pkgname = valheim-server + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..ff1c958937ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.gz +*.xz +*.zst +pkg/ +src/
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..25c892de2bf0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Markus Sommer <markus@splork.de> +# +# The server does not accept a config file, but needs to be configured via startup options +# To edit the server options, run `systemctl edit --full valheim-server.service` and edit the `ExecStart`-line. +# this will create a new service file /etc/systemd/sys/valheim-server.service, based on the supplied file in /usr/lib/systemd/system/valheim-server.service with your edits +# Specifically, you probably want to edit the "-name" and "-password" options +# +# I created a macro for ufw, because that's what I use, if you have a macro for a different firewall, feel free to email me a patch. + +pkgname=valheim-server +pkgver=0.148.7 +pkgrel=1 +pkgdesc="Dedicated server for the Valheim PC game" +arch=('x86_64') +url='https://www.valheimgame.com/' +license=('custom:IronGateLicense') +depends=("zlib" "gcc-libs" "lib32-glibc") +makedepends=("steamcmd") +backup=("etc/ufw/applications.d/ufw-valheim") +source=('valheim-server.service' + 'ufw-valheim' + 'valheim.sysusers' + 'valheim.tmpfiles') +sha512sums=('25b73635f8ab8080fecc7cfa578efb49473563e89bc167243b821b1a6eb44d9eac33568df3d50f57d7d9c1d9de0290c22d91523abaa86cca8008503de20704b2' + '8c07f061baef278ca6b5bc6da111bf650c835c1b06a6c166f48f2fddea7e26b7c21a02628dfd1e9aa369ad16eb7f2387412b81465a4db5210a17e756f16f208a' + 'c7d47a634e3c75a993e7eecef05b85fc1440316f82f88142cac0774ba56f5822463912e74207dfbdf3b419523fa5e1062da70bd5d1df50e1937e37ba44979613' + '86830550c1953137b876258db948af319181760a496c69c3580047f58c18746d70d720a2cfb34650a657a5944b41f1d73bf8aa8d003ffa459056755a2edda8af') + +prepare() { + steamcmd +login anonymous +force_install_dir "$srcdir/$pkgname" +app_update 896660 +verify +quit +} + +package() { + cd $srcdir + mkdir -p "$pkgdir/opt" + cp -r $pkgname "$pkgdir/opt/" + + install -D -m 0644 valheim-server.service "$pkgdir/usr/lib/systemd/system/valheim-server.service" + install -D -m 0644 ufw-valheim "$pkgdir/etc/ufw/applications.d/ufw-valheim" + install -D -m 0644 valheim.sysusers "$pkgdir/usr/lib/sysusers.d/valheim.conf" + install -D -m 0644 valheim.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/valheim.conf" +}
\ No newline at end of file diff --git a/ufw-valheim b/ufw-valheim new file mode 100644 index 000000000000..dd4729d959c7 --- /dev/null +++ b/ufw-valheim @@ -0,0 +1,4 @@ +[Valheim] +title=Valheim +description=Valheim Dedicated Server +ports=2456:2458/udp
\ No newline at end of file diff --git a/valheim-server.service b/valheim-server.service new file mode 100644 index 000000000000..6cf26136c491 --- /dev/null +++ b/valheim-server.service @@ -0,0 +1,31 @@ +[Unit] +Description=Valheim Dedicated Server +After=network.target + +[Service] +Type=simple +User=valheim +Group=valheim +Environment="LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH" +ExecStart=/opt/valheim-server/valheim_server.x86_64 -name "Valheim" -password "secret" -port 2456 -world "world0" -public 1 +WorkingDirectory=/opt/valheim-server +KillSignal=SIGINT +NoNewPrivileges=true +ProtectSystem=full +ProtectHome=true +PrivateTmp=true +PrivateDevices=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +LockPersonality=true +MemoryDenyWriteExecute=false +RestrictRealtime=true +RestrictSUIDSGID=true +RemoveIPC=true +SystemCallFilter=@system-service +SystemCallArchitectures=native + +[Install] +WantedBy=multi-user.target
\ No newline at end of file diff --git a/valheim.sysusers b/valheim.sysusers new file mode 100644 index 000000000000..0103f457a343 --- /dev/null +++ b/valheim.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u valheim - "Valheim Dedicated server" /opt/valheim-server
\ No newline at end of file diff --git a/valheim.tmpfiles b/valheim.tmpfiles new file mode 100644 index 000000000000..13ec8c588086 --- /dev/null +++ b/valheim.tmpfiles @@ -0,0 +1,2 @@ +#Type Path Mode User Group Age Argument +d /opt/valheim-server 0755 valheim valheim
\ No newline at end of file |