SUMMARY="A network testing scripting tool"
DESCRIPTION="The packetdrill scripting tool enables quick, precise tests for \
entire TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to \
the NIC hardware. packetdrill currently works on Linux, FreeBSD, OpenBSD, \
and NetBSD. It can test network stack behavior over physical NICs on a LAN, \
or on a single machine using a tun virtual network device."
HOMEPAGE="https://github.com/google/packetdrill"
COPYRIGHT="2013-2016 Google Inc."
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="a3d4338d16a03b32e12559d34a8064978bbaa717"
SOURCE_URI="https://github.com/google/packetdrill/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="5b184075673299c08c7772a2a552e97758f3c2ec46c4bdacb37336452ba8562b"
SOURCE_DIR="packetdrill-$srcGitRev"
PATCHES="packetdrill-$portVersion.patchset"

ARCHITECTURES="!all"

PROVIDES="
	packetdrill = $portVersion
	cmd:checksum_test
	cmd:packet_parser_test
	cmd:packet_to_string_test
	cmd:packetdrill
	"
REQUIRES="
	haiku
	lib:libpcap
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libpcap
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:make
	"

BUILD()
{
	cd gtests/net/packetdrill
	./configure
	CFLAGS=-D_BSD_SOURCE make
}

INSTALL()
{
	cd gtests/net/packetdrill
	mkdir -p $binDir $dataDir/packetdrill
	cp packetdrill packet_to_string_test \
		packet_parser_test checksum_test $binDir
	cp -R tests $dataDir/packetdrill
}
