zabbix: hide CONFIG symbols when no Zabbix package selected
authorDaniel F. Dickinson <redacted>
Mon, 16 Mar 2026 06:43:17 +0000 (02:43 -0400)
committerFlorian Eckert <redacted>
Sun, 22 Mar 2026 08:16:50 +0000 (09:16 +0100)
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 <redacted>
admin/zabbix/Config.in
admin/zabbix/Makefile

index b48b5b00a756e0c04d15cf47e294f81890cf4475..cad909c7131d2a636c76102b85c234b7e048848c 100644 (file)
@@ -1,23 +1,14 @@
-choice
-       prompt "Select SSL Library"
-
-       default ZABBIX_OPENSSL
-
-       config ZABBIX_GNUTLS
-               bool "GnuTLS"
-
-       config ZABBIX_NOSSL
-               bool "NoSSL"
-
-       config ZABBIX_OPENSSL
-               bool "OpenSSL"
-endchoice
+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
+               default y if ZABBIX_ENABLE_ZABBIX
+               default n
                depends on !ZABBIX_GNUTLS && !ZABBIX_NOSSL
 
        config ZABBIX_CURL_GNUTLS
@@ -28,10 +19,28 @@ menu "Modify features for non-core variants"
        config ZABBIX_LDAP
                bool "LDAP support"
                depends on ZABBIX_OPENSSL
-               default y
+               default y if ZABBIX_ENABLE_ZABBIX
+               default n
 
        config ZABBIX_NETSNMP
                bool "NetSNMP support (OpenSSL)"
                depends on ZABBIX_OPENSSL
-               default y
+               default y if ZABBIX_ENABLE_ZABBIX
+               default n
 endmenu
+
+choice
+       depends on ZABBIX_ENABLE_ZABBIX
+       prompt "Select SSL Library"
+
+       default ZABBIX_OPENSSL
+
+       config ZABBIX_GNUTLS
+               bool "GnuTLS"
+
+       config ZABBIX_NOSSL
+               bool "NoSSL"
+
+       config ZABBIX_OPENSSL
+               bool "OpenSSL"
+endchoice
index fb5b026192b55f33c8eda7f5e96eb271faf058a1..c1da4eda0352846511d6308aaa69ee74325deced 100644 (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 \
git clone https://git.99rst.org/PROJECT