# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=rrdbot
pkgver=0.9.7
pkgrel=2
pkgdesc="An SNMP polling daemon which writes the polled values to an RRD database"
url="http://thewalter.net/stef/software/rrdbot/"
arch="all"
license="BSD"
depends=""
makedepends="rrdtool-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc"
source="http://thewalter.net/stef/software/rrdbot/rrdbot-$pkgver.tar.gz
	rrdbotd.initd
	rrdbotd.confd
	"

# append extra dependencies to -dev subpackage
# remove if not used.
# depends_dev="somepackage-dev"

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

prepare() {
	default_prepare || return 1
	update_config_guess || return 1
}

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

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -m755 -D "$srcdir"/rrdbotd.initd \
		"$pkgdir"/etc/init.d/rrdbotd || return 1
	install -m644 -D "$srcdir"/rrdbotd.confd \
		"$pkgdir"/etc/conf.d/rrdbotd || return 1
}

md5sums="fb71c9498870b0b16e6a787bddcde44d  rrdbot-0.9.7.tar.gz
68d118f9a86c6cf8e718d0f2be210306  rrdbotd.initd
cbcac88f5b728b1441891947a4babbcb  rrdbotd.confd"
