openwisp-monitoring: allow not depending on rpcd-mod-iwinfo

Add option to exclude rpcd-mod-iwinfo from dependency.

Signed-off-by: Gagan Deep <pandafy.dev@gmail.com>
(cherry picked from commit ca503cc405)
This commit is contained in:
Gagan Deep
2024-10-29 21:21:55 +05:30
committed by Tianling Shen
parent 452e1bfd6b
commit a94b703f8d
2 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
menu "netjson-monitoring Configuration"
config NETJSON_MONITORING_IWINFO
bool "Enable rpcd-mod-iwinfo"
default y
help
Whether to include the rpcd-mod-iwinfo dependency (enabled by default).
endmenu

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openwisp-monitoring PKG_NAME:=openwisp-monitoring
PKG_VERSION:=0.2.0 PKG_VERSION:=0.2.0
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_MAINTAINER:=Federico Capoano <support@openwisp.io> PKG_MAINTAINER:=Federico Capoano <support@openwisp.io>
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
@@ -34,10 +34,15 @@ define Package/netjson-monitoring
CATEGORY:=Administration CATEGORY:=Administration
SECTION:=admin SECTION:=admin
SUBMENU:=openwisp SUBMENU:=openwisp
DEPENDS:=+libubus-lua +lua-cjson +rpcd +rpcd-mod-iwinfo DEPENDS:=+libubus-lua +lua-cjson +rpcd
DEPENDS+=+NETJSON_MONITORING_IWINFO:rpcd-mod-iwinfo
URL:=http://openwisp.org URL:=http://openwisp.org
endef endef
define Package/netjson-monitoring/config
source "$(SOURCE)/Config.in"
endef
define Build/Compile define Build/Compile
endef endef
@@ -88,6 +93,11 @@ define Package/netjson-monitoring/install
$(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/wifi.lua \ $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/wifi.lua \
$(1)/usr/lib/lua/openwisp-monitoring/wifi.lua $(1)/usr/lib/lua/openwisp-monitoring/wifi.lua
# Iwinfo is enabled by default unless specified otherwise
ifeq ($(CONFIG_NETJSON_MONITORING_IWINFO), y)
$(CP) $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/iwinfo.lua $(1)/usr/lib/lua/openwisp-monitoring/iwinfo.lua
endif
$(CP) $(PKG_BUILD_DIR)/VERSION $(1)/usr/lib/openwisp-monitoring/ $(CP) $(PKG_BUILD_DIR)/VERSION $(1)/usr/lib/openwisp-monitoring/
endef endef