2006-11-13 08:15:26 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=snort
|
|
|
|
PKG_VERSION:=2.4.4
|
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.snort.org/dl/current/
|
|
|
|
PKG_MD5SUM:=9dc9060d1f2e248663eceffadfc45e7e
|
|
|
|
PKG_CAT:=zcat
|
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/snort/Default
|
|
|
|
SUBMENU:=snort (Ligthweight Network Intrusion Detection System)
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
DEPENDS:=+libnet0 +libpcap +libpcre
|
|
|
|
TITLE:=Ligthweight Network Intrusion Detection System
|
|
|
|
URL:=http://www.snort.org/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/snort
|
|
|
|
$(call Package/snort/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/snort-mysql
|
|
|
|
$(call Package/snort/Default)
|
|
|
|
DEPENDS+= +libmysqlclient
|
|
|
|
TITLE+= (MySQL)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/snort-pgsql
|
|
|
|
$(call Package/snort/Default)
|
|
|
|
DEPENDS+= +libpq
|
|
|
|
TITLE+= (PostgreSQL)
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define Compile/Template
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
$(PKG_BUILD_DIR)/snort$(1): $(PKG_BUILD_DIR)/.configured
|
2006-11-13 08:15:26 +00:00
|
|
|
touch -r $(PKG_BUILD_DIR)/Makefile.am $(PKG_BUILD_DIR)/configure.in
|
|
|
|
touch -r $(PKG_BUILD_DIR)/Makefile.in $(PKG_BUILD_DIR)/configure
|
|
|
|
-$(MAKE) -C $(PKG_BUILD_DIR) distclean
|
|
|
|
$(call Build/Configure/Default, \
|
|
|
|
--enable-flexresp \
|
|
|
|
--with-libnet-includes="$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \
|
|
|
|
--with-libnet-libraries="$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib" \
|
|
|
|
--with-libpcap-includes="$(STAGING_DIR)/usr/include" \
|
|
|
|
--with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
|
|
|
|
--with-libpcre-includes="$(STAGING_DIR)/usr/include" \
|
|
|
|
--with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \
|
|
|
|
$(2) \
|
|
|
|
, \
|
|
|
|
CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
|
|
|
|
LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
|
|
|
|
PATH="$(STAGING_DIR)/usr/lib/libnet-1.0.x/bin:$$$$PATH" \
|
|
|
|
$(3) \
|
|
|
|
);
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
extra_incl="" \
|
|
|
|
all
|
2007-03-26 06:44:53 +00:00
|
|
|
mv $(PKG_BUILD_DIR)/src/snort $(PKG_BUILD_DIR)/snort$(1)
|
2006-11-13 08:15:26 +00:00
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/snort$(1)
|
2006-11-13 08:15:26 +00:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define Install/Template
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
define Package/snort$(1)/conffiles
|
2006-11-13 08:15:26 +00:00
|
|
|
/etc/default/snort
|
|
|
|
/etc/snort/snort.conf
|
|
|
|
/etc/snort/threshold.conf
|
|
|
|
endef
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
define Package/snort$(1)/install
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $$(1)/usr/sbin
|
2007-03-26 06:44:53 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/snort$(1) $$(1)/usr/sbin/snort
|
2006-11-23 00:29:07 +00:00
|
|
|
$(INSTALL_DIR) $$(1)/etc/snort
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/snort.conf $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/classification.config $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/gen-msg.map $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/reference.config $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/sid-msg.map $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/threshold.conf $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/unicode.map $$(1)/etc/snort/
|
|
|
|
$(INSTALL_DIR) $$(1)/etc/default
|
|
|
|
$(INSTALL_DATA) ./files/snort.default $$(1)/etc/default/snort
|
|
|
|
$(INSTALL_DIR) $$(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/snort.init $$(1)/etc/init.d/snort
|
2006-11-13 08:15:26 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
ifneq ($(SDK)$(CONFIG_PACKAGE_snort),)
|
2007-03-24 21:55:13 +00:00
|
|
|
define Compile/snort
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Compile/Template,, \
|
2006-11-13 08:15:26 +00:00
|
|
|
--without-mysql \
|
|
|
|
--without-postgresql \
|
2007-03-24 21:55:13 +00:00
|
|
|
)
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Install/Template,)
|
2007-03-24 21:55:13 +00:00
|
|
|
endef
|
2006-11-13 08:15:26 +00:00
|
|
|
endif
|
2007-03-24 21:55:13 +00:00
|
|
|
$(eval $(Compile/snort))
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
ifneq ($(SDK)$(CONFIG_PACKAGE_snort-mysql),)
|
2007-03-24 21:55:13 +00:00
|
|
|
define Compile/snort-mysql
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Compile/Template,-mysql, \
|
2006-11-13 08:15:26 +00:00
|
|
|
--with-mysql="$(STAGING_DIR)/usr" \
|
|
|
|
--without-postgresql \
|
2007-03-24 21:55:13 +00:00
|
|
|
)
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Install/Template,-mysql)
|
2007-03-24 21:55:13 +00:00
|
|
|
endef
|
2006-11-13 08:15:26 +00:00
|
|
|
endif
|
2007-03-24 21:55:13 +00:00
|
|
|
$(eval $(Compile/snort-mysql))
|
|
|
|
|
|
|
|
|
2007-03-26 06:44:53 +00:00
|
|
|
ifneq ($(SDK)$(CONFIG_PACKAGE_snort-pgsql),)
|
2007-03-24 21:55:13 +00:00
|
|
|
define Compile/snort-pgsql
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Compile/Template,-pgsql, \
|
2006-11-13 08:15:26 +00:00
|
|
|
--without-mysql \
|
|
|
|
--with-postgresql="$(STAGING_DIR)/usr" \
|
2007-03-24 21:55:13 +00:00
|
|
|
)
|
2007-03-26 06:44:53 +00:00
|
|
|
$(call Install/Template,-pgsql)
|
2007-03-24 21:55:13 +00:00
|
|
|
endef
|
2006-11-13 08:15:26 +00:00
|
|
|
endif
|
2007-03-24 21:55:13 +00:00
|
|
|
$(eval $(Compile/snort-pgsql))
|
2006-11-13 08:15:26 +00:00
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,snort))
|
|
|
|
$(eval $(call BuildPackage,snort-mysql))
|
|
|
|
$(eval $(call BuildPackage,snort-pgsql))
|