public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/tracebox/, net-analyzer/tracebox/files/
@ 2020-07-15  6:50 Jeroen Roovers
  0 siblings, 0 replies; 2+ messages in thread
From: Jeroen Roovers @ 2020-07-15  6:50 UTC (permalink / raw
  To: gentoo-commits

commit:     af29dcb2b47e85cdc8972592bfe5d12b4da714b8
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 06:50:04 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Jul 15 06:50:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af29dcb2

net-analyzer/tracebox: Version 0.4.4

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Closes: https://bugs.gentoo.org/732390
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 net-analyzer/tracebox/Manifest                     |   1 +
 .../tracebox/files/tracebox-0.4.4-deps.patch       | 156 +++++++++++++++++++++
 net-analyzer/tracebox/metadata.xml                 |  18 ++-
 net-analyzer/tracebox/tracebox-0.4.4.ebuild        |  62 ++++++++
 4 files changed, 230 insertions(+), 7 deletions(-)

diff --git a/net-analyzer/tracebox/Manifest b/net-analyzer/tracebox/Manifest
index 8d01e9c4c25..db071542f40 100644
--- a/net-analyzer/tracebox/Manifest
+++ b/net-analyzer/tracebox/Manifest
@@ -1 +1,2 @@
 DIST tracebox-0.2.tar.gz 27954 BLAKE2B 57f4e36c727ebbb19161a6b4c887b64fdd362b033e09116f2e602a01737f19f10e6d0378296e70f683a5b8d53a57dae032e67098dd5989bb094daf3a3382a5d5 SHA512 15bfaede7e4828c14efbf7395f3d1c681b672b47157c370f4fe92d5d306ccc8e3e061107c3d36a505d732451d67ea146c21c299e6e826205725ab12680ee773e
+DIST tracebox-0.4.4.tar.gz 76828 BLAKE2B 0c3fbe9ea3fd5a967c85cf7b175900d899885f6c43ca8ffa32ba98256490b5bc23e8f80618208df6ec05f0484e5ce27599528aa5d84e331ac71eca960b6b1fd0 SHA512 2113d6ed4543b0c3a9b44bc92c4eb8ab2a860b4409a5eba374b9960ddb4ba299a33c0dea49595c94bc725eda36633d8bb698236d662ea9cc1027070b597c52f6

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 00000000000..cb47ad0d2ac
--- /dev/null
+++ b/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch
@@ -0,0 +1,156 @@
+--- 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,13 @@
+ 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_INCLUDE="${LUA53_CFLAGS}"; LUA_LIB="${LUA53_LIBS}"],AC_MSG_WARN([lua 5.3 not found]))
++PKG_CHECK_MODULES([LUA52], [lua-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_INCLUDE="${LUA51_CFLAGS}"; LUA_LIB="${LUA51_LIBS}"],AC_MSG_WARN([lua 5.1 not found]))
++
++if test -z "$LUA_INCLUDE" -o -z "$LUA_LIB"; 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 +96,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 +116,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 +163,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 +173,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 e55d9843a68..1de26c10446 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 00000000000..b7d29b7c46a
--- /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)
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/tracebox/, net-analyzer/tracebox/files/
@ 2021-08-01 19:29 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2021-08-01 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     96b03e9e2115af0468c8487cd488e2eb54f33397
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 19:28:54 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Aug  1 19:28:54 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96b03e9e

net-analyzer/tracebox: Fix build with GCC 11

Closes: https://bugs.gentoo.org/786687
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 ...4-deps.patch => tracebox-0.4.4-autotools.patch} | 57 ++++++++++++++++++++++
 .../files/tracebox-0.4.4-include-crafter.patch     | 44 +++++++++++++++++
 net-analyzer/tracebox/tracebox-0.4.4-r100.ebuild   | 50 +++++++------------
 3 files changed, 119 insertions(+), 32 deletions(-)

diff --git a/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch b/net-analyzer/tracebox/files/tracebox-0.4.4-autotools.patch
similarity index 81%
rename from net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch
rename to net-analyzer/tracebox/files/tracebox-0.4.4-autotools.patch
index 43c0132a49a..612132d157f 100644
--- a/net-analyzer/tracebox/files/tracebox-0.4.4-deps.patch
+++ b/net-analyzer/tracebox/files/tracebox-0.4.4-autotools.patch
@@ -1,3 +1,8 @@
+- do not link to bundled
+  * dev-libs/json-c
+  * net-libs/libcrafter
+- allow different lua versions
+
 --- a/configure.ac
 +++ b/configure.ac
 @@ -14,6 +14,8 @@
@@ -155,3 +160,55 @@
  
      ac_configure_args="$ac_configure_args_pre"
  ])
+@@ -271,7 +190,6 @@
+ 
+ AC_CONFIG_FILES([
+ 	Makefile
+-	noinst/Makefile
+ 	src/Makefile
+ 	src/tracebox/Makefile
+ 	tests/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -8,8 +8,8 @@
+ MAYBE_DOC = doc
+ endif
+ 
+-SUBDIRS = noinst src $(MAYBE_OPT) $(MAYBE_DOC)
+-DIST_SUBDIRS = noinst src tests doc
++SUBDIRS =  src $(MAYBE_OPT) $(MAYBE_DOC)
++DIST_SUBDIRS =  src tests doc
+ 
+ debian-package:
+ 	dpkg-buildpackage -rfakeroot -tc -us -uc
+--- a/noinst/Makefile.am
++++ b/noinst/Makefile.am
+@@ -1,4 +1,3 @@
+-DIST_SUBDIRS = libcrafter/libcrafter
+ 
+ all-local:
+ 	cd libcrafter/libcrafter && $(MAKE) $(AM_MAKEFLAGS) all
+--- a/src/tracebox/Makefile.am
++++ b/src/tracebox/Makefile.am
+@@ -4,7 +4,6 @@
+ 
+ dist_man_MANS = tracebox.1
+ 
+-dist_bin_SCRIPTS = luatracebox
+ 
+ SUBDIRS = examples
+ 
+@@ -78,13 +77,11 @@
+ 
+ tracebox_LDADD = \
+ 	$(EXTRALIBS) \
+-	$(abs_top_builddir)/noinst/libcrafter/libcrafter/libcrafter.la \
+ 	$(LUA_LIB) \
+ 	$(PCAPLIB) \
+ 	$(JSON_LIB)
+ 
+ tracebox_CPPFLAGS = \
+-	-I$(top_srcdir)/noinst/libcrafter/libcrafter \
+ 	$(LUA_INCLUDE) \
+ 	$(PCAPINC) \
+ 	$(JSON_INCLUDE) \

diff --git a/net-analyzer/tracebox/files/tracebox-0.4.4-include-crafter.patch b/net-analyzer/tracebox/files/tracebox-0.4.4-include-crafter.patch
new file mode 100644
index 00000000000..bedd0208303
--- /dev/null
+++ b/net-analyzer/tracebox/files/tracebox-0.4.4-include-crafter.patch
@@ -0,0 +1,44 @@
+--- a/src/tracebox/PacketModification.h
++++ b/src/tracebox/PacketModification.h
+@@ -8,7 +8,7 @@
+ #ifndef __PACKETMODIFICATION_H__
+ #define __PACKETMODIFICATION_H__
+ 
+-#include "crafter.h"
++#include <crafter.h>
+ #ifdef HAVE_LIBJSON
+ #include <json/json.h>
+ #endif
+--- a/src/tracebox/PartialHeader.h
++++ b/src/tracebox/PartialHeader.h
+@@ -8,7 +8,7 @@
+ #ifndef __PARTIALHEADER_H__
+ #define __PARTIALHEADER_H__
+ 
+-#include "crafter.h"
++#include <crafter.h>
+ 
+ /* ICMP message can contains partial header information */
+ 
+--- a/src/tracebox/script.h
++++ b/src/tracebox/script.h
+@@ -9,7 +9,7 @@
+ #ifndef __TRACEBOX_SCRIPT_H__
+ #define __TRACEBOX_SCRIPT_H__
+ 
+-#include "crafter.h"
++#include <crafter.h>
+ 
+ Crafter::Packet *script_packet(std::string& cmd);
+ int script_exec(const char*, int, char**);
+--- a/src/tracebox/tracebox.h
++++ b/src/tracebox/tracebox.h
+@@ -11,7 +11,7 @@
+ 
+ #include <memory>
+ 
+-#include "crafter.h"
++#include <crafter.h>
+ #include "config.h"
+ #include "PacketModification.h"
+ 

diff --git a/net-analyzer/tracebox/tracebox-0.4.4-r100.ebuild b/net-analyzer/tracebox/tracebox-0.4.4-r100.ebuild
index 63a8ba122cb..7278ad0ab73 100644
--- a/net-analyzer/tracebox/tracebox-0.4.4-r100.ebuild
+++ b/net-analyzer/tracebox/tracebox-0.4.4-r100.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 LUA_COMPAT=( lua5-{1..4} luajit )
 
-inherit autotools lua-single
+inherit autotools flag-o-matic lua-single
 
 DESCRIPTION="A Middlebox Detection Tool"
 HOMEPAGE="http://www.tracebox.org/"
@@ -15,51 +15,37 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="curl sniffer"
-
 REQUIRED_USE="${LUA_REQUIRED_USE}"
+RESTRICT="test"
 
 RDEPEND="${LUA_DEPS}
 	>=net-libs/libcrafter-0.3_p20171019
 	dev-libs/json-c
 	net-libs/libpcap
 	curl? ( net-misc/curl )
-	sniffer? ( net-libs/libnetfilter_queue )
-"
-DEPEND="
-	${RDEPEND}
-"
-BDEPEND="
-	virtual/pkgconfig
-"
-RESTRICT="test"
+	sniffer? ( net-libs/libnetfilter_queue )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
 PATCHES=(
-	"${FILESDIR}"/${PN}-0.4.4-deps.patch
+	"${FILESDIR}"/${P}-autotools.patch
+	"${FILESDIR}"/${P}-include-crafter.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
-
+	# remove bundled
+	# - dev-libs/json-c
+	# - net-libs/libcrafter
+	rm -r noinst || die
 	eautoreconf
 }
 
 src_configure() {
+	# https://bugs.gentoo.org/786687
+	# std::byte clashes with crafter/Types.h typedef
+	append-cxxflags -std=c++14
+
 	econf \
 		$(use_enable curl) \
 		$(use_enable sniffer)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-01 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-01 19:29 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/tracebox/, net-analyzer/tracebox/files/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2020-07-15  6:50 Jeroen Roovers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox