squid: disable krb5
[feed/packages.git] / net / snort / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=snort
11 PKG_VERSION:=2.9.7.2
12 PKG_RELEASE:=3
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \
19 @SF/$(PKG_NAME)
20 PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
21
22 PKG_BUILD_DEPENDS:=librpc
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_FIXUP:=autoreconf
25 PKG_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/snort
30 SUBMENU:=Firewall
31 SECTION:=net
32 CATEGORY:=Network
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/
36 MENU:=1
37 endef
38
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
44 attacks.
45 endef
46
47 define Package/snort/config
48 source "$(SOURCE)/Config.in"
49 endef
50
51 CONFIGURE_ARGS += \
52 --prefix="/usr" \
53 --enable-flexresp \
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" \
62 --disable-static-daq
63
64 ifeq ($(CONFIG_SNORT_MYSQL),)
65 CONFIGURE_ARGS += \
66 --without-mysql
67 endif
68
69 ifeq ($(CONFIG_PGSQL),)
70 CONFIGURE_ARGS += \
71 --without-postgresql
72 endif
73
74 ifeq ($(CONFIG_SNORT_LZMA),)
75 CONFIGURE_ARGS += \
76 --disable-lzma
77 endif
78
79 CONFIGURE_VARS += \
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"
83
84 MAKE_FLAGS += \
85 extra_incl=""
86
87 define Build/InstallDev
88 $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
89 $(CP) \
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
93 $(CP) \
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
97 $(CP) \
98 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
99 $(STAGING_DIR)/usr/lib/snort_dynamicengine/
100 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
101 $(CP) \
102 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
103 $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
104 endef
105
106 define Package/snort/conffiles
107 /etc/config/snort
108 /etc/snort/snort.conf
109 endef
110
111 define Package/snort/install
112 $(INSTALL_DIR) $(1)/usr/bin
113 $(INSTALL_BIN) \
114 $(PKG_INSTALL_DIR)/usr/bin/snort \
115 $(1)/usr/bin/snort
116
117 $(INSTALL_BIN) \
118 $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
119 $(1)/usr/bin
120
121 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
122 $(CP) \
123 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
124 $(1)/usr/lib/snort_dynamicengine/
125
126 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
127 $(CP) \
128 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
129 $(1)/usr/lib/snort_dynamicpreprocessor/
130
131 $(INSTALL_DIR) $(1)/etc/snort
132 $(INSTALL_CONF) \
133 $(PKG_BUILD_DIR)/etc/snort.conf \
134 $(1)/etc/snort/
135 $(INSTALL_CONF) \
136 $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
137 $(1)/etc/snort/
138 $(INSTALL_CONF) \
139 $(PKG_BUILD_DIR)/etc/classification.config \
140 $(1)/etc/snort/
141 $(INSTALL_CONF) \
142 $(PKG_BUILD_DIR)/etc/gen-msg.map \
143 $(1)/etc/snort/
144 $(INSTALL_CONF) \
145 $(PKG_BUILD_DIR)/etc/reference.config \
146 $(1)/etc/snort/
147 $(INSTALL_CONF) \
148 $(PKG_BUILD_DIR)/etc/unicode.map \
149 $(1)/etc/snort/
150
151 $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
152 $(INSTALL_CONF) \
153 $(PKG_BUILD_DIR)/preproc_rules/*.rules \
154 $(1)/etc/snort/preproc_rules/
155
156 $(INSTALL_DIR) $(1)/etc/init.d
157 $(INSTALL_BIN) \
158 ./files/snort.init \
159 $(1)/etc/init.d/snort
160
161 $(INSTALL_DIR) $(1)/etc/config
162 $(INSTALL_CONF) \
163 ./files/snort.config \
164 $(1)/etc/config/snort
165 endef
166
167 $(eval $(call BuildPackage,snort))
168