# $Id: Portfile 30239 2007-10-23 01:55:09Z jmpp@macports.org $

PortSystem      1.0
name            netperf
version         2.2pl5
revision	1
categories	net
platforms	darwin freebsd
maintainers	nomaintainer
description	a network performance benchmark
long_description 	Netperf is a benchmark that can be used to measure \
			various aspects of networking performance. Currently, \
			its focus is on bulk data  transfer and \
			request/response performance using either TCP or UDP, \
			and the Berkeley Sockets interface. In addition, tests \
			for DLPI, the Fore ATM API, Unix Domain Sockets, and \
			HP HiPPI LLA may be conditionally compiled-in.
homepage	http://www.netperf.org/
master_sites	ftp://ftp.netperf.org/netperf/archive
checksums       md5 a4b0f4a5fbd8bec23002ad8023e01729

fetch.use_epsv	yes

patch	{
	reinplace "s|/opt/netperf|${destroot}${prefix}/bin|g" \
		${worksrcpath}/makefile
	reinplace "s|-D\$(LOG_FILE) -DNEED_MAKEFILE_EDIT|-D\$(LOG_FILE)|g" \
	  	${worksrcpath}/makefile
	reinplace "s|NETHOME=\".\"|NETHOME=\"${prefix}/bin\"|" \
		${worksrcpath}/snapshot_script ${worksrcpath}/tcp_range_script \
		${worksrcpath}/tcp_rr_script ${worksrcpath}/tcp_stream_script \
		${worksrcpath}/udp_rr_script ${worksrcpath}/udp_stream_script 
}

use_configure	no

post-destroot	{
	xinstall -m 444 ${worksrcpath}/netperf.man \
		${destroot}${prefix}/share/man/man1/netperf.1
	xinstall -m 444 ${worksrcpath}/netserver.man \
		${destroot}${prefix}/share/man/man1/netserver.1 
}
