Skip to contentSkip to conversation

netsniff-ng: override NACL_INC_DIR and NACL_LIB_DIR to fix broken builds on system where nacl is installed + add dependencies on geoip, ncurses and zlib so that the entire netsniff-ng toolset can be build

PATCH New Joris Lijssens 2 participants 2 messages Nov 18, 2015 – Nov 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netsniff-ng: override NACL_INC_DIR and NACL_LIB_DIR to fix broken builds on system where nacl is installed + add dependencies on geoip, ncurses and zlib so that the entire netsniff-ng toolset can be build

---
 package/netsniff-ng/Config.in      | 3 +++
 package/netsniff-ng/netsniff-ng.mk | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
package/netsniff-ng/Config.in +3 -0
index 8c48f39..fe02ea3 100644
@@ -6,6 +6,9 @@ config BR2_PACKAGE_NETSNIFF_NG
 	select BR2_PACKAGE_LIBNETFILTER_CONNTRACK
 	select BR2_PACKAGE_LIBURCU
 	select BR2_PACKAGE_LIBNET
+	select BR2_PACKAGE_GEOIP
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_ZLIB
 	# Build with uClibc fails due to missing ceill()
 	# Build with musl fails due to various header issues
 	depends on BR2_TOOLCHAIN_USES_GLIBC
package/netsniff-ng/netsniff-ng.mk +5 -1
index 4fed88c..a6dfb61 100644
@@ -8,13 +8,17 @@ NETSNIFF_NG_VERSION = v0.5.9
 NETSNIFF_NG_SITE = $(call github,netsniff-ng,netsniff-ng,$(NETSNIFF_NG_VERSION))
 NETSNIFF_NG_LICENSE = GPLv2
 NETSNIFF_NG_LICENSE_FILES = README COPYING
+NETSNIFF_NG_CONF_ENV = \
+			NACL_INC_DIR=/dev/null \
+			NACL_LIB_DIR=/dev/null
 NETSNIFF_NG_DEPENDENCIES = \
 	libnl libpcap libcli libnetfilter_conntrack \
-	liburcu libnet
+	liburcu libnet geoip ncurses zlib
 
 # hand-written configure script and makefile
 define NETSNIFF_NG_CONFIGURE_CMDS
 	(cd $(@D); \
+		$(NETSNIFF_NG_CONF_ENV) \
 		$(TARGET_CONFIGURE_ARGS) \
 		$(TARGET_CONFIGURE_OPTS) \
 		./configure \
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 netsniff-ng: override NACL_INC_DIR and NACL_LIB_DIR to fix broken builds on system where nacl is installed + add dependencies on geoip, ncurses and zlib so that the entire netsniff-ng toolset can be build

Joris,

Thanks for this patch! There are however a few issues with it.

The first issue is that the commit title is way too long. The proper format for a git commit log is:

====================================================================
<package>: title that is less than 80 chars and summarizes the change

A first paragraph that gives more details about the change. Notice how it is separated from the title by one new line.

This is another paragraph giving additional details about the changes.

====================================================================

Also, you commit title that contains two parts (fixing nacl related stuff and adding geoip, ncurses, zlib) should hint you that you should not submit one patch but instead two patches: one for the nacl stuff and one for the geoip/ncurses/zlib stuff.

Quoted 11 lines · Joris Lijssens
---
 package/netsniff-ng/Config.in      | 3 +++
 package/netsniff-ng/netsniff-ng.mk | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
package/netsniff-ng/Config.in +0 -0
index 8c48f39..fe02ea3 100644

package/netsniff-ng/Config.in config BR2_PACKAGE_NETSNIFF_NG · line 11

Quoted 6 lines
package/netsniff-ng/Config.in +3 -0
@@ -6,6 +6,9 @@ config BR2_PACKAGE_NETSNIFF_NG
 	select BR2_PACKAGE_LIBNETFILTER_CONNTRACK
 	select BR2_PACKAGE_LIBURCU
 	select BR2_PACKAGE_LIBNET
+	select BR2_PACKAGE_GEOIP
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_ZLIB

Why do you make these mandatory? netsniff-ng can build perfectly fine without them, so there is no reason to turn these optional dependencies into mandatory dependencies.

Quoted 8 lines
package/netsniff-ng/Config.in +0 -0
 	# Build with uClibc fails due to missing ceill()
 	# Build with musl fails due to various header issues
 	depends on BR2_TOOLCHAIN_USES_GLIBC
package/netsniff-ng/netsniff-ng.mk +0 -0
index 4fed88c..a6dfb61 100644

package/netsniff-ng/netsniff-ng.mk NETSNIFF_NG_VERSION = v0.5.9 · line 13

Quoted 6 lines
package/netsniff-ng/netsniff-ng.mk +3 -0
@@ -8,13 +8,17 @@ NETSNIFF_NG_VERSION = v0.5.9
 NETSNIFF_NG_SITE = $(call github,netsniff-ng,netsniff-ng,$(NETSNIFF_NG_VERSION))
 NETSNIFF_NG_LICENSE = GPLv2
 NETSNIFF_NG_LICENSE_FILES = README COPYING
+NETSNIFF_NG_CONF_ENV = \
+			NACL_INC_DIR=/dev/null \
+			NACL_LIB_DIR=/dev/null

Indentation should be just one tab, i.e:

NETSNIFF_NG_CONF_ENV = \
	NACL_INC_DIR=/dev/null \
	NACL_LIB_DIR=/dev/null

And a comment above would be nice, like:

# Prevent netsniff-ng configure script from finding a host installed

# nacl

package/netsniff-ng/netsniff-ng.mk NETSNIFF_NG_VERSION = v0.5.9 · line 16

Quoted 4 lines
package/netsniff-ng/netsniff-ng.mk +1 -1
 NETSNIFF_NG_DEPENDENCIES = \
 	libnl libpcap libcli libnetfilter_conntrack \
-	liburcu libnet
+	liburcu libnet geoip ncurses zlib

If you make them optional, you can do:

ifeq ($(BR2_PACKAGE_GEOIP),y)
NETSNIFF_NG_DEPENDENCIES += geoip
endif

ifeq ($(BR2_PACKAGE_NCURSES),y)
NETSNIFF_NG_DEPENDENCIES += ncurses
endif

ifeq ($(BR2_PACKAGE_ZLIB),y)
NETSNIFF_NG_DEPENDENCIES += zlib
endif

Of course, this is OK if those dependencies are independent from each other. If you need the three of them for netsniff-ng to provide an additional feature, then you would have to express the dependency differently (we can talk about that later if it's the case).

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com