Receipt for: dnstop

source
# SliTaz package receipt.

PACKAGE="dnstop"
VERSION="20210329"
CATEGORY="network"
SHORT_DESC="Displays various tables of DNS traffic on your network."
MAINTAINER="paul@slitaz.org"
LICENSE="BSD"
WEB_SITE="http://dns.measurement-factory.com/tools/dnstop"

TARBALL="$PACKAGE-$VERSION.zip"
WGET_URL="https://github.com/measurement-factory/$PACKAGE/archive/refs/heads/master.zip"

DEPENDS="libpcap ncurses"
BUILD_DEPENDS="libpcap-dev ncurses-dev"

# What is the latest version available today?
current_version()
{
	wget -O - https://github.com/measurement-factory/$PACKAGE/commits/master 2>/dev/null | \
	sed 's|",|&\n|g' | sed '/committedDate/!d;s|.*":"||;s|T.*||;s|-||g;q'
}

# Rules to configure and make the package.
compile_rules()
{
	export LDFLAGS="$LDFLAGS -ltinfo"

	# SliTaz narrow libncurses lacks nodelay; link the wide libncursesw
	sed -i 's/-lncurses\b/-lncursesw/g' configure Makefile.in 2>/dev/null

	./configure --prefix=/usr &&
	make
}

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