# Contributor: Kaarle Ritvanen # Maintainer: Kaarle Ritvanen pkgname=awall pkgver=1.4.3 pkgrel=0 pkgdesc="Alpine Wall" url="http://git.alpinelinux.org/cgit/awall/" _luaver=5.2 arch="noarch" license="GPL2" 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 prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { sed -i -e "1,1s:lua:lua$_luaver:" awall-cli return 0 } 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="149e41f49a66397e967fa4f5cc0afab59a175d5b645222fcb05f81411466d14abd977649297f0e27329f7e86961e19adc52453f61c4d426ffc2bef8b73b265ae awall-1.4.3.tar.xz"