# Contributor: Kaarle Ritvanen # Maintainer: Kaarle Ritvanen pkgname=awall pkgver=1.6.3 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="bind-tools 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="http://dev.alpinelinux.org/archive/awall/awall-$pkgver.tar.xz 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 } 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="ae1efbff22245bb758dfc72100fcc2cf8b0e07bbb9c9db57ea9751eb4ed97c2a39d5c825180c67554d554a76459646e7fc7ce222a00c7acb43bf43e0e0c6c808 awall-1.6.3.tar.xz 32f421b97b0d5d8cda4aa66c5f02319ffef12368d2c4903dbe9f6f3feb48959f6624706083c89cc2cd0ce2878c1c3962b4b7f906713623fe66181d071db37f61 setup-firewall"