LuCI - OpenWrt Configuration Interface
Revisão | bba7739e9f208d94370a741737770f8d82236b4b (tree) |
---|---|
Hora | 2022-01-24 15:25:50 |
Autor | Sven Roederer <devel-sven@gero...> |
Commiter | Tianling Shen |
luci.mk: make SUBMENU package define customizable and optional
When including luci.mk in external repos it's sometimes usefull to not use
the default LuCI-submenu hierarchy.
This change defines the LUCI_SUBMENU_FORCED variable which completely overrides
the default submenu of the LuCI config-section. When LUCI_SUBMENU_FORCED is not
defined, the default submenu derrived from LUCI_TYPE or "Application" fallback
is used.
Defining LUCI_SUBMENU_FORCED in the package Makefile will just use this value.
Setting it to "none" will not define a submenu at all.
Together with LUCI_SECTION and LUCI_CATEGORY menu items can now created at any
place in the menu structure.
Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 2b11ec6fd02be060443cf4afc9d89058aadcfab3)
@@ -92,10 +92,22 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) | ||
92 | 92 | |
93 | 93 | include $(INCLUDE_DIR)/package.mk |
94 | 94 | |
95 | +# LUCI_SUBMENU: the submenu-item below the LuCI top-level menu inside OpoenWrt menuconfig | |
96 | +# usually one of the LUCI_MENU.* definitions | |
97 | +# LUCI_SUBMENU_DEFAULT: the regular SUBMENU defined by LUCI_TYPE or derrived from the packagename | |
98 | +# LUCI_SUBMENU_FORCED: manually forced value SUBMENU to set to by explicit definiton | |
99 | +# can be any string, "none" disables the creation of a submenu | |
100 | +# most usefull in combination with LUCI_CATEGORY, to make the package appear | |
101 | +# anywhere in the menu structure | |
102 | +LUCI_SUBMENU_DEFAULT=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app)) | |
103 | +LUCI_SUBMENU=$(if $(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_DEFAULT)) | |
104 | + | |
95 | 105 | define Package/$(PKG_NAME) |
96 | 106 | SECTION:=$(LUCI_SECTION) |
97 | 107 | CATEGORY:=$(LUCI_CATEGORY) |
98 | - SUBMENU:=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app)) | |
108 | +ifneq ($(LUCI_SUBMENU),none) | |
109 | + SUBMENU:=$(LUCI_SUBMENU) | |
110 | +endif | |
99 | 111 | TITLE:=$(if $(LUCI_TITLE),$(LUCI_TITLE),LuCI $(LUCI_NAME) $(LUCI_TYPE)) |
100 | 112 | DEPENDS:=$(LUCI_DEPENDS) |
101 | 113 | $(if $(LUCI_PKGARCH),PKGARCH:=$(LUCI_PKGARCH)) |