From dc621a9b195f6c705b8dfee33cf76e8fad50f451 Mon Sep 17 00:00:00 2001 From: Michal Hrusecky Date: Wed, 7 Jul 2021 12:39:31 +0200 Subject: [PATCH] snort3: Backport stable version from 21.02 Update snort3 from beta to the stable version available in 21.02 version of feeds. Signed-off-by: Michal Hrusecky --- net/snort3/Makefile | 35 +++++++------- net/snort3/patches/001-compile.patch | 52 --------------------- net/snort3/patches/002-ignore-liblzma.patch | 11 ----- net/snort3/patches/build-fix.patch | 16 +++++++ 4 files changed, 33 insertions(+), 81 deletions(-) delete mode 100644 net/snort3/patches/001-compile.patch delete mode 100644 net/snort3/patches/002-ignore-liblzma.patch create mode 100644 net/snort3/patches/build-fix.patch diff --git a/net/snort3/Makefile b/net/snort3/Makefile index bbe0be642c..4530596a82 100644 --- a/net/snort3/Makefile +++ b/net/snort3/Makefile @@ -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 +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 index 09669a3717..0000000000 --- a/net/snort3/patches/001-compile.patch +++ /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 - #include --#include -+#include - - #include - #include -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 - #include - #include --#include -+#include - #include - - #include -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 - -+#include - #if defined(__FreeBSD__) || defined(__OpenBSD__) - #include - #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 index fbd0599ba8..0000000000 --- a/net/snort3/patches/002-ignore-liblzma.patch +++ /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 index 0000000000..7f4484415b --- /dev/null +++ b/net/snort3/patches/build-fix.patch @@ -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 + +-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(USE_TIRPC) +-#include +-#elif defined(__sun) + #include +-#endif + + #include "detection/ips_context.h" + #include "log/messages.h" -- 2.30.2