# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:
pkgname=sflowtool
pkgver=3.41
pkgrel=0
pkgdesc="Print binary sFlow feed to ASCII, or forward it to other collectors"
url="https://github.com/sflow/sflowtool"
arch="all"
license="Custom"
depends=
depends_dev=
makedepends="$depends_dev autoconf automake"
install=
subpackages=
source="$pkgname-$pkgver.tar.gz::https://github.com/sflow/sflowtool/archive/v$pkgver.tar.gz"

builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$builddir"
	aclocal && autoconf && autoreconf -f -i -Wall,no-obsolete || return 1
}

build() {
	cd "$builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make || return 1
}

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

	# remove the 2 lines below (and this) if there is no init.d script
	# install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	# install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="07cd160ae7da908b46500f70680fb1cb54f0095eade63ca4afa6a1a0ca0beacae4f33025911784c9b95912e630df28bfc9e0ef01bd03028647fd27155d5dd749  sflowtool-3.41.tar.gz"