diff options
Diffstat (limited to 'net-analyzer/nuttcp')
-rw-r--r-- | net-analyzer/nuttcp/Manifest | 1 | ||||
-rw-r--r-- | net-analyzer/nuttcp/files/nuttcp-8.1.4-makefile.patch | 21 | ||||
-rw-r--r-- | net-analyzer/nuttcp/files/nuttcp.confd | 5 | ||||
-rw-r--r-- | net-analyzer/nuttcp/files/nuttcp.initd | 16 | ||||
-rw-r--r-- | net-analyzer/nuttcp/metadata.xml | 23 | ||||
-rw-r--r-- | net-analyzer/nuttcp/nuttcp-8.1.4.ebuild | 62 |
6 files changed, 128 insertions, 0 deletions
diff --git a/net-analyzer/nuttcp/Manifest b/net-analyzer/nuttcp/Manifest new file mode 100644 index 000000000000..c7bb1cf75d83 --- /dev/null +++ b/net-analyzer/nuttcp/Manifest @@ -0,0 +1 @@ +DIST nuttcp-8.1.4.tar.bz2 13063356 BLAKE2B 374b76bed06615bf5966df5864c8987d5e8336eedd7450ccfef164e575f58ce2a22dbc1e0327e7740799560c30a03f9423d3fd50579fa01cd638059485c7f61b SHA512 ba6ff33bc1790c92f47d760d4588b128f60f0ca09ed43d95fd10b0edfb636a493b0d26b195e688a13b5b79fafc1cc52a0c73455263f921ff8ad0cf087f1d937b 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 +} |