# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=iptraf-ng
pkgver=1.1.4
pkgrel=4
pkgdesc="An IP Network Monitoring tool"
url="https://fedorahosted.org/iptraf-ng/"
arch="all"
license="GPL-2.0"
depends=""
makedepends="ncurses-dev linux-headers"
install=""
subpackages="$pkgname-doc"
source="http://pkgs.fedoraproject.org/repo/pkgs/iptraf-ng/$pkgname-$pkgver.tar.gz/de27cfeeede96e2acfb0edc8439b034a/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/iptraf-ng-$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() {
	cd "$_builddir"
	CFLAGS="$CFLAGS -D_GNU_SOURCE -std=gnu99" ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

sha512sums="8cafb0000cec75eb4071156a9e9350ffe6de99cb6386e8f50d05337113872ee50082a30009d85faa02d83633a8e727039791332d600654321b95ca6cfc881774  iptraf-ng-1.1.4.tar.gz"
