Browse Source

[net/snort] Replaced build variants with compile options.

Also added optional lzma support.
Signed-off-by: Vladimir Ulrich <admin@evl.su>
lilik-openwrt-22.03
Vladimir Ulrich 10 years ago
parent
commit
99fe4286c7
2 changed files with 49 additions and 62 deletions
  1. +25
    -0
      net/snort/Config.in
  2. +24
    -62
      net/snort/Makefile

+ 25
- 0
net/snort/Config.in View File

@ -0,0 +1,25 @@
menu "Configuration"
depends on PACKAGE_snort
config SNORT_MYSQL
bool "Enable MySQL support"
default n
help
This option enables support for logging to a MySQL database.
Disabled by default.
config SNORT_PGSQL
bool "Enable PostgreSQL support"
default n
help
This option enables support for logging to a PostgreSQL database.
Disabled by default.
config SNORT_LZMA
bool "Enable LZMA support"
default n
help
This option enables LZMA decompression.
Disabled by default.
endmenu

+ 24
- 62
net/snort/Makefile View File

@ -9,29 +9,30 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=snort PKG_NAME:=snort
PKG_VERSION:=2.9.7.2 PKG_VERSION:=2.9.7.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
PKG_MD5SUM:=b01e9964827394c39194a0147bc15705 PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
PKG_BUILD_DEPENDS:=librpc PKG_BUILD_DEPENDS:=librpc
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
PKG_FIXUP:=autoreconf PKG_FIXUP:=autoreconf
PKG_INSTALL:=1 PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/snort/Default
define Package/snort
SUBMENU:=Firewall SUBMENU:=Firewall
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib
DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +SNORT_MYSQL:libmysqlclient +SNORT_PGSQL:libpq +SNORT_PGSQL:libuuid +SNORT_LZMA:liblzma
TITLE:=Lightweight Network Intrusion Detection System TITLE:=Lightweight Network Intrusion Detection System
URL:=http://www.snort.org/ URL:=http://www.snort.org/
MENU:=1
endef endef
define Package/snort/Default/description
define Package/snort/description
Snort is an open source network intrusion detection and prevention system. Snort is an open source network intrusion detection and prevention system.
It is capable of performing real-time traffic analysis, alerting, blocking It is capable of performing real-time traffic analysis, alerting, blocking
and packet logging on IP networks. It utilizes a combination of protocol and packet logging on IP networks. It utilizes a combination of protocol
@ -39,37 +40,8 @@ define Package/snort/Default/description
attacks. attacks.
endef endef
define Package/snort
$(call Package/snort/Default)
VARIANT:=basic
endef
define Package/snort/description
$(call Package/snort/Default/description)
endef
define Package/snort-mysql
$(call Package/snort/Default)
DEPENDS+= +libmysqlclient
TITLE+= (MySQL)
VARIANT:=mysql
endef
define Package/snort-mysql/description
$(call Package/snort/Default/description)
This package contains snort with support for logging to a MySQL database.
endef
define Package/snort-pgsql
$(call Package/snort/Default)
DEPENDS+= +libpq +libuuid
TITLE+= (PostgreSQL)
VARIANT:=pgsql
endef
define Package/snort-pgsql/description
$(call Package/snort/Default/description)
This package contains snort with support for logging to a PostgreSQL database.
define Package/snort/config
source "$(SOURCE)/Config.in"
endef endef
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
@ -85,6 +57,21 @@ CONFIGURE_ARGS += \
--with-daq-libraries="$(STAGING_DIR)/usr/lib" \ --with-daq-libraries="$(STAGING_DIR)/usr/lib" \
--disable-static-daq --disable-static-daq
ifeq ($(CONFIG_SNORT_MYSQL),)
CONFIGURE_ARGS += \
--without-mysql
endif
ifeq ($(CONFIG_PGSQL),)
CONFIGURE_ARGS += \
--without-postgresql
endif
ifeq ($(CONFIG_SNORT_LZMA),)
CONFIGURE_ARGS += \
--disable-lzma
endif
CONFIGURE_VARS += \ CONFIGURE_VARS += \
CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \ CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \ LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
@ -93,24 +80,6 @@ CONFIGURE_VARS += \
MAKE_FLAGS += \ MAKE_FLAGS += \
extra_incl="" extra_incl=""
ifeq ($(BUILD_VARIANT),basic)
CONFIGURE_ARGS += \
--without-mysql \
--without-postgresql
endif
ifeq ($(BUILD_VARIANT),mysql)
CONFIGURE_VARS += \
mysql_has_reconnect=yes
CONFIGURE_ARGS += \
--with-mysql="$(STAGING_DIR)/usr" \
--without-postgresql
endif
ifeq ($(BUILD_VARIANT),pgsql)
CONFIGURE_ARGS += \
--without-mysql \
--with-postgresql="$(STAGING_DIR)/usr"
endif
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc $(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
$(CP) \ $(CP) \
@ -135,12 +104,6 @@ define Package/snort/conffiles
/etc/snort/snort.conf /etc/snort/snort.conf
endef endef
Package/snort-mysql/conffiles = $(Package/snort/conffiles)
Package/snort-mysql/install = $(Package/snort/install)
Package/snort-pgsql/conffiles = $(Package/snort/conffiles)
Package/snort-pgsql/install = $(Package/snort/install)
define Package/snort/install define Package/snort/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) \ $(INSTALL_BIN) \
@ -198,5 +161,4 @@ define Package/snort/install
endef endef
$(eval $(call BuildPackage,snort)) $(eval $(call BuildPackage,snort))
$(eval $(call BuildPackage,snort-mysql))
$(eval $(call BuildPackage,snort-pgsql))

Loading…
Cancel
Save