#!/usr/bin/bash
# Netperf installer
###SHELLPACK preamble netperf-install 2.4.5
GIT_LOCATION=https://github.com/HewlettPackard/netperf
MIRROR_LOCATION="$WEBROOT/extra/netperf/"

###SHELLPACK parseargBegin
###SHELLPACK parseargEnd

GIT_FETCH_BRANCH="netperf-${VERSION}"
###SHELLPACK git_fetch ${VERSION}.tar.gz netperf-${VERSION}

###SHELLPACK build_start netperf-${VERSION}

if [ "$VERSION" = "2.7.0" ]; then
	export CFLAGS+=" -fno-strict-aliasing -fcommon"
fi

if [ ! -e ./configure ]; then
	./autogen.sh || die "Failed to run autogen"
fi

export CFLAGS+=" -DWANT_UNIX"

###SHELLPACK build_configure netperf-${VERSION}
###SHELLPACK make_make_install

echo Netperf installed successfully
exit $SHELLPACK_SUCCESS
