# SliTaz package receipt.

PACKAGE="muninlite"
VERSION="1.0.4"
CATEGORY="network"
SHORT_DESC="Simple Munin node."
MAINTAINER="pascal.bellard@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://$PACKAGE.sourceforge.net/"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"

BUILD_DEPENDS="perl"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	make
}

# Rules to gen a SliTaz package suitable for Tazpkg.   
genpkg_rules()                                      
{
	mkdir -p $fs/usr/bin
	cp -a $src/munin-node $fs/usr/bin
}

# Pre and post install commands for Tazpkg.
post_install()
{
	grep -q 4949 $1/etc/services ||
	echo "munin		4949/tcp" >> $1/etc/services
	grep -q ^munin $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
munin   stream  tcp     nowait  root    /usr/bin/munin-node
EOT
	echo "/etc/inetd.conf is up to date"
}