Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3398373
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,108 @@
+#
+#    Copyright (c) 2010-2011 Nest, Inc.
+#    All rights reserved.
+#
+#    This document is the property of Nest. It is considered
+#    confidential and proprietary information.
+#
+#    This document may not be reproduced or transmitted in any form,
+#    in whole or in part, without the express written permission of
+#    Nest.
+#
+#    Description:
+#      This file is the make file for iperf, a utility for measuring
+#      maximum TCP and UDP bandwidth performance.
+#
+
+
+include pre.mak
+
+PackageName		:= iperf
+
+PackageExtension	:= tar.gz
+PackageSeparator	:= -
+
+PackagePatchArgs	:= -p1
+
+PackageArchive		:= $(PackageName).$(PackageExtension)
+PackageSourceDir	:= $(PackageName)$(PackageSeparator)$(PackageVersion)
+
+PackageBuildMakefile	= $(call GenerateBuildPaths,Makefile)
+
+CleanPaths		+= $(PackageLicenseFile)
+
+SOURCEDIRS                      = $(PackageSourceDir)
+$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/build
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(PackageSourceDir)/COPYING: $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(PackageSourceDir)/COPYING
+	$(copy-result)
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+	$(expand-and-patch-package)
+
+# Prepare the sources.
+
+$(BuildDirectory)/source: | $(PackageSourceDir)
+	$(Verbose)touch $@
+
+# Patch the sources, if necessary.
+
+$(BuildDirectory)/patch: source
+	$(Verbose)touch $@
+
+# Generate the package build makefile.
+#
+# The configure script cannot properly detect a GNU glibc-compatible
+# malloc when cross-compiling, so we give it direct indication that
+# it'll find one.
+
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory) $(ResultDirectory)
+	$(Verbose)cd $(BuildDirectory) && \
+	$(CURDIR)/$(PackageSourceDir)/configure \
+	CC="$(CC)" CXX="$(CXX)" AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	--build=$(HostTuple) \
+	--host=$(TargetTuple) \
+	ac_cv_func_malloc_0_nonnull=yes \
+	--prefix=/usr \
+	--sysconfdir=/etc \
+	--localstatedir=/var
+	$(Verbose)touch $@
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/build: $(BuildDirectory)/configure
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) all
+	$(Verbose)touch $@
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory)
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) DESTDIR=$(ResultDirectory) install
+	$(Verbose)touch $@
+
+.PHONY: stage
+stage: $(BuildDirectory)/stage
+
+clean:
+	$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak
diff --git a/iperf.patches/iperf-50.description b/iperf.patches/iperf-50.description
new file mode 100644
index 0000000..157141a
--- /dev/null
+++ b/iperf.patches/iperf-50.description
@@ -0,0 +1 @@
+Patch for building iperf with non-colloacted source and object trees. Needed for compiling ipv6 code in iperf
diff --git a/iperf.patches/iperf-50.patch b/iperf.patches/iperf-50.patch
new file mode 100644
index 0000000..f81d06f
--- /dev/null
+++ b/iperf.patches/iperf-50.patch
@@ -0,0 +1,115 @@
+diff -aruN iperf-2.0.5/configure iperf-2.0.5.N/configure
+--- iperf-2.0.5/configure	2010-04-10 12:23:05.000000000 -0700
++++ iperf-2.0.5.N/configure	2015-04-07 12:21:45.087517553 -0700
+@@ -7247,7 +7247,7 @@
+ 
+ 
+ if test "$ac_cv_multicast" != no; then
+-  ac_fn_c_check_type "$LINENO" "struct ip_mreq" "ac_cv_type_struct_ip_mreq" "#include \"compat/headers_slim.h\"
++  ac_fn_c_check_type "$LINENO" "struct ip_mreq" "ac_cv_type_struct_ip_mreq" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_type_struct_ip_mreq" = x""yes; then :
+ 
+@@ -7258,7 +7258,7 @@
+ 
+ fi
+ 
+-  ac_fn_c_check_decl "$LINENO" "IP_ADD_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_MEMBERSHIP" "#include \"compat/headers_slim.h\"
++  ac_fn_c_check_decl "$LINENO" "IP_ADD_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_MEMBERSHIP" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = x""yes; then :
+   ac_have_decl=1
+@@ -7288,7 +7288,7 @@
+ fi
+ 
+ if test "$ac_cv_have_ipv6" != no; then
+-  ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include \"compat/headers_slim.h\"
++  ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_type_struct_sockaddr_storage" = x""yes; then :
+ 
+@@ -7299,7 +7299,7 @@
+ 
+ fi
+ 
+-  ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#include \"compat/headers_slim.h\"
++  ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_type_struct_sockaddr_in6" = x""yes; then :
+ 
+@@ -7310,7 +7310,7 @@
+ 
+ fi
+ 
+-  ac_fn_c_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "#include \"compat/headers_slim.h\"
++  ac_fn_c_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_have_decl_AF_INET6" = x""yes; then :
+   ac_have_decl=1
+@@ -7341,7 +7341,7 @@
+ 
+ if test "$ac_cv_have_ipv6" = yes; then
+   if test "$ac_cv_multicast" = yes; then
+-    ac_fn_c_check_type "$LINENO" "struct ipv6_mreq" "ac_cv_type_struct_ipv6_mreq" "#include \"compat/headers_slim.h\"
++    ac_fn_c_check_type "$LINENO" "struct ipv6_mreq" "ac_cv_type_struct_ipv6_mreq" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_type_struct_ipv6_mreq" = x""yes; then :
+ 
+@@ -7352,7 +7352,7 @@
+ 
+ fi
+ 
+-    ac_fn_c_check_decl "$LINENO" "IPV6_ADD_MEMBERSHIP" "ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" "#include \"compat/headers_slim.h\"
++    ac_fn_c_check_decl "$LINENO" "IPV6_ADD_MEMBERSHIP" "ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" = x""yes; then :
+   ac_have_decl=1
+@@ -7364,7 +7364,7 @@
+ #define HAVE_DECL_IPV6_ADD_MEMBERSHIP $ac_have_decl
+ _ACEOF
+ 
+-    ac_fn_c_check_decl "$LINENO" "IPV6_MULTICAST_HOPS" "ac_cv_have_decl_IPV6_MULTICAST_HOPS" "#include \"compat/headers_slim.h\"
++    ac_fn_c_check_decl "$LINENO" "IPV6_MULTICAST_HOPS" "ac_cv_have_decl_IPV6_MULTICAST_HOPS" "#include \"${srcdir}/compat/headers_slim.h\"
+ "
+ if test "x$ac_cv_have_decl_IPV6_MULTICAST_HOPS" = x""yes; then :
+   ac_have_decl=1
+diff -aruN iperf-2.0.5/configure.ac iperf-2.0.5.N/configure.ac
+--- iperf-2.0.5/configure.ac	2010-04-10 12:23:05.000000000 -0700
++++ iperf-2.0.5.N/configure.ac	2015-04-07 15:43:06.422566931 -0700
+@@ -176,8 +176,8 @@
+ 
+ dnl check for multicast
+ if test "$ac_cv_multicast" != no; then
+-  AC_CHECK_TYPES(struct ip_mreq,,,[#include "compat/headers_slim.h"])
+-  AC_CHECK_DECLS(IP_ADD_MEMBERSHIP,,,[#include "compat/headers_slim.h"])
++  AC_CHECK_TYPES(struct ip_mreq,,,[#include "${srcdir}/compat/headers_slim.h"])
++  AC_CHECK_DECLS(IP_ADD_MEMBERSHIP,,,[#include "${srcdir}/compat/headers_slim.h"])
+   AC_MSG_CHECKING(for multicast support)
+   ac_cv_multicast=no
+   if test "$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = yes; then
+@@ -193,9 +193,9 @@
+ 
+ dnl check for IPv6
+ if test "$ac_cv_have_ipv6" != no; then
+-  AC_CHECK_TYPES(struct sockaddr_storage,,,[#include "compat/headers_slim.h"])
+-  AC_CHECK_TYPES(struct sockaddr_in6,,,[#include "compat/headers_slim.h"])
+-  AC_CHECK_DECLS(AF_INET6,,,[#include "compat/headers_slim.h"])
++  AC_CHECK_TYPES(struct sockaddr_storage,,,[#include "${srcdir}/compat/headers_slim.h"])
++  AC_CHECK_TYPES(struct sockaddr_in6,,,[#include "${srcdir}/compat/headers_slim.h"])
++  AC_CHECK_DECLS(AF_INET6,,,[#include "${srcdir}/compat/headers_slim.h"])
+   AC_MSG_CHECKING(for IPv6 headers and structures)
+   ac_cv_have_ipv6=no
+   if test "$ac_cv_type_struct_sockaddr_storage" = yes; then
+@@ -211,9 +211,9 @@
+ 
+ if test "$ac_cv_have_ipv6" = yes; then
+   if test "$ac_cv_multicast" = yes; then
+-    AC_CHECK_TYPES(struct ipv6_mreq,,,[#include "compat/headers_slim.h"])
+-    AC_CHECK_DECLS(IPV6_ADD_MEMBERSHIP,,,[#include "compat/headers_slim.h"])
+-    AC_CHECK_DECLS(IPV6_MULTICAST_HOPS,,,[#include "compat/headers_slim.h"])
++    AC_CHECK_TYPES(struct ipv6_mreq,,,[#include "${srcdir}/compat/headers_slim.h"])
++    AC_CHECK_DECLS(IPV6_ADD_MEMBERSHIP,,,[#include "${srcdir}/compat/headers_slim.h"])
++    AC_CHECK_DECLS(IPV6_MULTICAST_HOPS,,,[#include "${srcdir}/compat/headers_slim.h"])
+     AC_MSG_CHECKING(for IPv6 multicast support)
+     ac_cv_have_ipv6_multicast=no
+     if test "$ac_cv_type_struct_ipv6_mreq" = yes; then
diff --git a/iperf.tar.gz b/iperf.tar.gz
new file mode 100644
index 0000000..587b1b2
--- /dev/null
+++ b/iperf.tar.gz
Binary files differ
diff --git a/iperf.url b/iperf.url
new file mode 100644
index 0000000..8a575b4
--- /dev/null
+++ b/iperf.url
@@ -0,0 +1 @@
+http://download.sourceforge.net/iperf/iperf-2.0.5.tar.gz
diff --git a/iperf.version b/iperf.version
new file mode 100644
index 0000000..e010258
--- /dev/null
+++ b/iperf.version
@@ -0,0 +1 @@
+2.0.5