# Contributor: Kaarle Ritvanen # Maintainer: Kaarle Ritvanen pkgname=awall pkgver=1.6.11 pkgrel=0 pkgdesc="Alpine Wall" url="https://git.alpinelinux.org/cgit/awall/" _luaver=5.2 arch="noarch" license="GPL-2.0" replaces="awall-nat" depends="drill ip6tables ipset iptables lua$_luaver lua$_luaver-alt-getopt lua$_luaver-cjson lua$_luaver-pc lua$_luaver-posix lua$_luaver-stringy xtables-addons" subpackages="$pkgname-masquerade $pkgname-policies" triggers="$pkgname.trigger=/usr/share/awall" source="https://dev.alpinelinux.org/archive/awall/awall-$pkgver.tar.xz awall-init setup-firewall " builddir=$srcdir/awall-$pkgver build() { sed -i -e "1,1s:lua:lua$_luaver:" awall-cli return 0 } check() { cd "$builddir" make check } package() { cd "$builddir" make "ROOT_DIR=$pkgdir" LUA_VERSION=$_luaver install install -D "$srcdir"/awall-init "$pkgdir"/usr/libexec/awall-init } masquerade() { depends=awall for file in lua/$_luaver/awall/modules/masquerade.lua awall/mandatory/masquerade.json; do local path=usr/share/$file install -d "$subpkgdir/$(dirname $path)" mv "$pkgdir/$path" "$subpkgdir/$path" done } policies() { depends=awall local dir=usr/share/awall/optional install -d "$subpkgdir"/$dir mv "$pkgdir"/$dir/*.json "$subpkgdir"/$dir install -D "$srcdir"/setup-firewall "$subpkgdir"/usr/sbin/setup-firewall } sha512sums="711f1d7bbc3de0b0684c3ffb5c114cef43de04eafacd186b488163e073d7b4a3cc5745eff825113b2ad3b1388a42ad14be52a59c6f20e361fde7d88e6e0f656e awall-1.6.11.tar.xz e83ea3281c298092530e45fa5b62f6f85b9e5109b11e109799465ea832608294c7d9c4c3f5b0f321dfc0e82040daf3a17d066e9dea65cb0dbae2c453ea9e62cd awall-init e3dd92377c13e88f5395d3c4ccf9bc3afbeb72a5601a17e98b186f8016734cc0ef51a657693f88891094f38f3cda61bb615fa618f29c43fbff7295bf2020dee8 setup-firewall"