aboutsummaryrefslogtreecommitdiffstats
path: root/main/awall/APKBUILD
blob: af055287059c2251aa4a6dd6cd6f5cf6884bd220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=awall
pkgver=1.6.4
pkgrel=1
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="51f6339d7f27bdbefb78daa69dcd4bcc3d87f80fd5e1691d6a1d8c9931196f253e986ed16a48cbf34a3f5ccb897fdadedff29f78e1f61691563b3de703c10021  awall-1.6.4.tar.xz
390664296b50f39fdba4a159570473c4e90fc6932a207cf9ce9a476bbbe19db8ee4d862b864d0d3dd6e8a5a4e2df78b950567919fb18c8437ce25f9fb72b0883  setup-firewall"