testing/nftlb: new aport

This commit is contained in:
Jakub Jirutka 2020-02-04 22:38:37 +01:00
parent 9d56d67635
commit e23b9dcdba
3 changed files with 87 additions and 0 deletions

48
testing/nftlb/APKBUILD Normal file
View File

@ -0,0 +1,48 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=nftlb
pkgver=0.5
pkgrel=0
pkgdesc="nftables load balancer"
url="https://github.com/zevenet/nftlb"
arch="all"
license="AGPL-3.0"
checkdepends="bash"
makedepends="autoconf automake libev-dev libmnl-dev libtool nftables-dev"
subpackages="$pkgname-openrc"
source="https://github.com/zevenet/nftlb/archive/v$pkgver/$pkgname-$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
"
builddir="$srcdir/$pkgname-$pkgver"
prepare() {
autoreconf -fi
default_prepare
}
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var
make
}
check() {
# NOTE: It's not safe to run the provided tests on the builder.
./src/nftlb --help 2>/dev/null || ./src/nftlb --help
}
package() {
make install DESTDIR="$pkgdir"
install -m 0755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -m 0644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
sha512sums="af4c7efff084205630673c2c9959453aa701f0c235fd57a9990b6fdff09c7dc1e67963a913a1d36ac4d98dfebfcbeb798526ad7913146b368bee11c2296b7025 nftlb-0.5.tar.gz
3e15dc73b21412d1504892ee1e550a00c895671069a32e9c80a38a7c68bc8988c44519bfb15f288e42a96047febfeb38eeffc534381d644f87ede859b23efe71 nftlb.initd
9a4384fe295203a80489ea2a61f0c4b9b8b2ac1be51c506b4ab5c3c9e76818a0cd18f6b372323ea84dcd0437e1224cd9be339c9463c3c8042e6c3e74e73ae360 nftlb.confd"

23
testing/nftlb/nftlb.confd Normal file
View File

@ -0,0 +1,23 @@
# Configuration for /etc/init.d/nftlb
#Initial configuration file (optional).
#cfgfile=
# The logs will be shown in the syslog file and with this option you can
# change the loglevel from 0 to 7 (5 by default).
#log_level=
# The authentication key for the web service can be set by command line, or
# automatically generated. If it's automatically generated, it'll be shown by
# command line.
#auth_key=
# Enable IPv6 support for the web service listening port. Any value except
# empty string is interpreted as yes!
#listen_ipv6=
# Set the host for the web service (all interfaces by default).
listen_host="127.0.0.1"
# Set the TCP port for the web service (5555 by default).
#listen_port=

16
testing/nftlb/nftlb.initd Normal file
View File

@ -0,0 +1,16 @@
#!/sbin/openrc-run
description="nftables load balancer"
command="/usr/sbin/nftlb"
command_args="
${log_level:+--log $log_level}
${cfgfile:+--config $cfgfile}
${auth_key:+--key '$auth_key'}
${listen_ipv6:+--ipv6}
${listen_host:+--host $listen_host}
${listen_port:+--port $listen_port}
$command_args
"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"