From ac9c0ae11da3195b50d36d9554e25906ca935ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Sun, 12 Jul 2015 19:17:15 +0200 Subject: [PATCH] Adopt the netperf package. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Toke Høiland-Jørgensen --- net/netperf/Makefile | 49 ++++++++++++++++++++++++++ net/netperf/files/netserver.init | 12 +++++++ net/netperf/patches/001-musl-fix.patch | 12 +++++++ 3 files changed, 73 insertions(+) create mode 100644 net/netperf/Makefile create mode 100644 net/netperf/files/netserver.init create mode 100644 net/netperf/patches/001-musl-fix.patch diff --git a/net/netperf/Makefile b/net/netperf/Makefile new file mode 100644 index 000000000..4d7ea00d7 --- /dev/null +++ b/net/netperf/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=netperf +PKG_VERSION:=2.6.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Custom + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/ +PKG_MD5SUM:=9654ffdfd4c4f2c93ce3733cd9ed9236 + +include $(INCLUDE_DIR)/package.mk + +define Package/netperf + SECTION:=net + CATEGORY:=Network + TITLE:=Network performance measurement tool + URL:=http://www.netperf.org/ + MAINTAINER:=Toke Høiland-Jørgensen +endef + +CONFIGURE_ARGS += --enable-demo + +define Package/netperf/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/netserver.init $(1)/etc/init.d/netserver + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netperf $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netserver $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/arr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/packet_byte_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/sctp_stream_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/snapshot_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_range_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_rr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_stream_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_rr_script $(1)/lib/netperf + $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_stream_script $(1)/lib/netperf +endef + +$(eval $(call BuildPackage,netperf)) diff --git a/net/netperf/files/netserver.init b/net/netperf/files/netserver.init new file mode 100644 index 000000000..42fcf3357 --- /dev/null +++ b/net/netperf/files/netserver.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +start() { + service_start /usr/bin/netserver +} + +stop() { + service_stop /usr/bin/netserver +} diff --git a/net/netperf/patches/001-musl-fix.patch b/net/netperf/patches/001-musl-fix.patch new file mode 100644 index 000000000..6774c48c8 --- /dev/null +++ b/net/netperf/patches/001-musl-fix.patch @@ -0,0 +1,12 @@ +diff --git a/src/netrt_rtnetlink.c b/src/netrt_rtnetlink.c +index 10e4750..318c0c2 100644 +--- a/src/netrt_rtnetlink.c ++++ b/src/netrt_rtnetlink.c +@@ -5,7 +5,6 @@ + #include + #include + #include +-#include + #include + #include + #include