diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-09-09 23:35:30 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-10-25 01:03:37 +0200 |
commit | e0650da41e17d9e9006b29e726a2b2e8b7410f66 (patch) | |
tree | a255a109c97c2a37691b97dbadef33462b91bf8b | |
parent | 2e93fa669bb55f954a9e31a1e3801c267d94ab2f (diff) |
luci.mk: add basic support for ucode sources
Add special handling for ucode/ package subdirs, analogeous to luasrc/.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | luci.mk | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -72,6 +72,7 @@ LUCI_LC_ALIAS.zh_Hant=zh-tw HTDOCS = /www LUA_LIBRARYDIR = /usr/lib/lua LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci +UCODE_LIBRARYDIR = /usr/share/ucode/luci # 1: everything expect po subdir or only po subdir @@ -160,7 +161,7 @@ ifneq ($(LUCI_DESCRIPTION),) endif define Build/Prepare - for d in luasrc htdocs root src; do \ + for d in luasrc ucode htdocs root src; do \ if [ -d ./$$$$d ]; then \ mkdir -p $(PKG_BUILD_DIR)/$$$$d; \ $(CP) ./$$$$d/* $(PKG_BUILD_DIR)/$$$$d/; \ @@ -193,6 +194,11 @@ define Package/$(PKG_NAME)/install $(if $(CONFIG_LUCI_SRCDIET),$(call SrcDiet,$(1)$(LUCI_LIBRARYDIR)/),true) $(call SubstituteVersion,$(1)$(LUCI_LIBRARYDIR)/) endif + ifneq ($(wildcard ${CURDIR}/ucode),) + $(INSTALL_DIR) $(1)$(UCODE_LIBRARYDIR) + cp -pR $(PKG_BUILD_DIR)/ucode/* $(1)$(UCODE_LIBRARYDIR)/ + $(call SubstituteVersion,$(1)$(UCODE_LIBRARYDIR)/) + endif ifneq ($(wildcard ${CURDIR}/htdocs),) $(INSTALL_DIR) $(1)$(HTDOCS) cp -pR $(PKG_BUILD_DIR)/htdocs/* $(1)$(HTDOCS)/ @@ -265,6 +271,11 @@ define SubstituteVersion $(SED) 's/<%# *\([^ ]*\)PKG_VERSION *%>/\1$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))/g' \ -e 's/"\(<%= *\(media\|resource\) *%>[^"]*\.\(js\|css\)\)"/"\1?v=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))"/g' \ "$$$$src"; \ + done; \ + $(FIND) $(1) -type f -name '*.ut' | while read src; do \ + $(SED) 's/{# *\([^ ]*\)PKG_VERSION *#}/\1$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))/g' \ + -e 's/"\({{ *\(media\|resource\) *}}[^"]*\.\(js\|css\)\)"/"\1?v=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))"/g' \ + "$$$$src"; \ done endef |