Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gluon-site
  3. GLUON_SITEDIR = '$(call qstrip,$(CONFIG_GLUON_SITEDIR))'
  4. GLUON_SITE_VERSION = $(shell ( cd $(GLUON_SITEDIR) && git --git-dir=.git describe --always --dirty=+ ) 2>/dev/null || echo unknown)
  5. PKG_VERSION:=$(if $(DUMP),x,$(GLUON_SITE_VERSION))
  6. PKG_CONFIG_DEPENDS := CONFIG_GLUON_RELEASE CONFIG_GLUON_SITEDIR
  7. PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/site.conf $(GLUON_SITEDIR)/i18n/
  8. PKG_BUILD_DEPENDS := lua-cjson/host
  9. PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
  10. include ../gluon.mk
  11. PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
  12. define Package/gluon-site
  13. SECTION:=gluon
  14. CATEGORY:=Gluon
  15. TITLE:=Site-specific files of Gluon
  16. endef
  17. define Package/gluon-site/config
  18. config GLUON_RELEASE
  19. string "Gluon release number"
  20. depends on PACKAGE_gluon-site
  21. default ""
  22. config GLUON_SITEDIR
  23. string "Gluon site configuration directory"
  24. depends on PACKAGE_gluon-site
  25. default ""
  26. endef
  27. define Build/Prepare
  28. mkdir -p $(PKG_BUILD_DIR)
  29. endef
  30. define Build/Configure
  31. endef
  32. define Build/Compile
  33. GLUON_SITEDIR='$(call qstrip,$(CONFIG_GLUON_SITEDIR))' lua -e 'print(require("cjson").encode(assert(dofile("../../scripts/site_config.lua"))))' > $(PKG_BUILD_DIR)/site.json
  34. $(call GluonBuildI18N,gluon-site,$(GLUON_SITEDIR)/i18n)
  35. endef
  36. define Package/gluon-site/install
  37. $(INSTALL_DIR) $(1)/lib/gluon
  38. $(INSTALL_DATA) $(PKG_BUILD_DIR)/site.json $(1)/lib/gluon/
  39. echo '$(GLUON_SITE_VERSION)' > $(1)/lib/gluon/site-version
  40. echo '$(call qstrip,$(CONFIG_GLUON_RELEASE))' > $(1)/lib/gluon/release
  41. $(call GluonInstallI18N,gluon-site,$(1))
  42. endef
  43. $(eval $(call BuildPackage,gluon-site))