Commit 109c98d5 authored by Mike Hibler's avatar Mike Hibler
Browse files

Download/unpack/patch iperf source in obj tree instead of source.

parent ba075a37
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -9,6 +9,8 @@ TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../../..
SUBDIR = event/linktest/iperf
TARBALL = iperf-2.0.2.tar.gz
include $(OBJDIR)/Makeconf
SYSTEM := $(patsubst CYGWIN%,CYGWIN,$(shell uname -s))
......@@ -50,16 +52,20 @@ iperf-install: build-iperf
client-install: $(ITARGETS)
# Note: GNU make wants to pass options in MAKEFLAGS (w) that are compatible
# Note: GNU make wants to pass options in MAKEFLAGS (w) that are incompatible
# with BSD make. So we just force configure to assume/use gmake for BSD.
config.status:
MAKE=$(MAKE) $(SRCDIR)/iperf-2.0.2/configure $(CONFIG_ARGS)
MAKE=$(MAKE) iperf-2.0.2/configure $(CONFIG_ARGS)
iperf-2.0.2:
$(SRCDIR)/iperf-fetch.sh $(SRCDIR)
$(SRCDIR)/iperf-fetch.sh $(SRCDIR) $(TARBALL)
clean:
if [ -r Makefile ]; then $(MAKE) -f Makefile clean; fi
rm -f config.h config.log stamp-h1
clean: Makefile
$(MAKE) -f Makefile clean
reallyclean:
rm -rf config.status iperf-2.0.2 $(TARBALL)
Makefile: config.status
......
#!/bin/sh
version=2.0.2
srcurl="http://sourceforge.net/projects/iperf/files/iperf/iperf 2.02 source"
tarball="iperf-$version.tar.gz"
if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch
elif [ -x /usr/bin/wget ]; then
......@@ -9,25 +13,34 @@ else
exit 1
fi
if [ ! -d iperf-2.0.2/src ]; then
cd $1
if [ ! -f iperf-2.0.2.tar.gz ]; then
echo "Downloading iperf source from www.emulab.net to $1 ..."
$fetch http://www.emulab.net/downloads/iperf-2.0.2.tar.gz
if [ -n "$1" ]; then srcdir=$1; else srcdir=$PWD ; fi
if [ -n "$2" ]; then tarball=$2; fi
if [ -n "$3" ]; then host=$3; else host=www.emulab.net ; fi
dir=$PWD
if [ ! -d $dir/iperf-$version/src ]; then
if [ ! -f "$tarball" ]; then
cd $dir
echo "Downloading iperf source from $host to $dir ..."
$fetch http://$host/$tarball
if [ $? -ne 0 ]; then
echo "Failed..."
exit 1
echo "Downloading rude source from \"$srcurl\" to $dir ..."
$fetch "$srcurl/$tarball" || {
echo "ERROR: iperf-fetch: $fetch failed"
exit 1
}
fi
fi
echo "Unpacking/patching iperf-2.0.2 source ..."
tar xzof iperf-2.0.2.tar.gz || {
echo "Unpacking/patching iperf-$version source ..."
tar xzof $tarball || {
echo "ERROR: iperf-fetch.sh: tar failed"
exit 1
}
cd iperf-2.0.2 && patch -p0 < ../iperf-patch || {
cd iperf-$version && patch -p0 < $srcdir/iperf-patch || {
echo "ERROR: iperf-fetch.sh: patch failed"
exit 1
}
rm -f ../iperf-2.0.2.tar.gz */*.orig
rm -f */*.orig
fi
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment