Browse Source

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

Also added optional lzma support.
Signed-off-by: Vladimir Ulrich <admin@evl.su>
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

1
+menu "Configuration"
2
+	depends on PACKAGE_snort
3
+
4
+config SNORT_MYSQL
5
+	bool "Enable MySQL support"
6
+	default n
7
+	help
8
+           This option enables support for logging to a MySQL database.
9
+           Disabled by default.
10
+
11
+config SNORT_PGSQL
12
+	bool "Enable PostgreSQL support"
13
+	default n
14
+	help
15
+           This option enables support for logging to a PostgreSQL database.
16
+           Disabled by default.
17
+
18
+config SNORT_LZMA
19
+	bool "Enable LZMA support"
20
+	default n
21
+	help
22
+           This option enables LZMA decompression.
23
+           Disabled by default.
24
+
25
+endmenu

+ 24
- 62
net/snort/Makefile View File

9
 
9
 
10
 PKG_NAME:=snort
10
 PKG_NAME:=snort
11
 PKG_VERSION:=2.9.7.2
11
 PKG_VERSION:=2.9.7.2
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13
 
13
 
14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
15
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
16
 PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
16
 PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
17
 
17
 
18
 PKG_BUILD_DEPENDS:=librpc
18
 PKG_BUILD_DEPENDS:=librpc
19
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
20
 PKG_FIXUP:=autoreconf
20
 PKG_FIXUP:=autoreconf
21
 PKG_INSTALL:=1
21
 PKG_INSTALL:=1
22
 
22
 
23
 include $(INCLUDE_DIR)/package.mk
23
 include $(INCLUDE_DIR)/package.mk
24
 
24
 
25
-define Package/snort/Default
25
+define Package/snort
26
   SUBMENU:=Firewall
26
   SUBMENU:=Firewall
27
   SECTION:=net
27
   SECTION:=net
28
   CATEGORY:=Network
28
   CATEGORY:=Network
29
-  DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib
29
+  DEPENDS:=+libdaq +libdnet +libopenssl +libpcap +libpcre +libpthread +libuuid +zlib +SNORT_MYSQL:libmysqlclient +SNORT_PGSQL:libpq +SNORT_PGSQL:libuuid +SNORT_LZMA:liblzma
30
   TITLE:=Lightweight Network Intrusion Detection System
30
   TITLE:=Lightweight Network Intrusion Detection System
31
   URL:=http://www.snort.org/
31
   URL:=http://www.snort.org/
32
+  MENU:=1
32
 endef
33
 endef
33
 
34
 
34
-define Package/snort/Default/description
35
+define Package/snort/description
35
   Snort is an open source network intrusion detection and prevention system.
36
   Snort is an open source network intrusion detection and prevention system.
36
   It is capable of performing real-time traffic analysis, alerting, blocking
37
   It is capable of performing real-time traffic analysis, alerting, blocking
37
   and packet logging on IP networks.  It utilizes a combination of protocol
38
   and packet logging on IP networks.  It utilizes a combination of protocol
39
   attacks.
40
   attacks.
40
 endef
41
 endef
41
 
42
 
42
-define Package/snort
43
-  $(call Package/snort/Default)
44
-  VARIANT:=basic
45
-endef
46
-
47
-define Package/snort/description
48
-  $(call Package/snort/Default/description)
49
-endef
50
-
51
-define Package/snort-mysql
52
-  $(call Package/snort/Default)
53
-  DEPENDS+= +libmysqlclient
54
-  TITLE+= (MySQL)
55
-  VARIANT:=mysql
56
-endef
57
-
58
-define Package/snort-mysql/description
59
-  $(call Package/snort/Default/description)
60
-  This package contains snort with support for logging to a MySQL database.
61
-endef
62
-
63
-define Package/snort-pgsql
64
-  $(call Package/snort/Default)
65
-  DEPENDS+= +libpq +libuuid
66
-  TITLE+= (PostgreSQL)
67
-  VARIANT:=pgsql
68
-endef
69
-
70
-define Package/snort-pgsql/description
71
-  $(call Package/snort/Default/description)
72
-  This package contains snort with support for logging to a PostgreSQL database.
43
+define Package/snort/config
44
+	source "$(SOURCE)/Config.in"
73
 endef
45
 endef
74
 
46
 
75
 CONFIGURE_ARGS += \
47
 CONFIGURE_ARGS += \
85
 	--with-daq-libraries="$(STAGING_DIR)/usr/lib" \
57
 	--with-daq-libraries="$(STAGING_DIR)/usr/lib" \
86
 	--disable-static-daq
58
 	--disable-static-daq
87
 
59
 
60
+ifeq ($(CONFIG_SNORT_MYSQL),)
61
+CONFIGURE_ARGS += \
62
+	--without-mysql
63
+endif
64
+
65
+ifeq ($(CONFIG_PGSQL),)
66
+CONFIGURE_ARGS += \
67
+	--without-postgresql
68
+endif
69
+
70
+ifeq ($(CONFIG_SNORT_LZMA),)
71
+CONFIGURE_ARGS += \
72
+	--disable-lzma
73
+endif
74
+
88
 CONFIGURE_VARS += \
75
 CONFIGURE_VARS += \
89
 	CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
76
 	CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
90
 	LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
77
 	LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
93
 MAKE_FLAGS += \
80
 MAKE_FLAGS += \
94
 	extra_incl=""
81
 	extra_incl=""
95
 
82
 
96
-ifeq ($(BUILD_VARIANT),basic)
97
-  CONFIGURE_ARGS += \
98
-	--without-mysql \
99
-	--without-postgresql
100
-endif
101
-ifeq ($(BUILD_VARIANT),mysql)
102
-  CONFIGURE_VARS += \
103
-	mysql_has_reconnect=yes
104
-  CONFIGURE_ARGS += \
105
-	--with-mysql="$(STAGING_DIR)/usr" \
106
-	--without-postgresql
107
-endif
108
-ifeq ($(BUILD_VARIANT),pgsql)
109
-  CONFIGURE_ARGS += \
110
-	--without-mysql \
111
-	--with-postgresql="$(STAGING_DIR)/usr"
112
-endif
113
-
114
 define Build/InstallDev
83
 define Build/InstallDev
115
 	$(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
84
 	$(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
116
 	$(CP) \
85
 	$(CP) \
135
 /etc/snort/snort.conf
104
 /etc/snort/snort.conf
136
 endef
105
 endef
137
 
106
 
138
-Package/snort-mysql/conffiles = $(Package/snort/conffiles)
139
-Package/snort-mysql/install = $(Package/snort/install)
140
-
141
-Package/snort-pgsql/conffiles = $(Package/snort/conffiles)
142
-Package/snort-pgsql/install = $(Package/snort/install)
143
-
144
 define Package/snort/install
107
 define Package/snort/install
145
 	$(INSTALL_DIR) $(1)/usr/bin
108
 	$(INSTALL_DIR) $(1)/usr/bin
146
 	$(INSTALL_BIN) \
109
 	$(INSTALL_BIN) \
198
 endef
161
 endef
199
 
162
 
200
 $(eval $(call BuildPackage,snort))
163
 $(eval $(call BuildPackage,snort))
201
-$(eval $(call BuildPackage,snort-mysql))
202
-$(eval $(call BuildPackage,snort-pgsql))
164
+