Skip to content
Snippets Groups Projects
Select Git revision
  • ba81359c602d7177e3167d3002454cc6021ab524
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
41 results

check_site.lua

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    • Kokel's avatar
      ba81359c
      "gluon-node-info": add section system and option role; add announce script to... · ba81359c
      Kokel authored
      "gluon-node-info": add section system and option role; add announce script to announce the role as nodeinfo;
      add invariant script "001-node-system" to add section "system" if not exist; add invariant script "010-node-role"
      to add section "system" if not exist; add invariant script "010-node-role" to set role to default value
      (site.roles.default) if not exist; depends on new site.conf section
      ba81359c
      History
      "gluon-node-info": add section system and option role; add announce script to...
      Kokel authored
      "gluon-node-info": add section system and option role; add announce script to announce the role as nodeinfo;
      add invariant script "001-node-system" to add section "system" if not exist; add invariant script "010-node-role"
      to add section "system" if not exist; add invariant script "010-node-role" to set role to default value
      (site.roles.default) if not exist; depends on new site.conf section
    gluon.mk 3.20 KiB
    GLUON_MK := $(abspath $(lastword $(MAKEFILE_LIST)))
    PKG_FILE_DEPENDS += $(GLUON_MK)
    
    PKG_BUILD_DEPENDS += luasrcdiet/host
    
    ifneq ($(wildcard ./luasrc/.),)
    	PKG_CONFIG_DEPENDS += CONFIG_GLUON_MINIFY
    endif
    
    ifneq ($(wildcard ./src/respondd.c),)
      PKG_BUILD_DEPENDS += respondd
    endif
    
    include $(INCLUDE_DIR)/package.mk
    
    
    # Annoyingly, make's shell function replaces all newlines with spaces, so we have to do some escaping work. Yuck.
    shell-escape = $(shell $(1) | sed -ne '1h; 1!H; $$ {g; s/@/@1/g; s/\n/@2/g; p}')
    shell-unescape = $(subst @1,@,$(subst @2,$(newline),$(1)))
    shell-verbatim = $(call shell-unescape,$(call shell-escape,$(1)))
    
    
    define GluonCheckSite
    [ -z "$$IPKG_INSTROOT" ] || "${TOPDIR}/staging_dir/hostpkg/bin/lua" "${TOPDIR}/../scripts/check_site.lua" <<'END__GLUON__CHECK__SITE'
    $(call shell-verbatim,cat '$(1)')
    END__GLUON__CHECK__SITE
    endef
    
    GLUON_SUPPORTED_LANGS := de fr
    GLUON_LANG_de := German
    GLUON_LANG_fr := French
    
    GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_GLUON_WEB_LANG_$(lang))
    GLUON_ENABLED_LANGS := en $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_GLUON_WEB_LANG_$(lang)),$(lang)))
    
    ifneq ($(wildcard ./i18n/.),)
      PKG_BUILD_DEPENDS += gluon-web/host
      PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
    endif
    
    
    define GluonBuildI18N
    	mkdir -p $$(PKG_BUILD_DIR)/i18n
    	for lang in $$(GLUON_ENABLED_LANGS); do \
    		if [ -e $(1)/$$$$lang.po ]; then \
    			rm -f $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \
    			gluon-po2lmo $(1)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \
    		fi; \
    	done
    endef
    
    define GluonInstallI18N
    	$$(INSTALL_DIR) $(1)/lib/gluon/web/i18n
    	for lang in $$(GLUON_ENABLED_LANGS); do \
    		if [ -e $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo ]; then \
    			$$(INSTALL_DATA) $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo $(1)/lib/gluon/web/i18n/$(PKG_NAME).$$$$lang.lmo; \
    		fi; \
    	done
    endef
    
    define GluonSrcDiet
    	rm -rf $(2)
    	$(CP) $(1) $(2)
      ifdef CONFIG_GLUON_MINIFY
    	# Use cp + rm instead of mv to preserve destination permissions
    	set -e; $(FIND) $(2) -type f | while read src; do \
    		luasrcdiet --noopt-binequiv -o "$$$$src.tmp" "$$$$src"; \
    		cp "$$$$src.tmp" "$$$$src"; \
    		rm "$$$$src.tmp"; \
    	done