zabbix: hide CONFIG symbols when no Zabbix package selected

As noted in #28709 OpenWrt  contains CONFIG_
symbols for Zabbix even when no Zabbix package is selected.
This fixes and Closes #28709.

We add a 'guard' symbol for the menus and choices so the only
generate CONFIG symbols when 'Enable Zabbix'
(CONFIG_ZABBIX_ENABLE_ZABBIX) is selected.

We also make all the Zabbix packages depend on this symbol,
for consistency.

This operates much as the pseudo-package solution, but without
a pseudo-package required.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
This commit is contained in:
Daniel F. Dickinson
2026-03-16 02:43:17 -04:00
committed by Florian Eckert
parent 32abd6408f
commit f0576eb36b
2 changed files with 45 additions and 32 deletions

View File

@@ -1,4 +1,36 @@
config ZABBIX_ENABLE_ZABBIX
bool "Enable Zabbix"
default y if ALL
default n
menu "Modify features for non-core variants"
depends on ZABBIX_ENABLE_ZABBIX
config ZABBIX_CURL
bool "cURL support (default SSL)"
default y if ZABBIX_ENABLE_ZABBIX
default n
depends on !ZABBIX_GNUTLS && !ZABBIX_NOSSL
config ZABBIX_CURL_GNUTLS
bool "cURL support (GnuTLS)"
default n
depends on !ZABBIX_CURL
config ZABBIX_LDAP
bool "LDAP support"
depends on ZABBIX_OPENSSL
default y if ZABBIX_ENABLE_ZABBIX
default n
config ZABBIX_NETSNMP
bool "NetSNMP support (OpenSSL)"
depends on ZABBIX_OPENSSL
default y if ZABBIX_ENABLE_ZABBIX
default n
endmenu
choice
depends on ZABBIX_ENABLE_ZABBIX
prompt "Select SSL Library"
default ZABBIX_OPENSSL
@@ -12,26 +44,3 @@ choice
config ZABBIX_OPENSSL
bool "OpenSSL"
endchoice
menu "Modify features for non-core variants"
config ZABBIX_CURL
bool "cURL support (default SSL)"
default y
depends on !ZABBIX_GNUTLS && !ZABBIX_NOSSL
config ZABBIX_CURL_GNUTLS
bool "cURL support (GnuTLS)"
default n
depends on !ZABBIX_CURL
config ZABBIX_LDAP
bool "LDAP support"
depends on ZABBIX_OPENSSL
default y
config ZABBIX_NETSNMP
bool "NetSNMP support (OpenSSL)"
depends on ZABBIX_OPENSSL
default y
endmenu

View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
PKG_VERSION:=7.0.23
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/$(basename $(PKG_VERSION))/ \
@@ -27,6 +27,7 @@ PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_ZABBIX_CURL \
CONFIG_ZABBIX_CURL_GNUTLS \
CONFIG_ZABBIX_ENABLE_ZABBIX \
CONFIG_ZABBIX_GNUTLS \
CONFIG_ZABBIX_LDAP \
CONFIG_ZABBIX_MYSQL \
@@ -43,6 +44,7 @@ endef
define Package/zabbix-proxy/config
choice
depends on ZABBIX_ENABLE_ZABBIX
prompt "Select Database Software for Zabbix"
default ZABBIX_POSTGRESQL
@@ -60,6 +62,7 @@ endef
define Package/zabbix-get/config
config ZABBIX_BUILD_SUPPORT_BIN
bool
depends on (PACKAGE_zabbix-agentd || PACKAGE_zabbix-proxy || PACKAGE_zabbix-server) && ZABBIX_ENABLE_ZABBIX
default y
help
This option exists to prevent trying to build get and/or sender when none
@@ -73,6 +76,7 @@ define Package/zabbix/Default
SUBMENU:=Zabbix
TITLE:=Zabbix
URL:=https://www.zabbix.com/
DEPENDS:=@ZABBIX_ENABLE_ZABBIX
endef
define Package/zabbix/description/Default
@@ -109,7 +113,7 @@ endef
define Package/zabbix-agentd/Default
$(call Package/zabbix/Default)
TITLE+= agentd
DEPENDS:= \
DEPENDS+= \
$(ICONV_DEPENDS) \
+libevent2-pthreads \
+libpcre2 \
@@ -160,7 +164,7 @@ endef
define Package/zabbix-get
$(call Package/zabbix/Default)
TITLE+= get (with TLS)
DEPENDS:= \
DEPENDS+= \
@(ZABBIX_BUILD_SUPPORT_BIN) \
$(ICONV_DEPENDS) \
+ZABBIX_GNUTLS:libgnutls \
@@ -182,7 +186,7 @@ endef
define Package/zabbix-server-or-proxy/Default
$(call Package/zabbix/Default)
DEPENDS:= \
DEPENDS+= \
$(ICONV_DEPENDS) \
+fping \
+libevent2 \
@@ -244,7 +248,7 @@ endef
define Package/zabbix-sender
$(call Package/zabbix/Default)
TITLE+= sender (with TLS)
DEPENDS:= \
DEPENDS+= \
@(ZABBIX_BUILD_SUPPORT_BIN) \
$(ICONV_DEPENDS) \
+ZABBIX_GNUTLS:libgnutls \
@@ -291,7 +295,7 @@ endef
define Package/zabbix-extra-mac80211
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for mac80211
DEPENDS:= \
DEPENDS+= \
@KERNEL_DEBUG_FS \
@PACKAGE_MAC80211_DEBUGFS \
@zabbix-agentd-any
@@ -308,7 +312,7 @@ define Package/zabbix-extra-network
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for network
PKGARCH:=all
DEPENDS:= \
DEPENDS+= \
+libubus-lua \
+lua \
@zabbix-agentd-any
@@ -325,7 +329,7 @@ define Package/zabbix-extra-wifi
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for wifi
PKGARCH:=all
DEPENDS:= \
DEPENDS+= \
+libiwinfo-lua \
+libubus-lua +lua \
@zabbix-agentd-any
@@ -342,7 +346,7 @@ define Package/zabbix-frontend-server
$(call Package/zabbix/Default)
TITLE+= frontend server
PKGARCH:=all
DEPENDS:= \
DEPENDS+= \
php8 \
@(!ZABBIX_SQLITE) \
+ZABBIX_MYSQL:php8-mod-mysqli \