snort3: Backport stable version from 21.02 16062/head
authorMichal Hrusecky <michal.hrusecky@turris.com>
Wed, 7 Jul 2021 10:39:31 +0000 (12:39 +0200)
committerMichal Hrusecky <michal.hrusecky@turris.com>
Wed, 7 Jul 2021 10:39:31 +0000 (12:39 +0200)
Update snort3 from beta to the stable version available in 21.02 version
of feeds.

Signed-off-by: Michal Hrusecky <michal.hrusecky@turris.com>
net/snort3/Makefile
net/snort3/patches/001-compile.patch [deleted file]
net/snort3/patches/002-ignore-liblzma.patch [deleted file]
net/snort3/patches/build-fix.patch [new file with mode: 0644]

index bbe0be642c2056fc8b8c482c3d5c27248cd8d2b3..4530596a82a3f715b78749913997b2e7582c7b03 100644 (file)
@@ -6,21 +6,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=snort3
-PKG_VERSION:=3.0.0-beta
-PKG_VERSION_SHORT:=3.0.0
-PKG_RELEASE:=3
+PKG_VERSION:=3.1.0.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.snort.org/downloads/snortplus/
+PKG_HASH:=c4e2e78e3afa879d7e35e482afe42a6c4b96ed26198a9979edf7953b5151ccbf
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
 
-PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_LICENSE:=GPL-2.0-only
+PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:snort:snort
 
-PKG_SOURCE:=snort-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://www.snort.org/downloads/snortplus/
-PKG_HASH:=ea4079c551002e4d83586f05b3ecdae72706a46ec223339b87ce60f7ae30b8a2
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/snort-$(PKG_VERSION_SHORT)
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
@@ -29,7 +28,7 @@ define Package/snort3
   SUBMENU:=Firewall
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libstdcpp +libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +libhwloc +libtirpc +luajit
+  DEPENDS:=+libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +libhwloc +libtirpc +luajit
   TITLE:=Lightweight Network Intrusion Detection System
   URL:=http://www.snort.org/
   MENU:=1
@@ -44,17 +43,21 @@ define Package/snort3/description
 endef
 
 CMAKE_OPTIONS += \
+       -DUSE_TIRPC:BOOL=YES \
        -DENABLE_STATIC_DAQ:BOOL=NO \
+       -DDAQ_INCLUDE_DIR=$(STAGING_DIR)/usr/include/daq3 \
+       -DDAQ_LIBRARIES_DIR_HINT:PATH=$(STAGING_DIR)/usr/lib/daq3 \
        -DENABLE_COREFILES:BOOL=NO \
        -DENABLE_GDB:BOOL=NO \
        -DMAKE_DOC:BOOL=NO \
        -DMAKE_HTML_DOC:BOOL=NO \
        -DMAKE_PDF_DOC:BOOL=NO \
        -DMAKE_TEXT_DOC:BOOL=NO \
+       -DHAVE_LIBUNWIND=OFF \
        -DHAVE_LZMA=OFF
 
-TARGET_CFLAGS  += -I$(STAGING_DIR)/usr/include/tirpc
-TARGET_LDFLAGS += -ltirpc
+TARGET_CFLAGS  += -I$(STAGING_DIR)/usr/include/daq3 -I$(STAGING_DIR)/usr/include/tirpc
+TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/daq3 -ltirpc
 
 define Package/snort3/conffiles
 /etc/config/snort
@@ -84,10 +87,6 @@ define Package/snort3/install
                $(PKG_INSTALL_DIR)/usr/include/snort/lua/snort_plugin.lua \
                $(1)/usr/share/lua/
 
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/include/snort/lua/snort_config.lua \
-               $(1)/usr/share/lua/
-
        $(INSTALL_DIR) $(1)/etc/snort
 
        $(INSTALL_DIR) $(1)/etc/init.d
diff --git a/net/snort3/patches/001-compile.patch b/net/snort3/patches/001-compile.patch
deleted file mode 100644 (file)
index 09669a3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -u --recursive snort-3.0.0-vanilla/daqs/daq_file.c snort-3.0.0/daqs/daq_file.c
---- snort-3.0.0-vanilla/daqs/daq_file.c        2018-08-28 02:01:02.000000000 -0400
-+++ snort-3.0.0/daqs/daq_file.c        2019-03-28 23:03:25.292770141 -0400
-@@ -33,7 +33,7 @@
- #include <sys/types.h>
- #include <sys/time.h>
--#include <sys/unistd.h>
-+#include <unistd.h>
- #include <daq_api.h>
- #include <sfbpf_dlt.h>
-diff -u --recursive snort-3.0.0-vanilla/daqs/daq_hext.c snort-3.0.0/daqs/daq_hext.c
---- snort-3.0.0-vanilla/daqs/daq_hext.c        2018-08-28 02:01:02.000000000 -0400
-+++ snort-3.0.0/daqs/daq_hext.c        2019-03-28 22:54:15.738207157 -0400
-@@ -35,7 +35,7 @@
- #include <arpa/inet.h>
- #include <sys/types.h>
- #include <sys/time.h>
--#include <sys/unistd.h>
-+#include <unistd.h>
- #include <sys/socket.h>
- #include <daq_api.h>
-diff -u --recursive snort-3.0.0-vanilla/src/network_inspectors/appid/service_plugins/service_rpc.cc snort-3.0.0/src/network_inspectors/appid/service_plugins/service_rpc.cc
---- snort-3.0.0-vanilla/src/network_inspectors/appid/service_plugins/service_rpc.cc    2018-08-28 02:01:02.000000000 -0400
-+++ snort-3.0.0/src/network_inspectors/appid/service_plugins/service_rpc.cc    2019-03-28 22:32:04.211783669 -0400
-@@ -27,6 +27,7 @@
- #include <netdb.h>
-+#include <tirpc/rpc/rpcent.h>
- #if defined(__FreeBSD__) || defined(__OpenBSD__)
- #include <rpc/rpc.h>
- #elif defined(__sun)
-diff -u --recursive snort-3.0.0-vanilla/src/utils/util.cc snort-3.0.0/src/utils/util.cc
---- snort-3.0.0-vanilla/src/utils/util.cc      2018-08-28 02:01:02.000000000 -0400
-+++ snort-3.0.0/src/utils/util.cc      2019-03-28 22:16:16.860942230 -0400
-@@ -605,13 +605,8 @@
- {
-     static THREAD_LOCAL char buf[128];
--#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE < 200112L && \
--        defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 600) || _GNU_SOURCE
--    return strerror_r(errnum, buf, sizeof(buf));
--#else
-     (void)strerror_r(errnum, buf, sizeof(buf));
-     return buf;
--#endif
- }
- char* snort_strndup(const char* src, size_t dst_size)
diff --git a/net/snort3/patches/002-ignore-liblzma.patch b/net/snort3/patches/002-ignore-liblzma.patch
deleted file mode 100644 (file)
index fbd0599..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -u --recursive snort-3.0.0-vanilla/cmake/include_libraries.cmake snort-3.0.0/cmake/include_libraries.cmake
---- snort-3.0.0-vanilla/cmake/include_libraries.cmake  2018-08-28 02:01:02.000000000 -0400
-+++ snort-3.0.0/cmake/include_libraries.cmake  2019-04-18 21:25:25.627070082 -0400
-@@ -14,7 +14,6 @@
- endif (ENABLE_UNIT_TESTS)
- # optional libraries
--find_package(LibLZMA QUIET)
- find_package(Asciidoc QUIET)
- find_package(DBLATEX QUIET)
- find_package(Ruby QUIET 1.8.7)
diff --git a/net/snort3/patches/build-fix.patch b/net/snort3/patches/build-fix.patch
new file mode 100644 (file)
index 0000000..7f44844
--- /dev/null
@@ -0,0 +1,16 @@
+Index: snort3-3.1.4.0/src/network_inspectors/appid/service_plugins/service_rpc.cc
+===================================================================
+--- snort3-3.1.4.0.orig/src/network_inspectors/appid/service_plugins/service_rpc.cc
++++ snort3-3.1.4.0/src/network_inspectors/appid/service_plugins/service_rpc.cc
+@@ -27,11 +27,7 @@
+ #include <netdb.h>
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(USE_TIRPC)
+-#include <rpc/rpc.h>
+-#elif defined(__sun)
+ #include <rpc/rpcent.h>
+-#endif
+ #include "detection/ips_context.h"
+ #include "log/messages.h"