treewide: remove AUTORELEASE
[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.19
12 PKG_RELEASE:=2
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
16 PKG_CPE_ID:=cpe:/a:snort:snort
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=https://www.snort.org/downloads/archive/snort/ \
20 @SF/$(PKG_NAME)
21 PKG_HASH:=b12fc6db72afb58987a2bf1954b8f45bde02047c235513c7663857b9506369c7
22
23 PKG_BUILD_DEPENDS:=libtirpc
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_FIXUP:=autoreconf
26 PKG_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/snort
31 SUBMENU:=Firewall
32 SECTION:=net
33 CATEGORY:=Network
34 DEPENDS:=+libdaq +libdnet +libnghttp2 +libopenssl +libpcap +libpcre +libpthread +libtirpc +libuuid +zlib +luajit +SNORT_LZMA:liblzma
35 TITLE:=Lightweight Network Intrusion Detection System
36 URL:=http://www.snort.org/
37 CONFLICTS:=snort3
38 MENU:=1
39 endef
40
41 define Package/snort/description
42 Snort is an open source network intrusion detection and prevention system.
43 It is capable of performing real-time traffic analysis, alerting, blocking
44 and packet logging on IP networks. It utilizes a combination of protocol
45 analysis and pattern matching in order to detect anomalies, misuse and
46 attacks.
47 endef
48
49 define Package/snort/config
50 source "$(SOURCE)/Config.in"
51 endef
52
53 CONFIGURE_ARGS += \
54 --prefix="/usr" \
55 --enable-flexresp \
56 --with-dnet-includes="$(STAGING_DIR)/usr/include" \
57 --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \
58 --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
59 --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
60 --with-libpcre-includes="$(STAGING_DIR)/usr/include" \
61 --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
62 --with-daq-includes="$(STAGING_DIR)/usr/include/daq2" \
63 --with-daq-libraries="$(STAGING_DIR)/usr/lib/daq2" \
64 --disable-static-daq
65
66 ifeq ($(CONFIG_SNORT_LZMA),)
67 CONFIGURE_ARGS += \
68 --disable-lzma
69 endif
70
71 CONFIGURE_VARS += \
72 PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH"
73
74 MAKE_FLAGS += \
75 extra_incl=""
76
77 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc
78
79 define Build/InstallDev
80 $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
81 $(CP) \
82 $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \
83 $(STAGING_DIR)/usr/include/snort/dynamic_preproc/
84 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc
85 $(CP) \
86 $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \
87 $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/
88 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine
89 $(CP) \
90 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \
91 $(STAGING_DIR)/usr/lib/snort_dynamicengine/
92 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor
93 $(CP) \
94 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \
95 $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/
96 endef
97
98 define Package/snort/conffiles
99 /etc/config/snort
100 /etc/snort/snort.conf
101 endef
102
103 define Package/snort/install
104 $(INSTALL_DIR) $(1)/usr/bin
105 $(INSTALL_BIN) \
106 $(PKG_INSTALL_DIR)/usr/bin/snort \
107 $(1)/usr/bin/snort
108
109 $(INSTALL_BIN) \
110 $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \
111 $(1)/usr/bin
112
113 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine
114 $(CP) \
115 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \
116 $(1)/usr/lib/snort_dynamicengine/
117
118 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor
119 $(CP) \
120 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \
121 $(1)/usr/lib/snort_dynamicpreprocessor/
122
123 $(INSTALL_DIR) $(1)/etc/snort
124 $(INSTALL_CONF) \
125 $(PKG_BUILD_DIR)/etc/snort.conf \
126 $(1)/etc/snort/
127 $(INSTALL_CONF) \
128 $(PKG_BUILD_DIR)/etc/attribute_table.dtd \
129 $(1)/etc/snort/
130 $(INSTALL_CONF) \
131 $(PKG_BUILD_DIR)/etc/classification.config \
132 $(1)/etc/snort/
133 $(INSTALL_CONF) \
134 $(PKG_BUILD_DIR)/etc/gen-msg.map \
135 $(1)/etc/snort/
136 $(INSTALL_CONF) \
137 $(PKG_BUILD_DIR)/etc/reference.config \
138 $(1)/etc/snort/
139 $(INSTALL_CONF) \
140 $(PKG_BUILD_DIR)/etc/unicode.map \
141 $(1)/etc/snort/
142
143 $(INSTALL_DIR) $(1)/etc/snort/preproc_rules
144 $(INSTALL_CONF) \
145 $(PKG_BUILD_DIR)/preproc_rules/*.rules \
146 $(1)/etc/snort/preproc_rules/
147
148 $(INSTALL_DIR) $(1)/etc/init.d
149 $(INSTALL_BIN) \
150 ./files/snort.init \
151 $(1)/etc/init.d/snort
152
153 $(INSTALL_DIR) $(1)/etc/config
154 $(INSTALL_CONF) \
155 ./files/snort.config \
156 $(1)/etc/config/snort
157 endef
158
159 $(eval $(call BuildPackage,snort))
160