Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=ffho-site-auto-select
  3. PKG_VERSION:=1
  4. PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
  5. PFG_BUILD_DEPENDS := lua-cjson/host
  6. PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
  7. include $(TOPDIR)/../package/gluon.mk
  8. define Package/ffho-site-auto-select
  9. SECTION:=ffho
  10. CATEGORY:=Site-select
  11. TITLE:=Toolset to autodetect the site.
  12. DEPENDS:=+gluon-core +micrond +gluon-neighbour-info +ffho-site-generate
  13. MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
  14. endef
  15. define Package/ffho-site-auto-select/description
  16. Toolset to autodetect the site by geo and gluon-neighbour-info.
  17. endef
  18. define Build/Prepare
  19. mkdir -p $(PKG_BUILD_DIR)
  20. endef
  21. define Build/Configure
  22. endef
  23. define Build/Compile
  24. lua -e 'print(require("cjson").encode(require("cjson").decode(io.open("$(call qstrip,$(CONFIG_GLUON_SITEDIR))/extra/geo.json"):read("*a"))))' > $(PKG_BUILD_DIR)/geo.json
  25. $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
  26. endef
  27. define Package/ffho-site-auto-select/install
  28. $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
  29. $(INSTALL_DIR) $(1)/lib/gluon/site-select
  30. $(INSTALL_DATA) $(PKG_BUILD_DIR)/geo.json $(1)/lib/gluon/site-select/
  31. endef
  32. $(eval $(call BuildPackage,ffho-site-auto-select))