# Contributor: Kaarle Ritvanen # Maintainer: Kaarle Ritvanen pkgname=awall pkgver=1.5.2 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 triggers="$pkgname.trigger=/usr/share/awall" source="http://dev.alpinelinux.org/archive/awall/awall-$pkgver.tar.xz " 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 cd "$builddir" 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 } sha512sums="9abfe38355b9021c4c27218362e628560c49fb3aca2f5f067331b2aa52cb61c2fe2959f9a569bcb029a3b1caf02a846e1db4d6ae1b5bd368452fec9431b72232 awall-1.5.2.tar.xz"