Skip to contentSkip to conversation

networking: add new netsniff-ng recipe version 0.6.8

PATCH Clément Péron 1 participant 1 message Feb 17, 2022 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Hi Khem,

Quoted 65 lines · Khem Raj
Quoted 51 lines · Clément Péron

Netsniff-ng is a fast zero-copy analyzer, pcap capturing and replaying tool.

Actually the Makefile doesn't create the folder when installing tools, let's add a patch to fix this.

---
  ...001-Cmds-automatically-create-folder.patch | 26 +++++++++++++
  .../netsniff-ng/netsniff-ng_0.6.8.bb          | 39 +++++++++++++++++++
  2 files changed, 65 insertions(+)

create mode 100644 meta-networking/recipes-support/netsniff-ng/files/0001-Cmds-automatically-create-folder.patch create mode 100644 meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb

meta-networking/recipes-support/netsniff-ng/files/0001-Cmds-automatically-create-folder.patch new file +26 -0
new file mode 100644
index 000000000..e535aedf5
@@ -0,0 +1,26 @@
+From 7c00d75d16da18a9998fc4cca28d3c953dd54ceb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= <[email protected]>
+Date: Mon, 14 Feb 2022 18:37:22 +0100
+Subject: [PATCH] Cmds: automatically create folder
+
+---
+ Cmds | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Cmds b/Cmds
+index e590b38..3df23b8 100644
+--- a/Cmds
++++ b/Cmds
+@@ -44,7 +44,8 @@ ifeq ("$(origin PREFIX)", "$(filter $(origin PREFIX), file command line)")
+   INSTX = echo -e "  INST\t$(1)" && install -d $(2) && \
+     install -C $(1) $(2)/$(shell basename $(1))
+ else
+-  INSTX = echo -e "  INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1))
++  INSTX = echo -e "  INST\t$(1)" && install -d $(2) && \
++    install -C $(1) $(2)/$(shell basename $(1))
+ endif
+
+ MKDIR = echo -e  "  MKDIR\t$(1)" && mkdir -p $(1)
+--
+2.32.0
+
meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb new file +0 -0
new file mode 100644
index 000000000..cb4f03400

meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb line 7

Quoted 7 lines
meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb new file +7 -0
@@ -0,0 +1,39 @@
+DESCRIPTION = "Netsniff-ng is a fast zero-copy analyzer, pcap capturing and replaying tool"
+HOMEPAGE = "http://netsniff-ng.org"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9dd40dfb621eed702c0775577fbb7011"
+DEPENDS = "libpcap"
+
+SRCREV = "v${PV}"

Please use hardcoded git sha for SRCREV

Quoted 11 lines

meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb line 16

Quoted 9 lines
meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb new file +9 -0
+SRC_URI = " \
+     git://github.com/netsniff-ng/netsniff-ng.git;protocol=https;branch=master \
+     file://0001-Cmds-automatically-create-folder.patch \
+     "
+
+S = "${WORKDIR}/git"
+
+# Avoids build breaks when using no-static-libs.inc
+DISABLE_STATIC = ""

can this be explained a better why it fails.

Hi, sorry this was required in a previous version when I used EXTRA_OECONF.

Without this EXTRA_OECONF was automatically set to "--disable-static" which is unrecognised by the configure script and makes the configure step fail.

I will remove this in v2

Thanks for the catch,
Clement

Quoted 24 lines
Quoted 24 lines
meta-networking/recipes-support/netsniff-ng/netsniff-ng_0.6.8.bb new file +23 -0
+
+inherit pkgconfig
+
+EXTRA_OEMAKE += " TERM='' "
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[zlib] = ",--disable-zlib,zlib,"
+PACKAGECONFIG[libnl] = ",--disable-libnl,libnl,"
+PACKAGECONFIG[geoip] = ",--disable-geoip,geoip,"
+
+do_configure() {
+    ./configure --prefix=${prefix}
+}
+
+do_compile() {
+    oe_runmake
+}
+
+do_install() {
+    oe_runmake DESTDIR=${D} netsniff-ng_install
+}
+
+BBCLASSEXTEND = "native nativesdk"