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
15 PKG_MAINTAINER
:=Luka Perkov
<luka@openwrt.org
>
17 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
18 PKG_SOURCE_URL
:=https
://www.snort.org
/downloads
/snort
/ \
20 PKG_MD5SUM
:=b01e9964827394c39194a0147bc15705
22 PKG_BUILD_DEPENDS
:=librpc
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)/$(PKG_NAME
)-$(PKG_VERSION
)
27 include $(INCLUDE_DIR
)/package.mk
33 DEPENDS
:=+libdaq
+libdnet
+libopenssl
+libpcap
+libpcre
+libpthread
+libuuid
+zlib
+SNORT_MYSQL
:libmysqlclient
+SNORT_PGSQL
:libpq
+SNORT_PGSQL
:libuuid
+SNORT_LZMA
:liblzma
34 TITLE
:=Lightweight Network Intrusion Detection System
35 URL
:=http
://www.snort.org
/
39 define Package
/snort
/description
40 Snort is an open source network intrusion detection and prevention system.
41 It is capable of performing real-time traffic analysis
, alerting
, blocking
42 and packet logging on IP networks. It utilizes a combination of protocol
43 analysis and pattern matching in order to detect anomalies
, misuse and
47 define Package
/snort
/config
48 source
"$(SOURCE)/Config.in"
54 --with-dnet-includes
="$(STAGING_DIR)/usr/include" \
55 --with-dnet-libraries
="$(STAGING_DIR)/usr/lib" \
56 --with-libpcap-includes
="$(STAGING_DIR)/usr/include" \
57 --with-libpcap-libraries
="$(STAGING_DIR)/usr/lib" \
58 --with-libpcre-includes
="$(STAGING_DIR)/usr/include" \
59 --with-libpcre-libraries
="$(STAGING_DIR)/usr/lib" \
60 --with-daq-includes
="$(STAGING_DIR)/usr/include" \
61 --with-daq-libraries
="$(STAGING_DIR)/usr/lib" \
64 ifeq ($(CONFIG_SNORT_MYSQL
),)
69 ifeq ($(CONFIG_PGSQL
),)
74 ifeq ($(CONFIG_SNORT_LZMA
),)
80 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
81 LDFLAGS
="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
82 PATH
="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
87 define Build
/InstallDev
88 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/include/snort
/dynamic_preproc
90 $(PKG_INSTALL_DIR
)/usr
/include/snort
/dynamic_preproc
/* \
91 $(STAGING_DIR
)/usr
/include/snort
/dynamic_preproc
/
92 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort
/dynamic_preproc
94 $(PKG_INSTALL_DIR
)/usr
/lib
/snort
/dynamic_preproc
/* \
95 $(STAGING_DIR
)/usr
/lib
/snort
/dynamic_preproc
/
96 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort_dynamicengine
98 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicengine
/* \
99 $(STAGING_DIR
)/usr
/lib
/snort_dynamicengine
/
100 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/lib
/snort_dynamicpreprocessor
102 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/* \
103 $(STAGING_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/
106 define Package
/snort
/conffiles
108 /etc
/snort
/snort.conf
111 define Package
/snort
/install
112 $(INSTALL_DIR
) $(1)/usr
/bin
114 $(PKG_INSTALL_DIR
)/usr
/bin
/snort \
118 $(PKG_INSTALL_DIR
)/usr
/bin
/u2
{boat
,spewfoo
} \
121 $(INSTALL_DIR
) $(1)/usr
/lib
/snort_dynamicengine
123 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicengine
/libsf_engine.so
* \
124 $(1)/usr
/lib
/snort_dynamicengine
/
126 $(INSTALL_DIR
) $(1)/usr
/lib
/snort_dynamicpreprocessor
128 $(PKG_INSTALL_DIR
)/usr
/lib
/snort_dynamicpreprocessor
/libsf
*.so
* \
129 $(1)/usr
/lib
/snort_dynamicpreprocessor
/
131 $(INSTALL_DIR
) $(1)/etc
/snort
133 $(PKG_BUILD_DIR
)/etc
/snort.conf \
136 $(PKG_BUILD_DIR
)/etc
/attribute_table.dtd \
139 $(PKG_BUILD_DIR
)/etc
/classification.config \
142 $(PKG_BUILD_DIR
)/etc
/gen-msg.map \
145 $(PKG_BUILD_DIR
)/etc
/reference.config \
148 $(PKG_BUILD_DIR
)/etc
/unicode.map \
151 $(INSTALL_DIR
) $(1)/etc
/snort
/preproc_rules
153 $(PKG_BUILD_DIR
)/preproc_rules
/*.rules \
154 $(1)/etc
/snort
/preproc_rules
/
156 $(INSTALL_DIR
) $(1)/etc
/init.d
159 $(1)/etc
/init.d
/snort
161 $(INSTALL_DIR
) $(1)/etc
/config
163 .
/files
/snort.config \
164 $(1)/etc
/config
/snort
167 $(eval
$(call BuildPackage
,snort
))