summaryrefslogtreecommitdiff
path: root/net-analyzer/nuttcp
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/nuttcp')
-rw-r--r--net-analyzer/nuttcp/Manifest6
-rw-r--r--net-analyzer/nuttcp/files/nuttcp-8.1.4-makefile.patch21
-rw-r--r--net-analyzer/nuttcp/files/nuttcp.confd5
-rw-r--r--net-analyzer/nuttcp/files/nuttcp.initd16
-rw-r--r--net-analyzer/nuttcp/metadata.xml23
-rw-r--r--net-analyzer/nuttcp/nuttcp-8.1.4.ebuild62
6 files changed, 133 insertions, 0 deletions
diff --git a/net-analyzer/nuttcp/Manifest b/net-analyzer/nuttcp/Manifest
new file mode 100644
index 000000000000..3935f8707154
--- /dev/null
+++ b/net-analyzer/nuttcp/Manifest
@@ -0,0 +1,6 @@
+AUX nuttcp-8.1.4-makefile.patch 686 BLAKE2B 39e0b6e366858631f77e47833d9af0881a1d83a188a883401c788b991995f824780abbe47be10fc7120e32ee5254c5e044f4fdceab60b9bd6e207278b684c3f9 SHA512 58df32ebd9b2a6ca775a4a88d6387bf0552aeb8cdb65b12e99d0f7fab6139c453e130e5043d14cc5c6b9b3c10729a2233bfe8c038665a85a59d3017bd569bdfd
+AUX nuttcp.confd 174 BLAKE2B 8ca9f6f9abc473e232f650bacb989e4d3a0a3d9e40f239a70e5b7fcc016f3ad21c43f530dd0508acbdc3d5cb13cd85cbaad290c89f1227420778c2423f2815de SHA512 afc5d55e17535633606873a1db18fe560a3c7450bca6fdad3141215bcad27a0480f6ccfadbaad436c84c9bc131dae375ab5ddfd4d85cb3e1565f79f6d07bbbcb
+AUX nuttcp.initd 328 BLAKE2B 823ea8ad721e66ad26a5a1d2f43f098721fc36146524ecd3e02185b3da3bb83bad11f20eaed285da8a00289afd27d3bbc01f461e348086c8903c6f3b14d9b598 SHA512 29bf5e158955238a4579e60ae81b47e34ca620c2c69ab41667c35f626993f8c6adfb88c9f7a484551b95f1fe1c7aadb4903c951a30114ba38dc963b614b19ecd
+DIST nuttcp-8.1.4.tar.bz2 13063356 BLAKE2B 374b76bed06615bf5966df5864c8987d5e8336eedd7450ccfef164e575f58ce2a22dbc1e0327e7740799560c30a03f9423d3fd50579fa01cd638059485c7f61b SHA512 ba6ff33bc1790c92f47d760d4588b128f60f0ca09ed43d95fd10b0edfb636a493b0d26b195e688a13b5b79fafc1cc52a0c73455263f921ff8ad0cf087f1d937b
+EBUILD nuttcp-8.1.4.ebuild 1456 BLAKE2B fe278b37f5b923b27365f2f979eaae2f00324ea7b40dfa5f7f9c617546bd8f6ff0293099ff6852dcdad489ce46b8c1bce07c36c3878bec18307bc2474b9f1d1b SHA512 4726a56012dae0e6c46e012b3842bd199c31e29f7eee49c839ae2b475e44e71dab417ea3ea4b44716fe24e2409226dd12341d645f0fad45819bbc145d7e6841f
+MISC metadata.xml 915 BLAKE2B 2011a0921d4de0ce5f7d30cc149751aed2120364b7c74763970b86d67f49eebb4b1ace092fbb6a1f6583ce2b6af75db36c02355a4d74f8724c693b0d5535d825 SHA512 6e3db2f2b940e1ebff18f0bafdab669a9e67c29f4845b171c4cedd50923e5ff5e22839a4c328bf7b8f55d7ee6c5da827f48035816d7e58dda384fec9bee1c59d
diff --git a/net-analyzer/nuttcp/files/nuttcp-8.1.4-makefile.patch b/net-analyzer/nuttcp/files/nuttcp-8.1.4-makefile.patch
new file mode 100644
index 000000000000..02de62a80e70
--- /dev/null
+++ b/net-analyzer/nuttcp/files/nuttcp-8.1.4-makefile.patch
@@ -0,0 +1,21 @@
+--- a/Makefile 2017-10-29 08:39:34.209474792 +0200
++++ b/Makefile 2017-10-29 15:11:02.082490459 +0200
+@@ -2,8 +2,7 @@
+ #EXTRAVERSION=-pre1
+ CC = gcc -Wall
+ #OPT = -g -O0
+-OPT = -O3
+-CFLAGS = $(OPT) $(NOIPV6)
++CFLAGS += $(OPT) $(NOIPV6)
+ LIBS =
+ ifneq ($(NOIPV6),)
+ APPEXTV6=-noipv6
+@@ -53,7 +52,7 @@
+ # $(MAKE) CC=icc OPT="-w -O3 -parallel -unroll -align -xM -vec_report -par_report2"
+
+ $(APP)$(EXTRAVERSION)$(APPEXT): $(APP)$(EXTRAVERSION).c $(LIBS)
+- $(CC) $(CFLAGS) -o $@ $< $(LIBS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
+ inet_ntop.o: missing/inet_ntop.c missing/config.h
+ $(CC) $(CFLAGS.MISSING) -o $@ -c $<
+ inet_pton.o: missing/inet_pton.c missing/config.h
diff --git a/net-analyzer/nuttcp/files/nuttcp.confd b/net-analyzer/nuttcp/files/nuttcp.confd
new file mode 100644
index 000000000000..a41d858550a1
--- /dev/null
+++ b/net-analyzer/nuttcp/files/nuttcp.confd
@@ -0,0 +1,5 @@
+# Config file for /etc/init.d/nuttcp
+
+# extra options (run nuttcp -h for a list of supported options)
+# Parameter -S indicates that nuttcp acts as a server.
+NUTTCP_OPTS="-S"
diff --git a/net-analyzer/nuttcp/files/nuttcp.initd b/net-analyzer/nuttcp/files/nuttcp.initd
new file mode 100644
index 000000000000..3ba80fab8f6e
--- /dev/null
+++ b/net-analyzer/nuttcp/files/nuttcp.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/nuttcp"
+command_background="yes"
+command_args="${NUTTCP_OPTS}"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need net
+}
+
+start_post() {
+ pgrep -n "${RC_SVCNAME%%.*}" > "${pidfile}"
+}
diff --git a/net-analyzer/nuttcp/metadata.xml b/net-analyzer/nuttcp/metadata.xml
new file mode 100644
index 000000000000..66e11db82cfd
--- /dev/null
+++ b/net-analyzer/nuttcp/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>spiderx@spiderx.dp.ua</email>
+ <name>Vladimir Pavljuchenkov</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ nuttcp is a network performance measurement tool intended for use
+ by network and system managers. Its most basic usage is to determine
+ the raw TCP (or UDP) network layer throughput by transferring memory
+ buffers from a source system across an interconnecting network to
+ a destination system, either transferring data for a specified time
+ interval, or alternatively transferring a specified number of bytes.
+ </longdescription>
+ <upstream>
+ <bugs-to>mailto:nuttcp@lcp.nrl.navy.mil</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/nuttcp/nuttcp-8.1.4.ebuild b/net-analyzer/nuttcp/nuttcp-8.1.4.ebuild
new file mode 100644
index 000000000000..97c01c07adc1
--- /dev/null
+++ b/net-analyzer/nuttcp/nuttcp-8.1.4.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit readme.gentoo-r1 systemd toolchain-funcs
+
+DESCRIPTION="Network performance measurement tool"
+HOMEPAGE="http://www.nuttcp.net/"
+SRC_URI="http://nuttcp.net/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ipv6 xinetd"
+
+RDEPEND="xinetd? ( sys-apps/xinetd )"
+
+DOCS=( examples.txt README )
+# Honor CC, LDFLAGS, CFLAGS, CPPFLAGS
+PATCHES=( "${FILESDIR}"/"${P}"-makefile.patch )
+
+DOC_CONTENTS="Usage of nuttpc by its service name in xinetd service,
+iptables rules, etc. will require adding these lines to /etc/services:\\n
+nuttcp\\t\\t5000/tcp\\n
+nuttcp-data\\t\\t5001/tcp\\n
+nuttcp6\\t\\t5000/tcp\\n
+nuttcp6-data\\t\\t5001/tcp\\n\\n
+To run ${PN} in server mode, run:\\n/etc/init.d/${PN} start"
+
+src_prepare() {
+ default
+
+ # Fix path to binary
+ sed -i '/server/s|/local||' xinetd.d/nuttcp || die "sed failed"
+}
+
+src_compile() {
+ emake "$(usex ipv6 APPEXT='' NOIPV6=-DNO_IPV6)" CC="$(tc-getCC)"
+}
+
+src_install() {
+ einstalldocs
+ doman "${PN}".8
+ newbin "${P}$(usex ipv6 '' -noipv6)" "${PN}"
+
+ newinitd "${FILESDIR}"/"${PN}".initd "${PN}"
+ newconfd "${FILESDIR}"/"${PN}".confd "${PN}"
+ systemd_dounit systemd/"${PN}"@.service
+ systemd_dounit systemd/"${PN}".socket
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ doins xinetd.d/"${PN}"
+ fi
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}