Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/trafshow/files/, net-analyzer/trafshow/
Date: Tue, 01 Sep 2020 06:36:56
Message-Id: 1598942211.ac5aed68fd7b5cf55b1a22cfa417b65ae29c400c.jer@gentoo
1 commit: ac5aed68fd7b5cf55b1a22cfa417b65ae29c400c
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 1 06:36:08 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 1 06:36:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac5aed68
7
8 net-analyzer/trafshow: Fix building against libpcap-1.10.0
9
10 Package-Manager: Portage-3.0.5, Repoman-3.0.1
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 .../trafshow/files/trafshow-5.2.3-pcap_init.patch | 29 ++++++++++++++
14 net-analyzer/trafshow/trafshow-5.2.3-r1.ebuild | 45 ++++++++++++++++++++++
15 2 files changed, 74 insertions(+)
16
17 diff --git a/net-analyzer/trafshow/files/trafshow-5.2.3-pcap_init.patch b/net-analyzer/trafshow/files/trafshow-5.2.3-pcap_init.patch
18 new file mode 100644
19 index 00000000000..046795a5832
20 --- /dev/null
21 +++ b/net-analyzer/trafshow/files/trafshow-5.2.3-pcap_init.patch
22 @@ -0,0 +1,29 @@
23 +--- a/trafshow.c
24 ++++ b/trafshow.c
25 +@@ -58,7 +58,7 @@
26 + static void vers();
27 + static void usage();
28 + static pcap_if_t *pcap_matchdev(pcap_if_t *dp, const char *name);
29 +-static int pcap_init(PCAP_HANDLER **ph_list, pcap_if_t *dp);
30 ++static int ts_pcap_init(PCAP_HANDLER **ph_list, pcap_if_t *dp);
31 + static void *pcap_feed(void *arg); /* PCAP_HANDLER *ph */
32 + #ifdef HAVE_PCAP_GET_SELECTABLE_FD
33 + static void *pcap_feed2(void *arg); /* PCAP_HANDLER *ph */
34 +@@ -172,7 +172,7 @@
35 + }
36 +
37 + /* initialize list of pcap handlers */
38 +- if ((op = pcap_init(&ph_list, dev_list)) < 1) {
39 ++ if ((op = ts_pcap_init(&ph_list, dev_list)) < 1) {
40 + fprintf(stderr, "No packet capture device available (no permission?)\n");
41 + exit(1);
42 + }
43 +@@ -298,7 +298,7 @@
44 + }
45 +
46 + static int
47 +-pcap_init(ph_list, dp)
48 ++ts_pcap_init(ph_list, dp)
49 + PCAP_HANDLER **ph_list;
50 + pcap_if_t *dp;
51 + {
52
53 diff --git a/net-analyzer/trafshow/trafshow-5.2.3-r1.ebuild b/net-analyzer/trafshow/trafshow-5.2.3-r1.ebuild
54 new file mode 100644
55 index 00000000000..ce61398d05f
56 --- /dev/null
57 +++ b/net-analyzer/trafshow/trafshow-5.2.3-r1.ebuild
58 @@ -0,0 +1,45 @@
59 +# Copyright 1999-2020 Gentoo Authors
60 +# Distributed under the terms of the GNU General Public License v2
61 +
62 +EAPI=7
63 +inherit autotools
64 +
65 +DESCRIPTION="Full screen visualization of the network traffic"
66 +HOMEPAGE="http://soft.risp.ru/trafshow/index_en.shtml"
67 +SRC_URI="ftp://ftp.nsk.su/pub/RinetSoftware/${P}.tgz"
68 +
69 +LICENSE="BSD"
70 +SLOT="3"
71 +KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
72 +IUSE="slang"
73 +
74 +DEPEND="
75 + net-libs/libpcap
76 + !slang? ( sys-libs/ncurses )
77 + slang? ( >=sys-libs/slang-1.4 )
78 +"
79 +BDEPEND="
80 + virtual/pkgconfig
81 +"
82 +PATCHES=(
83 + "${FILESDIR}"/${P}-gcc44.patch
84 + "${FILESDIR}"/${P}-gentoo.patch
85 + "${FILESDIR}"/${P}-pcap_init.patch
86 + "${FILESDIR}"/${P}-tinfo.patch
87 +)
88 +
89 +src_prepare() {
90 + default
91 + cat /usr/share/aclocal/pkg.m4 >> aclocal.m4 || die
92 + eautoreconf
93 +}
94 +
95 +src_configure() {
96 + if ! use slang; then
97 + # No command-line option so pre-cache instead
98 + export ac_cv_have_curses=ncurses
99 + export LIBS=-lncurses
100 + fi
101 +
102 + default
103 +}