# Contributor: Alex Denes # Maintainer: Alex Denes . ../APKBUILD-config.template pkgver=2022.06.17.01 pkgrel=0 options="!check" # check requires root? subpackages=" $pkgname-base $pkgname-openssh $pkgname-vtun $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" } vtun() { _modname="${subpkgname##$pkgname-}" install_if="$pkgname redxen-openrc-$_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 }