aports/testing/beszel/APKBUILD
2025-03-16 14:15:03 +01:00

71 lines
2.6 KiB
Text

# Contributor: Minoplhy <c@3qx.nl>
maintainer="Minoplhy <c@3qx.nl>"
pkgname=beszel
pkgver=0.10.2
pkgrel=1
pkgdesc="Lightweight server monitoring hub with historical data, docker stats, and alerts."
url="https://beszel.dev/"
arch="x86_64 aarch64"
license="MIT"
depends="tar curl"
makedepends="go>=1.23 npm"
install="$pkgname.pre-install $pkgname-agent.pre-install"
pkgusers="beszel beszel-agent"
pkggroups="beszel beszel-agent"
subpackages="$pkgname-openrc
$pkgname-agent
$pkgname-agent-openrc:agent_openrc
"
source="$pkgname-$pkgver.tar.gz::https://github.com/henrygd/beszel/archive/refs/tags/v$pkgver.tar.gz
$pkgname.confd
$pkgname.initd
$pkgname-agent.confd
$pkgname-agent.initd
"
options="net !check" # check: no test suite
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
make -j1 -C $builddir/$pkgname
}
package() {
install -D -m 755 "$builddir"/$pkgname/build/${pkgname}_linux_* "$pkgdir"/usr/bin/$pkgname
install -D -m 755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -D -m 644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
install -d -m 750 -o $pkgusers -g $pkggroups "$pkgdir"/var/lib/$pkgname
install -D -m 755 "$builddir"/$pkgname/build/${pkgname}-agent_linux_* "$pkgdir"/usr/bin/$pkgname-agent
install -d -m 755 -o beszel -g beszel "$pkgdir"/var/log/$pkgname
install -d -m 755 -o beszel-agent -g beszel-agent "$pkgdir"/var/log/$pkgname-agent
}
agent() {
pkgdesc="Beszel agent"
amove usr/bin/$pkgname-agent
amove var/log/$pkgname-agent
}
agent_openrc() {
pkgdesc="Beszel agent OpenRC scripts"
install_if="openrc ${subpkgname%-openrc}=$pkgver-r$pkgrel"
install -D -m 755 "$srcdir"/$pkgname-agent.initd "$pkgdir"/etc/init.d/$pkgname-agent
install -D -m 644 "$srcdir"/$pkgname-agent.confd "$pkgdir"/etc/conf.d/$pkgname-agent
amove etc/init.d/$pkgname-agent
amove etc/conf.d/$pkgname-agent
}
sha512sums="
8a727ce02cdee097da62891f42471428cfa9a6c36de573a00420287a8cead6340e5bfafa00e51d31a50dfb10c9fdb684c2699fe5e7381117390718855fea956b beszel-0.10.2.tar.gz
175af1b0ddf112d00feef5782a9bdf6ac37a08cd5f504e97526a2e7def9bd403216ee4cc3b4ba3f45e0724ba8fd5a736b9ceb2157095316e224ceca5f6463ff2 beszel.confd
fd64065cc06b2ec3492722bdd2da0ea3bb2a823533239e1c79c117de163dd1a9832853538f1377af57524c9023e636afc09e163a38007e8e4b71e63035d1881f beszel.initd
d999dfdafb6f206a486a3714ef99f52f4c3fbd229bc5d9248fde76679babb0be962ae4fa226e032b16a6c9dcf34ccf2c94454dc8a7a9b0134853789dba657979 beszel-agent.confd
a460056a16ad780e30ce819b8d2c484caf0243665138655bd2b8df8939bee4f7b44f41c6839a23f7423f3cf5b652f84361af653613340565978fa27dce03f4f1 beszel-agent.initd
"