diff options
author | Matthias Ahouansou <matthias@ahouansou.cz> | 2024-03-24 11:07:51 +0000 |
---|---|---|
committer | omni <omni+alpine@hack.org> | 2024-03-24 12:29:10 +0000 |
commit | 43f06fcec541c23aa4136fae4e415231f7b06176 (patch) | |
tree | 06b5891f7367b8ea0737235e08f0be86a31a1645 | |
parent | 04db7f7d097eb638c19629079a715eda4fa5f0b3 (diff) |
testing/lazymc: new aport
-rw-r--r-- | testing/lazymc/APKBUILD | 45 | ||||
-rw-r--r-- | testing/lazymc/lazymc.confd | 3 | ||||
-rw-r--r-- | testing/lazymc/lazymc.initd | 27 | ||||
-rw-r--r-- | testing/lazymc/lazymc.pre-install | 6 |
4 files changed, 81 insertions, 0 deletions
diff --git a/testing/lazymc/APKBUILD b/testing/lazymc/APKBUILD new file mode 100644 index 00000000000..5542c684bc2 --- /dev/null +++ b/testing/lazymc/APKBUILD @@ -0,0 +1,45 @@ +# Contributor: Matthias Ahouansou <matthias@ahouansou.cz> +# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz> +pkgname=lazymc +pkgver=0.2.11 +pkgrel=0 +pkgdesc="Put your Minecraft server to rest when idle" +url="https://github.com/timvisee/lazymc" +arch="all" +license="GPL-3.0-only" +makedepends=" + cargo + cargo-auditable +" +install="$pkgname.pre-install" +subpackages="$pkgname-openrc" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/timvisee/lazymc/archive/refs/tags/v$pkgver.tar.gz + lazymc.initd + lazymc.confd +" +options="net !check" # no tests + +prepare() { + default_prepare + cargo fetch --target="$CTARGET" --locked +} + +build() { + cargo auditable build --release --frozen +} + +package() { + install -Dm 755 target/release/lazymc "$pkgdir"/usr/bin/lazymc + + install -Dm 755 "$srcdir"/lazymc.initd "$pkgdir"/etc/init.d/lazymc + install -Dm 644 "$srcdir"/lazymc.confd "$pkgdir"/etc/conf.d/lazymc + + "$pkgdir"/usr/bin/lazymc config generate -c "$pkgdir"/etc/lazymc.toml +} + +sha512sums=" +64750b0bc5c4a4f08bf8aa19683b8415fdc62c0215208c4503e6d338c976decccf391aa0b8913676082d07a0e6ec7d45e05aef17e0765698679ca6eb2257a643 lazymc-0.2.11.tar.gz +29479bc55dbea006944b974ec507c907de43ab33dd7be27d41c42d157824ecc704b4ca4bb20a46dd889d92d5b715af4977ec9e92f2a2a8632ca3af942c873d7d lazymc.initd +9eb8e36476c471c2ae42e5ca985746f0f020437cdc4e38c25eecde70605d3ee48db539370be991258c0b3e25a0946ce9245754c26d64d7ac2e1994ee573a5502 lazymc.confd +" diff --git a/testing/lazymc/lazymc.confd b/testing/lazymc/lazymc.confd new file mode 100644 index 00000000000..e421bb5e292 --- /dev/null +++ b/testing/lazymc/lazymc.confd @@ -0,0 +1,3 @@ +command_user=lazymc:lazymc +logdir=/var/log/lazymc +_conf_path=/etc/lazymc.toml diff --git a/testing/lazymc/lazymc.initd b/testing/lazymc/lazymc.initd new file mode 100644 index 00000000000..adf427236b7 --- /dev/null +++ b/testing/lazymc/lazymc.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +supervisor="supervise-daemon" + +# fallback values for /etc/conf.d/lazymc +: ${command_user:=lazymc:lazymc} +: ${logdir:=/var/log/lazymc} +: ${_conf_path:=/etc/lazymc.toml} + +name=lazymc +description="Put your Minecraft server to rest when idle" +command="/usr/bin/lazymc" +command_args="-c $_conf_path" +command_background=true + +pidfile="/run/$name.pid" +output_log="$logdir/output.log" +error_log="$logdir/error.log" + +depend() { + need net + use logger +} + +start_pre() { + checkpath -d -o "$command_user" "$logdir" + checkpath -f -o "$command_user" "$output_log" "$error_log" +} diff --git a/testing/lazymc/lazymc.pre-install b/testing/lazymc/lazymc.pre-install new file mode 100644 index 00000000000..426deff112c --- /dev/null +++ b/testing/lazymc/lazymc.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S lazymc #2>/dev/null +adduser -S -D -s /sbin/nologin -G lazymc -g lazymc lazymc #2>/dev/null + +exit 0 |