Makefile (4284B)
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:=4 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_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_LZMA),) 65 CONFIGURE_ARGS += \ 66 --disable-lzma 67 endif 68 69 CONFIGURE_VARS += \ 70 PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" 71 72 MAKE_FLAGS += \ 73 extra_incl="" 74 75 define Build/InstallDev 76 $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc 77 $(CP) \ 78 $(PKG_INSTALL_DIR)/usr/include/snort/dynamic_preproc/* \ 79 $(STAGING_DIR)/usr/include/snort/dynamic_preproc/ 80 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort/dynamic_preproc 81 $(CP) \ 82 $(PKG_INSTALL_DIR)/usr/lib/snort/dynamic_preproc/* \ 83 $(STAGING_DIR)/usr/lib/snort/dynamic_preproc/ 84 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicengine 85 $(CP) \ 86 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/* \ 87 $(STAGING_DIR)/usr/lib/snort_dynamicengine/ 88 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor 89 $(CP) \ 90 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/* \ 91 $(STAGING_DIR)/usr/lib/snort_dynamicpreprocessor/ 92 endef 93 94 define Package/snort/conffiles 95 /etc/config/snort 96 /etc/snort/snort.conf 97 endef 98 99 define Package/snort/install 100 $(INSTALL_DIR) $(1)/usr/bin 101 $(INSTALL_BIN) \ 102 $(PKG_INSTALL_DIR)/usr/bin/snort \ 103 $(1)/usr/bin/snort 104 105 $(INSTALL_BIN) \ 106 $(PKG_INSTALL_DIR)/usr/bin/u2{boat,spewfoo} \ 107 $(1)/usr/bin 108 109 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicengine 110 $(CP) \ 111 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicengine/libsf_engine.so* \ 112 $(1)/usr/lib/snort_dynamicengine/ 113 114 $(INSTALL_DIR) $(1)/usr/lib/snort_dynamicpreprocessor 115 $(CP) \ 116 $(PKG_INSTALL_DIR)/usr/lib/snort_dynamicpreprocessor/libsf*.so* \ 117 $(1)/usr/lib/snort_dynamicpreprocessor/ 118 119 $(INSTALL_DIR) $(1)/etc/snort 120 $(INSTALL_CONF) \ 121 $(PKG_BUILD_DIR)/etc/snort.conf \ 122 $(1)/etc/snort/ 123 $(INSTALL_CONF) \ 124 $(PKG_BUILD_DIR)/etc/attribute_table.dtd \ 125 $(1)/etc/snort/ 126 $(INSTALL_CONF) \ 127 $(PKG_BUILD_DIR)/etc/classification.config \ 128 $(1)/etc/snort/ 129 $(INSTALL_CONF) \ 130 $(PKG_BUILD_DIR)/etc/gen-msg.map \ 131 $(1)/etc/snort/ 132 $(INSTALL_CONF) \ 133 $(PKG_BUILD_DIR)/etc/reference.config \ 134 $(1)/etc/snort/ 135 $(INSTALL_CONF) \ 136 $(PKG_BUILD_DIR)/etc/unicode.map \ 137 $(1)/etc/snort/ 138 139 $(INSTALL_DIR) $(1)/etc/snort/preproc_rules 140 $(INSTALL_CONF) \ 141 $(PKG_BUILD_DIR)/preproc_rules/*.rules \ 142 $(1)/etc/snort/preproc_rules/ 143 144 $(INSTALL_DIR) $(1)/etc/init.d 145 $(INSTALL_BIN) \ 146 ./files/snort.init \ 147 $(1)/etc/init.d/snort 148 149 $(INSTALL_DIR) $(1)/etc/config 150 $(INSTALL_CONF) \ 151 ./files/snort.config \ 152 $(1)/etc/config/snort 153 endef 154 155 $(eval $(call BuildPackage,snort)) 156