include $(TOPDIR)/rules.mk PKG_NAME:=ffho-site-auto-select PKG_VERSION:=1 PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION) PFG_BUILD_DEPENDS := lua-cjson/host PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(GLUONDIR)/include/package.mk define Package/ffho-site-auto-select SECTION:=ffho CATEGORY:=Site-select TITLE:=Toolset to autodetect the site. DEPENDS:=+gluon-core +micrond +gluon-neighbour-info +ffho-site-generate MAINTAINER:=Freifunk Hochstift URL:=https://git.c3pb.de/freifunk-pb/ffho-packages endef define Package/ffho-site-auto-select/description Toolset to autodetect the site by geo and gluon-neighbour-info. endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef define Build/Configure endef define Build/Compile $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) endef define Package/ffho-site-auto-select/install $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ $(INSTALL_DIR) $(1)/lib/gluon/site-select lua -e 'print(require("cjson").encode(require("cjson").decode(io.open("$(GLUON_SITEDIR)/extra/geo.json"):read("*a"))))' > $(1)/lib/gluon/site-select/geo.json endef $(eval $(call BuildPackage,ffho-site-auto-select))