aports/config/nftables/APKBUILD

66 lines
1.4 KiB
Plaintext

# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
. ../APKBUILD-config.template
pkgver=2022.03.10.01
pkgrel=0
options="!check" # check requires root?
subpackages="
$pkgname-base
$pkgname-openssh
$pkgname-haproxy:_defmodule
$pkgname-murmur:_defmodule
$pkgname-dovecot:_defmodule
$pkgname-postfix:_defmodule
$pkgname-wireguard:_defmodule
$pkgname-unbound:_defmodule
$pkgname-transmission:_defmodule
$pkgname-xonotic:_defmodule
"
check() {
msg "Checking if commands are valid"
nft -c -I "$builddir/nft" -f "$builddir"/nft/loadall
}
prepare() {
default_prepare
cp -r "$startdir"/nft "$builddir"/nft # abuild doesn't support hierarchical includes yet, no hashes will be computed
}
package() {
rx_install "nft/loadall"
for x in "$builddir"/nft/*/*/table; do
fnc="${x##$builddir/nft/}"
_rx_installdir="$_rx_installdir/${fnc%/*}" rx_install "$x"
done
}
base() {
_modname="${subpkgname##$pkgname-}"
install_if="$pkgname"
_module "$_modname"
}
openssh() {
_modname="${subpkgname##$pkgname-}"
install_if="$pkgname $_modname"
_module "$_modname"
}
_defmodule() {
_modname="${subpkgname##$pkgname-}"
install_if="$pkgname redxen-config-$_modname"
_module "$_modname"
}
_module() {
for x in $(find "$builddir"/nft -name "$1"); do
fnc="${x##$builddir/nft/}"
_rx_installdir="$_rx_installdir/${fnc%/*}" rx_install "$x"
done
}