aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Guillaume W. Bres <guillaume.bressaix@gmail.com>2020-06-22 12:53:59 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2020-06-22 22:21:40 +0200
commitb6ce06cd64b0d85c9065c60fad933c8585730320 (patch)
treee71c99b5df64d789a806751a18f3610fea3ba2f9
parent5a07864be003471503e9ad04413966b73bd821ec (diff)
downloadbuildroot-b6ce06cd64b0d85c9065c60fad933c8585730320.tar.gz
buildroot-b6ce06cd64b0d85c9065c60fad933c8585730320.tar.bz2
package/libnids: new package
Libnids is a C based networking library, part of networking intrusion detection tools. It can watch network traffic & provide informations. Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com> [Thomas: - only needs libpcap as a mandatory dependency - add patch to fix libpcap detection - pass install_root= at installation time - drop glibc dependency, it builds fine with uclibc] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-rw-r--r--DEVELOPERS1
-rw-r--r--package/Config.in1
-rw-r--r--package/libnids/0001-libpcap-use-pkg-config.patch48
-rw-r--r--package/libnids/Config.in14
-rw-r--r--package/libnids/libnids.hash3
-rw-r--r--package/libnids/libnids.mk22
6 files changed, 89 insertions, 0 deletions
diff --git a/DEVELOPERS b/DEVELOPERS
index dc9fa8a718..fb6d4cec64 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1053,6 +1053,7 @@ F: package/c-icap-modules/
F: package/sdl2/
N: Guillaume William Brs <guillaume.bressaix@gmail.com>
+F: package/libnids/
F: package/liquid-dsp/
F: package/pixiewps/
F: package/python-pybind/
diff --git a/package/Config.in b/package/Config.in
index dc24921e0f..e2bb004015 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1710,6 +1710,7 @@ menu "Networking"
source "package/libnfnetlink/Config.in"
source "package/libnftnl/Config.in"
source "package/libnice/Config.in"
+ source "package/libnids/Config.in"
source "package/libnl/Config.in"
source "package/liboauth/Config.in"
source "package/liboping/Config.in"
diff --git a/package/libnids/0001-libpcap-use-pkg-config.patch b/package/libnids/0001-libpcap-use-pkg-config.patch
new file mode 100644
index 0000000000..8f8df478d1
--- /dev/null
+++ b/package/libnids/0001-libpcap-use-pkg-config.patch
@@ -0,0 +1,48 @@
+configure.in: use pkg-config for libpcap detection
+
+The detection of libpcap was based in ${prefix}, which doesn't make
+sense in a cross-compilation context and can cause host leakage into
+the target build.
+
+So instead, let's use pkg-config to detect libpcap, since it is anyway
+already use in this configure.in to detect libglib.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+
+Index: b/configure.in
+===================================================================
+--- a/configure.in
++++ b/configure.in
+@@ -75,25 +75,13 @@
+ fi
+ ;;
+ esac ],
+-[ if test -f ${prefix}/include/pcap.h; then
+- PCAP_CFLAGS="-I${prefix}/include"
+- PCAPLIB="-L${exec_prefix}/lib -lpcap"
+- elif test -f /usr/include/pcap/pcap.h; then
+- PCAP_CFLAGS="-I/usr/include/pcap"
+- PCAPLIB="-lpcap"
+- else
+- TMP=$LIBS
+- LIBS="-lpcap $LIBS"
+- AC_TRY_LINK([#include <pcap.h>], pcap_open_offline("",""),
+- LIBPCAP_FOUND=1,LIBPCAP_FOUND=0)
+- LIBS=$TMP
+- if test $LIBPCAP_FOUND = 1 ; then
+- PCAPLIB="-lpcap"
+- else
+- AC_ERROR(libpcap not found)
+- fi
+- fi
+- AC_MSG_RESULT(yes) ]
++[
++ PKG_PROG_PKG_CONFIG
++ PKG_CHECK_MODULES(LIBPCAP, libpcap)
++ AC_MSG_RESULT(yes)
++ PCAP_CFLAGS=${LIBPCAP_CFLAGS}
++ PCAPLIB=${LIBPCAP_LIBS}
++]
+ )
+ AC_SUBST(PCAP_CFLAGS)
+ AC_SUBST(PCAPLIB)
diff --git a/package/libnids/Config.in b/package/libnids/Config.in
new file mode 100644
index 0000000000..30528f4d07
--- /dev/null
+++ b/package/libnids/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_LIBNIDS
+ bool "libnids"
+ select BR2_PACKAGE_LIBPCAP
+ help
+ Libnids is an implementation of an E-component of Network
+ Intrusion Detection System.
+
+ libnids watches all local network traffic, and provides
+ convenient information on them to perform further analysis.
+
+ Libnids offers IP defragmentation, TCP stream assembly, TCP
+ port scan detection.
+
+ http://libnids.sourceforge.net/
diff --git a/package/libnids/libnids.hash b/package/libnids/libnids.hash
new file mode 100644
index 0000000000..4a2949c39d
--- /dev/null
+++ b/package/libnids/libnids.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 314b4793e0902fbf1fdb7fb659af37a3c1306ed1aad5d1c84de6c931b351d359 libnids-1.24.tar.gz
+sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad COPYING
diff --git a/package/libnids/libnids.mk b/package/libnids/libnids.mk
new file mode 100644
index 0000000000..ee7c71ee88
--- /dev/null
+++ b/package/libnids/libnids.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# libnids
+#
+################################################################################
+
+LIBNIDS_VERSION = 1.24
+LIBNIDS_SITE = https://sourceforge.net/projects/libnids/files/libnids/$(LIBNIDS_VERSION)
+LIBNIDS_LICENSE = GPL-2.0
+LIBNIDS_LICENSE_FILES = COPYING
+LIBNIDS_INSTALL_STAGING = YES
+LIBNIDS_DEPENDENCIES = host-pkgconf libpcap
+LIBNIDS_AUTORECONF = YES
+LIBNIDS_CONF_OPTS = \
+ --disable-libglib \
+ --disable-libnet
+# hand-written Makefile.in, not using automake, needs a custom
+# variable for the installation path.
+LIBNIDS_INSTALL_STAGING_OPTS = install_prefix=$(STAGING_DIR) install
+LIBNIDS_INSTALL_TARGET_OPTS = install_prefix=$(TARGET_DIR) install
+
+$(eval $(autotools-package))