summaryrefslogtreecommitdiff
path: root/net-analyzer/tracebox
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /net-analyzer/tracebox
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'net-analyzer/tracebox')
-rw-r--r--net-analyzer/tracebox/Manifest5
-rw-r--r--net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch157
-rw-r--r--net-analyzer/tracebox/metadata.xml18
-rw-r--r--net-analyzer/tracebox/tracebox-0.4.4.ebuild62
4 files changed, 234 insertions, 8 deletions
diff --git a/net-analyzer/tracebox/Manifest b/net-analyzer/tracebox/Manifest
index fa2577ac25e3..1a8d2fe608bd 100644
--- a/net-analyzer/tracebox/Manifest
+++ b/net-analyzer/tracebox/Manifest
@@ -1,4 +1,7 @@
AUX tracebox-0.2-deps.patch 1119 BLAKE2B dc1a567aec9ec7cf6d66f3b722f1786d5730c5d351ae4fa2c9d03387fd6cb2c5b04229803ea7ed7fdc075692ca04deb4ec6068d65dfd01d73169ac63a0db887b SHA512 ecfffb4fca07597361170681762ea001a403979a96b8681fa144f7dc86c6d3b508d756863f8b2584f4951c1207a23c6babf7457f5f48dce1c400fe87ab5985b3
+AUX tracebox-0.4.4-deps.patch 5159 BLAKE2B cea5cfb75b407c7e9a88062abc931ae27b7f5022e586ee7f811129ac2b5c5a54a61b6a0ce71961ebf6102d1b53087e91260cfe4d8f6622d78e98e87408c2d64b SHA512 a87ff6ef0079f99241dd975d1fcb1bb3d1c2a0a623af1932d9a00b45b6d70b403e34f8dbc07551cda55707d5eea5e48a7bb7ac931474efe6186937942a769761
DIST tracebox-0.2.tar.gz 27954 BLAKE2B 57f4e36c727ebbb19161a6b4c887b64fdd362b033e09116f2e602a01737f19f10e6d0378296e70f683a5b8d53a57dae032e67098dd5989bb094daf3a3382a5d5 SHA512 15bfaede7e4828c14efbf7395f3d1c681b672b47157c370f4fe92d5d306ccc8e3e061107c3d36a505d732451d67ea146c21c299e6e826205725ab12680ee773e
+DIST tracebox-0.4.4.tar.gz 76828 BLAKE2B 0c3fbe9ea3fd5a967c85cf7b175900d899885f6c43ca8ffa32ba98256490b5bc23e8f80618208df6ec05f0484e5ce27599528aa5d84e331ac71eca960b6b1fd0 SHA512 2113d6ed4543b0c3a9b44bc92c4eb8ab2a860b4409a5eba374b9960ddb4ba299a33c0dea49595c94bc725eda36633d8bb698236d662ea9cc1027070b597c52f6
EBUILD tracebox-0.2.ebuild 973 BLAKE2B 8b26b66ed51cb1059a4dcbee1a5cf1167ac5523af0289e538fe9de05e6d042a4765ebf874a557b2659f34461d76e8197a3d1f92a152a9ed384f35739d746a36b SHA512 85a7b38d61154683a1288d9e1e8ef5a271e7840493998a1caa462ce13a3df1327520c3e8dd0be1e4246e4e3d48cca02fee32bc94ceea28dde8a7fff06a3daec1
-MISC metadata.xml 362 BLAKE2B 60c290a9274fcf06e824403a29b161698e8d69fb3f8225ef2d7751e0411df8031293a304107ec73435dd6730fb10b5141c56147d10a12939dd57be6e7f6015db SHA512 8a03e6fbda5bad0b496b5acf23e79cfd5d7e96c6062dd67b4bb8ab9ff949d7ea2238d06b06300dec48ed988e5b04dd811c1826edeb0b8fed56274f37640b56d4
+EBUILD tracebox-0.4.4.ebuild 1172 BLAKE2B 2808a98a047d80e7166aa165c389e1b93d953ea94c4d35a29a34993f0731a1b794faee9fb51f6b9cf2957faea1237dfefb2610dec57c9d9edf5690a4d200351f SHA512 c463e77f6f2b0db874cfb9aeb6323aa41284765494b248667d81752b184d2f51712da3551f56f1482bc18742957579288553d258f64eb199938346275ffd9a2a
+MISC metadata.xml 575 BLAKE2B 0de780b436640051b1fbcf49505d8975d39b3a4fa0d45a408718b9ca284e7f7f2609cffcda406c84fdc5b6fe2116d579e5624d8557751e3888c5a45ebdf95d54 SHA512 9cfa13bf788534c7bfd4edf945efa310e24229e9d777eecb1ad371ed99c13f39c63af14bf41e441ef94bd75ba53f318f23d48fd4fccd2d49e8d64b9d8fa2d83a
diff --git a/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch b/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch
new file mode 100644
index 000000000000..43c0132a49a7
--- /dev/null
+++ b/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch
@@ -0,0 +1,157 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,6 +14,8 @@
+ AC_HEADER_STDC
+ AC_HEADER_ASSERT
+
++PKG_PROG_PKG_CONFIG
++
+ AX_CXX_COMPILE_STDCXX_11
+
+ # Checks for header files.
+@@ -32,40 +34,14 @@
+ AC_FUNC_FORK
+ AC_CHECK_FUNCS([gettimeofday memset select socket strtol])
+
+-AC_ARG_WITH(lua,
+-[ --with-lua=DIR use lua in DIR],
+-[ case "$withval" in
+- yes|no)
+- AC_MSG_RESULT(no)
+- ;;
+- *)
+- AC_MSG_RESULT($withval)
+- if test -f $withval/lua.h -a -f $withval/liblua.a; then
+- owd=`pwd`
+- if cd $withval; then withval=`pwd`; cd $owd; fi
+- LUA_INCLUDE="-I$withval"
+- LUA_LIB="-L$withval -llua"
+- LIBS="$LIBS -lm"
+- elif test -f $withval/include/lua.h -a -f $withval/lib/liblua.a; then
+- owd=`pwd`
+- if cd $withval; then withval=`pwd`; cd $owd; fi
+- LUA_INCLUDE="-I$withval/include"
+- LUA_LIB="-L$withval/lib -llua"
+- LIBS="$LIBS -lm"
+- else
+- AC_ERROR("lua.h or liblua.a not found in $withval")
+- fi
+- ;;
+- esac ],
+- [
+- AX_PROG_LUA
+- AX_LUA_HEADERS
+- AX_LUA_LIBS
+- if test x"$LUA_LIB" = x; then
+- AC_MSG_ERROR([Lua library not found. You may try option --with-lua-suffix.])
+- fi
+- ]
+-)
++PKG_CHECK_MODULES([LUA53], [lua-5.3], [LUA_FOUND=5.3; LUA_INCLUDE="${LUA53_CFLAGS}"; LUA_LIB="${LUA53_LIBS}"],AC_MSG_WARN([lua 5.3 not found]))
++PKG_CHECK_MODULES([LUA52], [lua-5.2], [LUA_FOUND=5.2; LUA_INCLUDE="${LUA52_CFLAGS}"; LUA_LIB="${LUA52_LIBS}"],AC_MSG_WARN([lua 5.2 not found]))
++PKG_CHECK_MODULES([LUA51], [lua5.1], [LUA_FOUND=5.1; LUA_INCLUDE="${LUA51_CFLAGS}"; LUA_LIB="${LUA51_LIBS}"],AC_MSG_WARN([lua 5.1 not found]))
++PKG_CHECK_MODULES([LUA], [lua], [LUA_FOUND=5.1-noSLOT; LUA_INCLUDE="${LUA_CFLAGS}"; LUA_LIB="${LUA_LIBS}"],AC_MSG_WARN([lua 5.1 not found]))
++
++if test -z "$LUA_FOUND"; then
++ AC_MSG_ERROR([lua 5.3, 5.2 or 5.1 is required])
++fi
+ AC_SUBST(LUA_INCLUDE)
+ AC_SUBST(LUA_LIB)
+
+@@ -121,24 +97,12 @@
+ AC_ARG_WITH(json,
+ [ --with-json=DIR use json-c in DIR],
+ [ case "$withval" in
+- yes|no)
++ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT($withval)
+- if test -f $withval/json.h -a -f $withval/libjson-c.a; then
+- owd=`pwd`
+- if cd $withval; then withval=`pwd`; cd $owd; fi
+- JSON_INCLUDE="-I$withval"
+- JSON_LIB="-L$withval -ljson-c"
+- elif test -f $withval/include/json-c/json.h -a -f $withval/lib/libjson-c.a; then
+- owd=`pwd`
+- if cd $withval; then withval=`pwd`; cd $owd; fi
+- JSON_INCLUDE="-I$withval/include"
+- JSON_LIB="-L$withval/lib -ljson-c"
+- else
+- AC_ERROR("json.h or libjson-c.a not found in $withval")
+- fi
++ PKG_CHECK_MODULES([JSON], [json-c], [JSON_INCLUDE="${JSON_CFLAGS}"; JSON_LIB="${JSON_LIBS}"],AC_MSG_ERROR([json-c was requested but not found]))
+ AC_SUBST(JSON_INCLUDE)
+ AC_SUBST(JSON_LIB)
+ AC_DEFINE([HAVE_JSONC], [1], [Using json-c])
+@@ -153,41 +117,7 @@
+ ]
+ )
+
+-AC_MSG_CHECKING(for libpcap)
+-AC_ARG_WITH(libpcap,
+-[ --with-libpcap=DIR use libpcap in DIR],
+-[ case "$withval" in
+- yes|no)
+- AC_MSG_RESULT(no)
+- ;;
+- *)
+- AC_MSG_RESULT($withval)
+- if test -f $withval/pcap.h -a \
+- -f $withval/libpcap.a -a \
+- -d $withval/pcap; then
+- owd=`pwd`
+- if cd $withval; then withval=`pwd`; cd $owd; fi
+- PCAPINC="-I$withval -I$withval/bpf"
+- PCAPLIB="-L$withval -lpcap"
+- else
+- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
+- fi
+- ;;
+- esac ],
+-[ if test -f ${prefix}/include/pcap.h; then
+- PCAPINC="-I${prefix}/include"
+- PCAPLIB="-L${prefix}/lib -lpcap"
+- elif test -f /usr/include/pcap/pcap.h; then
+- PCAPINC="-I/usr/include/pcap"
+- PCAPLIB="-lpcap"
+- elif test -f /usr/include/pcap.h; then
+- PCAPLIB="-lpcap"
+- else
+- AC_MSG_RESULT(no)
+- AC_ERROR(libpcap not found)
+- fi
+- AC_MSG_RESULT(yes) ]
+-)
++PKG_CHECK_MODULES([PCAP], [libpcap], [PCAPINC="${PCAP_CFLAGS}"; PCAPLIB="${PCAP_LIBS}"],AC_MSG_ERROR([libpcap is required]))
+ AC_SUBST(PCAPINC)
+ AC_SUBST(PCAPLIB)
+
+@@ -234,17 +164,7 @@
+ AC_CHECK_LIB([pthread], [pthread_create])
+ ])
+
+-# Make sure libcrafter build a static library by adding the --disable-shared
+-# argument to the configure script.
+-ac_configure_args_pre="$ac_configure_args"
+-ac_configure_args_post="$ac_configure_args --disable-shared"
+-ac_configure_args="$ac_configure_args_post"
+-
+-AC_CONFIG_COMMANDS_PRE([ac_configure_args="$ac_configure_args_pre"])
+-AC_CONFIG_COMMANDS_POST([ac_configure_args="$ac_configure_args_post"])
+-AC_CONFIG_SUBDIRS(noinst/libcrafter/libcrafter)
+-
+-ac_configure_args="$ac_configure_args_pre"
++PKG_CHECK_MODULES([crafter], [crafter], [LIBS="$LIBS $crafter_LIBS"],AC_MSG_ERROR([libcrafter is required]))
+
+ # Enable click submodule
+ AS_IF([test "x$enable_tests" = "xyes"], [
+@@ -254,7 +174,6 @@
+
+ AC_CONFIG_COMMANDS_PRE([ac_configure_args="$ac_configure_args_pre"])
+ AC_CONFIG_COMMANDS_POST([ac_configure_args="$ac_configure_args_post"])
+- AC_CONFIG_SUBDIRS(tests/tools/click)
+
+ ac_configure_args="$ac_configure_args_pre"
+ ])
diff --git a/net-analyzer/tracebox/metadata.xml b/net-analyzer/tracebox/metadata.xml
index e55d9843a684..1de26c104467 100644
--- a/net-analyzer/tracebox/metadata.xml
+++ b/net-analyzer/tracebox/metadata.xml
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>netmon@gentoo.org</email>
- <name>Gentoo network monitoring and analysis project</name>
- </maintainer>
- <upstream>
- <remote-id type="github">tracebox/tracebox</remote-id>
- </upstream>
+<maintainer type="project">
+<email>netmon@gentoo.org</email>
+<name>Gentoo network monitoring and analysis project</name>
+</maintainer>
+<use>
+<flag name='curl'>Build the curl component for uploading capture files using <pkg>net-misc/curl</pkg></flag>
+<flag name='sniffer'>Build the sniffer component using <pkg>net-libs/libnetfilter_queue</pkg></flag>
+</use>
+<upstream>
+<remote-id type="github">tracebox/tracebox</remote-id>
+</upstream>
</pkgmetadata>
diff --git a/net-analyzer/tracebox/tracebox-0.4.4.ebuild b/net-analyzer/tracebox/tracebox-0.4.4.ebuild
new file mode 100644
index 000000000000..b7d29b7c46ab
--- /dev/null
+++ b/net-analyzer/tracebox/tracebox-0.4.4.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools
+
+DESCRIPTION="A Middlebox Detection Tool"
+HOMEPAGE="http://www.tracebox.org/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="curl sniffer"
+
+RDEPEND="
+ >=net-libs/libcrafter-0.3_p20171019
+ dev-lang/lua:*
+ dev-libs/json-c
+ net-libs/libpcap
+ curl? ( net-misc/curl )
+ sniffer? ( net-libs/libnetfilter_queue )
+"
+DEPEND="
+ ${RDEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+"
+RESTRICT="test"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.4.4-deps.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i -e '/SUBDIRS/s|noinst||g' Makefile.am || die
+ sed -i -e '/DIST_SUBDIRS.*libcrafter/d' noinst/Makefile.am || die
+
+ sed -i \
+ -e '/[[:graph:]]*libcrafter[[:graph:]]*/d' \
+ -e '/dist_bin_SCRIPTS/d' \
+ src/${PN}/Makefile.am \
+ || die
+
+ sed -i \
+ -e 's|"crafter.h"|<crafter.h>|g' \
+ src/${PN}/PacketModification.h \
+ src/${PN}/PartialHeader.h \
+ src/${PN}/script.h \
+ src/${PN}/${PN}.h \
+ || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable curl) \
+ $(use_enable sniffer)
+}