Bladeren bron

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

Also added optional lzma support.
Signed-off-by: Vladimir Ulrich <admin@evl.su>
Vladimir Ulrich 10 jaren geleden
bovenliggende
commit
99fe4286c7
2 gewijzigde bestanden met toevoegingen van 49 en 62 verwijderingen
  1. 25
    0
      net/snort/Config.in
  2. 24
    62
      net/snort/Makefile

+ 25
- 0
net/snort/Config.in Bestand weergeven

@@ -0,0 +1,25 @@
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 Bestand weergeven

@@ -9,29 +9,30 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=snort
11 11
 PKG_VERSION:=2.9.7.2
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/
16 16
 PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
17 17
 
18 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 20
 PKG_FIXUP:=autoreconf
21 21
 PKG_INSTALL:=1
22 22
 
23 23
 include $(INCLUDE_DIR)/package.mk
24 24
 
25
-define Package/snort/Default
25
+define Package/snort
26 26
   SUBMENU:=Firewall
27 27
   SECTION:=net
28 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 30
   TITLE:=Lightweight Network Intrusion Detection System
31 31
   URL:=http://www.snort.org/
32
+  MENU:=1
32 33
 endef
33 34
 
34
-define Package/snort/Default/description
35
+define Package/snort/description
35 36
   Snort is an open source network intrusion detection and prevention system.
36 37
   It is capable of performing real-time traffic analysis, alerting, blocking
37 38
   and packet logging on IP networks.  It utilizes a combination of protocol
@@ -39,37 +40,8 @@ define Package/snort/Default/description
39 40
   attacks.
40 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 45
 endef
74 46
 
75 47
 CONFIGURE_ARGS += \
@@ -85,6 +57,21 @@ CONFIGURE_ARGS += \
85 57
 	--with-daq-libraries="$(STAGING_DIR)/usr/lib" \
86 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 75
 CONFIGURE_VARS += \
89 76
 	CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/mysql" \
90 77
 	LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/mysql" \
@@ -93,24 +80,6 @@ CONFIGURE_VARS += \
93 80
 MAKE_FLAGS += \
94 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 83
 define Build/InstallDev
115 84
 	$(INSTALL_DIR) $(STAGING_DIR)/usr/include/snort/dynamic_preproc
116 85
 	$(CP) \
@@ -135,12 +104,6 @@ define Package/snort/conffiles
135 104
 /etc/snort/snort.conf
136 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 107
 define Package/snort/install
145 108
 	$(INSTALL_DIR) $(1)/usr/bin
146 109
 	$(INSTALL_BIN) \
@@ -198,5 +161,4 @@ define Package/snort/install
198 161
 endef
199 162
 
200 163
 $(eval $(call BuildPackage,snort))
201
-$(eval $(call BuildPackage,snort-mysql))
202
-$(eval $(call BuildPackage,snort-pgsql))
164
+