# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=shorewall-core
pkgver=5.1.8

_ver=$pkgver
case $pkgver in
*.*.*.*) _ver=${pkgver%.*};;
esac

pkgrel=0
pkgdesc="Core libraries for Shorewall"
url="http://www.shorewall.net/"
arch="noarch"
license="GPL-2.0"
depends=""
# coreutils for install -T
makedepends="coreutils bash"
replaces=""
subpackages="$pkgname-doc"
source="http://www.shorewall.net/pub/shorewall/${_ver%.*}/shorewall-$_ver/shorewall-core-$pkgver.tar.bz2
	shorewallrc.alpine
	"

_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	cp "$srcdir"/shorewallrc.alpine .
}

build() {
	cd "$_builddir"
	./configure || return 1
}

package() {
	cd "$_builddir"
	DESTDIR="$pkgdir" ./install.sh shorewallrc.alpine || return 1
}

sha512sums="08b3a27dd421d25bfec8a7678731a664d034cb55d74fb47f35fe2aa8cbf1734a21f8bbf3f6fc3e0c3c90649dd20b692f903606220b424f40f69ecc9a3c0b134a  shorewall-core-5.1.8.tar.bz2
c076ae42e7b404cecf521fdc32f92ba3a6b77d61579726abde2f00b6b6282e55b0b334b9fe5e43a6e4ae56361cce3214d9a38099f9f8714f03ae4fb888c744b7  shorewallrc.alpine"
