2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
6 include $(TOPDIR
)/rules.mk
12 PKG_SOURCE
:=$(PKG_VERSION
).
tar.gz
13 PKG_SOURCE_URL
:=https
://github.com
/snort3
/snort3
/archive
/refs
/tags/
14 PKG_HASH
:=08a51223c22aa3196e6dc959d3b52df03da9a458877ff7e77fa9c4ee8eb8947c
16 PKG_MAINTAINER
:=W. Michael Petullo
<mike@flyn.org
>, John Audia
<therealgraysky@proton.me
>
17 PKG_LICENSE
:=GPL-2.0
-only
18 PKG_LICENSE_FILES
:=COPYING
19 PKG_CPE_ID
:=cpe
:/a
:snort
:snort
21 include $(INCLUDE_DIR
)/package.mk
22 include $(INCLUDE_DIR
)/cmake.mk
28 DEPENDS
:=+libstdcpp
+libdaq3
+libdnet
+libopenssl
+libpcap
+libpcre
+libpthread
+libuuid
+zlib
+libhwloc
+libtirpc @HAS_LUAJIT_ARCH
+luajit
+libatomic
+kmod-nft-queue
+liblzma \
29 +ucode
+ucode-mod-fs
+ucode-mod-uci
30 TITLE
:=Lightweight Network Intrusion Detection System
31 URL
:=http
://www.snort.org
/
35 define Package
/snort3
/description
36 Snort is an open source network intrusion detection and prevention system.
37 It is capable of performing real-time traffic analysis
, alerting
, blocking
38 and packet logging on IP networks. It utilizes a combination of protocol
39 analysis and pattern matching in order to detect anomalies
, misuse and
44 -DUSE_TIRPC
:BOOL
=YES \
45 -DENABLE_STATIC_DAQ
:BOOL
=NO \
46 -DDAQ_INCLUDE_DIR
=$(STAGING_DIR
)/usr
/include/daq3 \
47 -DDAQ_LIBRARIES_DIR_HINT
:PATH
=$(STAGING_DIR
)/usr
/lib
/daq3 \
48 -DFLEX_INCLUDES
:PATH
=$(STAGING_DIR_HOST
)/include \
49 -DENABLE_COREFILES
:BOOL
=NO \
50 -DENABLE_GDB
:BOOL
=NO \
52 -DMAKE_HTML_DOC
:BOOL
=NO \
53 -DMAKE_PDF_DOC
:BOOL
=NO \
54 -DMAKE_TEXT_DOC
:BOOL
=NO \
55 -DHAVE_LIBUNWIND
=OFF \
58 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/daq3
-I
$(STAGING_DIR
)/usr
/include/tirpc
59 TARGET_LDFLAGS
+= -L
$(STAGING_DIR
)/usr
/lib
/daq3
-ltirpc
61 define Package
/snort3
/conffiles
66 define Package
/snort3
/install
67 $(INSTALL_DIR
) $(1)/usr
/bin
69 $(PKG_INSTALL_DIR
)/usr
/bin
/snort \
73 $(PKG_INSTALL_DIR
)/usr
/bin
/snort2lua \
77 $(PKG_INSTALL_DIR
)/usr
/bin
/u2
{boat
,spewfoo
} \
81 .
/files
/snort-
{mgr
,rules
} \
84 $(INSTALL_DIR
) $(1)/usr
/lib
/snort
86 $(PKG_INSTALL_DIR
)/usr
/lib
/snort
/daq
/daq_hext.so \
90 $(PKG_INSTALL_DIR
)/usr
/lib
/snort
/daq
/daq_file.so \
93 $(INSTALL_DIR
) $(1)/usr
/share
/lua
95 $(PKG_INSTALL_DIR
)/usr
/include/snort
/lua
/snort_plugin.lua \
98 $(INSTALL_DIR
) $(1)/usr
/share
/snort
101 $(1)/usr
/share
/snort
/
103 $(INSTALL_DIR
) $(1)/usr
/share
/snort
/templates
105 .
/files
/nftables.uc \
106 $(1)/usr
/share
/snort
/templates
/
109 $(1)/usr
/share
/snort
/templates
/
111 $(INSTALL_DIR
) $(1)/etc
/snort
/{rules
,lists
,builtin_rules
,so_rules
}
114 $(PKG_INSTALL_DIR
)/usr
/etc
/snort
/*.lua \
117 $(PKG_INSTALL_DIR
)/usr
/etc
/snort
/file_magic.rules \
120 $(INSTALL_DIR
) $(1)/etc
/init.d
123 $(1)/etc
/init.d
/snort
125 $(INSTALL_DIR
) $(1)/etc
/config
127 .
/files
/snort.config \
128 $(1)/etc
/config
/snort
132 -e
"/^-- HOME_NET and EXTERNAL_NET/ i -- The values for the two variables HOME_NET and EXTERNAL_NET have been" \
133 -e
"/^-- HOME_NET and EXTERNAL_NET/ i -- moved to /etc/config/snort, so do not modify them here without good" \
134 -e
"/^-- HOME_NET and EXTERNAL_NET/ i -- reason.\n" \
135 -e
's/^\(HOME_NET\s\+=\)/--\1/g' \
136 -e
's/^\(EXTERNAL_NET\s\+=\)/--\1/g' \
137 $(1)/etc
/snort
/snort.lua
139 -i
-e
"s/^\\(RULE_PATH\\s\\+=\\).*/\\1 'rules'/g" \
140 -e
"s/^\\(BUILTIN_RULE_PATH\\s\\+=\\).*/\\1 'builtin_rules'/g" \
141 -e
"s/^\\(PLUGIN_RULE_PATH\\s\\+=\\).*/\\1 'so_rules'/g" \
142 -e
"s/^\\(WHITE_LIST_PATH\\s\\+=\\).*/\\1 'lists'/g" \
143 -e
"s/^\\(BLACK_LIST_PATH\\s\\+=\\).*/\\1 'lists'/g" \
144 $(1)/etc
/snort
/snort_defaults.lua
147 $(eval
$(call BuildPackage
,snort3
))