# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=arpon
pkgver=2.1
pkgrel=0
pkgdesc="Arp handler inspectiON is a handler daemon with tools to handle all ARP aspects"
url="http://arpon.sourceforge.net/"
arch="all"
license="GPL"
depends=""
makedepends="libdnet-dev libpcap-dev libnet-dev cmake"
install=
subpackages="$pkgname-doc"
source="http://arpon.sourceforge.net/tarball/ArpON-$pkgver.tar.gz
	arpon.initd
	arpon.confd
	"

_builddir="$srcdir"/ArpON-$pkgver/build

prepare() {
	mkdir -p "$_builddir"
	cd "$_builddir"
}

build() {
	cd "$_builddir"
	cmake .. -DCMAKE_C_FLAGS="$CFLAGS"
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir"

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

md5sums="c5e958af0d7068a12cb1fea656a759bd  ArpON-2.1.tar.gz
4bf2cb423936b1ca84773fe6b7baaa73  arpon.initd
26986bed19b28cec66ed08447d22efaf  arpon.confd"