summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2020-01-23 09:32:57 +0100
committerJeroen Roovers <jer@gentoo.org>2020-01-23 10:18:11 +0100
commit500fb42c0284932b3d08e04a69ecfb78ca1be673 (patch)
tree7911735a96ab68570271c2c2927510b375d6af68 /net-analyzer/hunt
parentnet-misc/dhcp: Bump to version 4.4.2 (diff)
downloadgentoo-500fb42c0284932b3d08e04a69ecfb78ca1be673.tar.gz
gentoo-500fb42c0284932b3d08e04a69ecfb78ca1be673.tar.bz2
gentoo-500fb42c0284932b3d08e04a69ecfb78ca1be673.zip
net-analyzer/hunt: Version 1.5_p6_p1
- Apply Debian patch 6.1 - Build and install tpserv/transproxy - EAPI=7 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'net-analyzer/hunt')
-rw-r--r--net-analyzer/hunt/Manifest2
-rw-r--r--net-analyzer/hunt/files/hunt-1.5-gentoo.patch19
-rw-r--r--net-analyzer/hunt/files/hunt-1.5-tpserv-log.patch100
-rw-r--r--net-analyzer/hunt/hunt-1.5_p6_p1.ebuild46
4 files changed, 167 insertions, 0 deletions
diff --git a/net-analyzer/hunt/Manifest b/net-analyzer/hunt/Manifest
index 0909b26c00b1..9d632564e419 100644
--- a/net-analyzer/hunt/Manifest
+++ b/net-analyzer/hunt/Manifest
@@ -1 +1,3 @@
DIST hunt-1.5.tgz 99241 BLAKE2B df9092cdf6de0016ae5fe8d360a712eccd3c0f71bead3c93142ba2c3c421031cb5e6ff8c3b4782856286fd41a61e40a6453b48f240365ba88f6805bb3bbdd909 SHA512 b016f7ae0ac7568b4a5006b7c5e6f3e80df71a67d94a1e62afc46fb0f10cb661df7e3bff1f0229836a2247ef368dc2681ad955821e97cb6a91fcfe489b871a61
+DIST hunt_1.5-6.1.diff.gz 4556 BLAKE2B 74c27722ae61494ca922b013cc691c0e835d7cdcc01399aaf7fe9bc7da4532954c4da2023fc92e3a4f664bb2b5ab8ef22ff1c04694dc1ab7c205125ccea1ff84 SHA512 45ff3f977a32202d8ab9b7daa76a0ebb507d0b73d635c0f3649cf3b2bcb9fdc3094c9631d696dfaf27371bc5fb5eb62dbdc258795979755c7713a45357938a05
+DIST hunt_1.5.orig.tar.gz 99241 BLAKE2B df9092cdf6de0016ae5fe8d360a712eccd3c0f71bead3c93142ba2c3c421031cb5e6ff8c3b4782856286fd41a61e40a6453b48f240365ba88f6805bb3bbdd909 SHA512 b016f7ae0ac7568b4a5006b7c5e6f3e80df71a67d94a1e62afc46fb0f10cb661df7e3bff1f0229836a2247ef368dc2681ad955821e97cb6a91fcfe489b871a61
diff --git a/net-analyzer/hunt/files/hunt-1.5-gentoo.patch b/net-analyzer/hunt/files/hunt-1.5-gentoo.patch
new file mode 100644
index 000000000000..e0bcccae0aae
--- /dev/null
+++ b/net-analyzer/hunt/files/hunt-1.5-gentoo.patch
@@ -0,0 +1,19 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,4 @@
+-CFLAGS=-Wall -O2 -g -D_REENTRANT -std=gnu89
++CFLAGS += -Wall -D_REENTRANT -std=gnu89
+ #CFLAGS+=-DSYNC_FAST
+ #CFLAGS+=-D_WITH_LINUX_KERNEL_HDR
+
+--- a/tpserv/Makefile
++++ b/tpserv/Makefile
+@@ -3,7 +3,7 @@
+ all: tpserv
+
+ tpserv: tpserv.o
+- $(CC) -o $@ $< $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
+
+ clean:
+ rm -f *.o
diff --git a/net-analyzer/hunt/files/hunt-1.5-tpserv-log.patch b/net-analyzer/hunt/files/hunt-1.5-tpserv-log.patch
new file mode 100644
index 000000000000..2e50dfe04ec6
--- /dev/null
+++ b/net-analyzer/hunt/files/hunt-1.5-tpserv-log.patch
@@ -0,0 +1,100 @@
+--- a/tpserv/tpserv.c
++++ b/tpserv/tpserv.c
+@@ -55,7 +55,7 @@
+ return v1 > v2 ? v1 : v2;
+ }
+
+-static void log(int level, int pid, char *format, ...)
++static void hunt_log(int level, int pid, char *format, ...)
+ {
+ char buf[BUFSIZE];
+ va_list va;
+@@ -93,21 +93,21 @@
+ {
+ if (verbose <= 1)
+ return;
+- log(LOG_DEBUG, pid, "read %4d bytes %s", len, print_connection(from_addr, to_addr));
++ hunt_log(LOG_DEBUG, pid, "read %4d bytes %s", len, print_connection(from_addr, to_addr));
+ }
+
+ static void print_write(int pid, struct sockaddr_in *from_addr, struct sockaddr_in *to_addr, int len)
+ {
+ if (verbose <= 1)
+ return;
+- log(LOG_DEBUG, pid, "write %4d bytes %s", len, print_connection(from_addr, to_addr));
++ hunt_log(LOG_DEBUG, pid, "write %4d bytes %s", len, print_connection(from_addr, to_addr));
+ }
+
+ static void print_connect(int pid, struct sockaddr_in *from_addr, struct sockaddr_in *to_addr)
+ {
+ if (!verbose)
+ return;
+- log(LOG_DEBUG, pid, "connect %s", print_connection(from_addr, to_addr));
++ hunt_log(LOG_DEBUG, pid, "connect %s", print_connection(from_addr, to_addr));
+
+ }
+
+@@ -115,7 +115,7 @@
+ {
+ if (!verbose)
+ return;
+- log(LOG_DEBUG, pid, "disconnect %s", print_connection(from_addr, to_addr));
++ hunt_log(LOG_DEBUG, pid, "disconnect %s", print_connection(from_addr, to_addr));
+ }
+
+ #if 0
+@@ -154,17 +154,17 @@
+ int fd_remote;
+
+ if ((fd_remote = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+- log(LOG_ERR, pid, "socket failed %d:%s\n", errno, strerror(errno));
++ hunt_log(LOG_ERR, pid, "socket failed %d:%s\n", errno, strerror(errno));
+ exit(1);
+ }
+ to_addr_len = sizeof(*to_addr);
+ if (connect(fd_remote, to_addr, to_addr_len) < 0) {
+- log(LOG_ERR, pid, "failed to connect to remote addr\n");
++ hunt_log(LOG_ERR, pid, "failed to connect to remote addr\n");
+ exit(1);
+ }
+ local_addr_len = sizeof(local_addr);
+ if (getsockname(fd_remote, (struct sockaddr *) &local_addr, &local_addr_len) < 0) {
+- log(LOG_ERR, pid, "getpeername failed %d:%s\n", errno, strerror(errno));
++ hunt_log(LOG_ERR, pid, "getpeername failed %d:%s\n", errno, strerror(errno));
+ exit(1);
+ }
+
+@@ -214,13 +214,13 @@
+ to_addr_len = sizeof(to_addr);
+ memset(&to_addr, 0, sizeof(to_addr));
+ if (getsockname(fd, (struct sockaddr *) &to_addr, &to_addr_len) < 0) {
+- log(LOG_ERR, pid, "getsockname failed %d:%s\n", errno, strerror(errno));
++ hunt_log(LOG_ERR, pid, "getsockname failed %d:%s\n", errno, strerror(errno));
+ exit(1);
+ }
+ from_addr_len = sizeof(from_addr);
+ memset(&from_addr, 0, sizeof(from_addr));
+ if (getpeername(fd, (struct sockaddr *) &from_addr, &from_addr_len) < 0) {
+- log(LOG_ERR, pid, "getpeername failed %d:%s\n", errno, strerror(errno));
++ hunt_log(LOG_ERR, pid, "getpeername failed %d:%s\n", errno, strerror(errno));
+ exit(1);
+ }
+ print_connect(pid, &from_addr, &to_addr);
+@@ -328,7 +328,7 @@
+ openlog(prog_name, LOG_PID, LOG_DAEMON);
+ }
+ if (verbose)
+- log(LOG_DEBUG, getpid(), "ready");
++ hunt_log(LOG_DEBUG, getpid(), "ready");
+
+ for (;;) {
+ clilen = sizeof(cliaddr);
+@@ -336,7 +336,7 @@
+ clifd = accept(lfd, (struct sockaddr *) &cliaddr, &clilen);
+ } while (clifd < 0 && errno == EINTR);
+ if (clifd < 0) {
+- log(LOG_ERR, getpid(), "accept failed %d:%s", errno, strerror(errno));
++ hunt_log(LOG_ERR, getpid(), "accept failed %d:%s", errno, strerror(errno));
+ exit(1);
+ }
+ if ((child_pid = fork()) == 0) {
diff --git a/net-analyzer/hunt/hunt-1.5_p6_p1.ebuild b/net-analyzer/hunt/hunt-1.5_p6_p1.ebuild
new file mode 100644
index 000000000000..bdcca2f3eaf8
--- /dev/null
+++ b/net-analyzer/hunt/hunt-1.5_p6_p1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="tool for checking well known weaknesses in the TCP/IP protocol"
+HOMEPAGE="http://lin.fsid.cvut.cz/~kra/index.html"
+SRC_URI="
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV/_p*}.orig.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV/_p*}-$(ver_cut 4).$(ver_cut 6).diff.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+PATCHES=(
+ "${FILESDIR}"/${P/_p*}-exit.patch
+ "${FILESDIR}"/${P/_p*}-gentoo.patch
+ "${FILESDIR}"/${P/_p*}-log2.patch
+ "${FILESDIR}"/${P/_p*}-tpserv-log.patch
+)
+S=${WORKDIR}/${P/_p*}
+
+src_prepare() {
+ eapply "${WORKDIR}"/${PN}_${PV/_p*}-$(ver_cut 4).$(ver_cut 6).diff
+ default
+}
+
+src_configure() {
+ append-cppflags -DSYNC_FAST
+}
+
+src_compile() {
+ local target
+ for target in . tpserv; do
+ emake CC=$(tc-getCC) LDFLAGS="${CFLAGS} ${LDFLAGS}" -C "${target}"
+ done
+}
+
+src_install() {
+ dosbin hunt tpserv/tpserv tpsetup/transproxy
+ doman man/hunt.1
+ dodoc CHANGES README* TODO tpsetup/transproxy
+ newdoc debian/changelog debian.changelog
+}