mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-06 04:46:42 +02:00
testing/lazymc: new aport
This commit is contained in:
parent
04db7f7d09
commit
43f06fcec5
45
testing/lazymc/APKBUILD
Normal file
45
testing/lazymc/APKBUILD
Normal file
@ -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
|
||||
"
|
||||
3
testing/lazymc/lazymc.confd
Normal file
3
testing/lazymc/lazymc.confd
Normal file
@ -0,0 +1,3 @@
|
||||
command_user=lazymc:lazymc
|
||||
logdir=/var/log/lazymc
|
||||
_conf_path=/etc/lazymc.toml
|
||||
27
testing/lazymc/lazymc.initd
Normal file
27
testing/lazymc/lazymc.initd
Normal file
@ -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"
|
||||
}
|
||||
6
testing/lazymc/lazymc.pre-install
Normal file
6
testing/lazymc/lazymc.pre-install
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user