2 # Copyright (C) 2006-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://www.snort.org
/downloads
/snort
/
16 PKG_MD5SUM
:=b01e9964827394c39194a0147bc15705
18 PKG_BUILD_DEPENDS
:=librpc
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/snort
/Default
29 DEPENDS
:=+libdaq
+libdnet
+libopenssl
+libpcap
+libpcre
+libpthread
+libuuid
+zlib
30 TITLE
:=Lightweight Network Intrusion Detection System
31 URL
:=http
://www.snort.org
/
34 define Package
/snort
/Default
/description
35 Snort is an open source network intrusion detection and prevention system.
36 It is capable of performing real-time traffic analysis
, alerting
, blocking
37 and packet logging on IP networks. It utilizes a combination of protocol
38 analysis and pattern matching in order to detect anomalies
, misuse and
43 $(call Package
/snort
/Default
)
47 define Package
/snort
/description
48 $(call Package
/snort
/Default
/description
)
51 define Package
/snort-mysql
52 $(call Package
/snort
/Default
)
53 DEPENDS
+= +libmysqlclient
58 define Package
/snort-mysql
/description
59 $(call Package
/snort
/Default
/description
)
60 This package contains snort with support for logging to a MySQL database.
63 define Package
/snort-pgsql
64 $(call Package
/snort
/Default
)
65 DEPENDS
+= +libpq
+libuuid
70 define Package
/snort-pgsql
/description
71 $(call Package
/snort
/Default
/description
)
72 This package contains snort with support for logging to a PostgreSQL database.
78 --with-dnet-includes
="$(STAGING_DIR)/usr/include" \
79 --with-dnet-libraries
="$(STAGING_DIR)/usr/lib" \
80 --with-libpcap-includes
="$(STAGING_DIR)/usr/include" \
81 --with-libpcap-libraries
="$(STAGING_DIR)/usr/lib" \
82 --with-libpcre-includes
="$(STAGING_DIR)/usr/include" \
83 --with-libpcre-libraries
="$(STAGING_DIR)/usr/lib" \
84 --with-daq-includes
="$(STAGING_DIR)/usr/include" \
85 --with-daq-libraries
="$(STAGING_DIR)/usr/lib" \
89 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
90 LDFLAGS
="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
91 PATH
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
96 ifeq ($(BUILD_VARIANT
),basic
)
101 ifeq ($(BUILD_VARIANT
),mysql
)
103 mysql_has_reconnect
=yes
105 --with-mysql
="$(STAGING_DIR)/usr" \
108 ifeq ($(BUILD_VARIANT
),pgsql
)
111 --with-postgresql
="$(STAGING_DIR)/usr"
114 define Build
/InstallDev
115 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/include/snort
/dynamic_preproc
117 $(PKG_INSTALL_DIR
)/usr
/include/snort
/dynamic_preproc
/* \
118 $(STAGING_DIR
)/usr
/include/snort
/dynamic_preproc
/
119 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort
/dynamic_preproc
121 $(PKG_INSTALL_DIR
)/usr
/lib
/snort
/dynamic_preproc
/* \
122 $(STAGING_DIR
)/usr
/lib
/snort
/dynamic_preproc
/
123 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort_dynamicengine
125 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicengine
/* \
126 $(STAGING_DIR
)/usr
/lib
/snort_dynamicengine
/
127 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort_dynamicpreprocessor
129 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/* \
130 $(STAGING_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/
133 define Package
/snort
/conffiles
135 /etc
/snort
/snort.conf
138 Package
/snort-mysql
/conffiles
= $(Package
/snort
/conffiles
)
139 Package
/snort-mysql
/install = $(Package
/snort
/install)
141 Package
/snort-pgsql
/conffiles
= $(Package
/snort
/conffiles
)
142 Package
/snort-pgsql
/install = $(Package
/snort
/install)
144 define Package
/snort
/install
145 $(INSTALL_DIR
) $(1)/usr
/bin
147 $(PKG_INSTALL_DIR
)/usr
/bin
/snort \
151 $(PKG_INSTALL_DIR
)/usr
/bin
/u2
{boat
,spewfoo
} \
154 $(INSTALL_DIR
) $(1)/usr
/lib
/snort_dynamicengine
156 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicengine
/libsf_engine.so
* \
157 $(1)/usr
/lib
/snort_dynamicengine
/
159 $(INSTALL_DIR
) $(1)/usr
/lib
/snort_dynamicpreprocessor
161 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/libsf
*.so
* \
162 $(1)/usr
/lib
/snort_dynamicpreprocessor
/
164 $(INSTALL_DIR
) $(1)/etc
/snort
166 $(PKG_BUILD_DIR
)/etc
/snort.conf \
169 $(PKG_BUILD_DIR
)/etc
/attribute_table.dtd \
172 $(PKG_BUILD_DIR
)/etc
/classification.config \
175 $(PKG_BUILD_DIR
)/etc
/gen-msg.map \
178 $(PKG_BUILD_DIR
)/etc
/reference.config \
181 $(PKG_BUILD_DIR
)/etc
/unicode.map \
184 $(INSTALL_DIR
) $(1)/etc
/snort
/preproc_rules
186 $(PKG_BUILD_DIR
)/preproc_rules
/*.rules \
187 $(1)/etc
/snort
/preproc_rules
/
189 $(INSTALL_DIR
) $(1)/etc
/init.d
192 $(1)/etc
/init.d
/snort
194 $(INSTALL_DIR
) $(1)/etc
/config
196 .
/files
/snort.config \
197 $(1)/etc
/config
/snort
200 $(eval
$(call BuildPackage
,snort
))
201 $(eval
$(call BuildPackage
,snort-mysql
))
202 $(eval
$(call BuildPackage
,snort-pgsql
))