Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=ffho-site-generate
  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 $(INCLUDE_DIR)/package.mk
  8. define Package/ffho-site-generate
  9. SECTION:=ffho
  10. CATEGORY:=Site-select
  11. TITLE:=Scripts for generating a new site.json
  12. DEPENDS:=+gluon-core +luci-lib-json
  13. MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
  14. URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
  15. endef
  16. define Package/ffho-site-generate/description
  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. endef
  25. define Package/ffho-site-generate/install
  26. $(CP) ./files/* $(1)/
  27. lua -e 'print(require("cjson").encode(assert(dofile("$(GLUONDIR)/scripts/site_config.lua"))))' > $(1)/lib/gluon/site-select/default.json
  28. lua -e 'print(require("cjson").encode(assert(dofile("./scripts/sites.lua"))))' > $(1)/lib/gluon/site-select/sites.json
  29. if [ -e $(GLUON_SITEDIR)/extra/groups.conf ]; then lua -e 'print(require("cjson").encode(assert(dofile("./scripts/groupes.lua"))))' > $(1)/lib/gluon/site-select/groups.json; fi
  30. endef
  31. $(eval $(call BuildPackage,ffho-site-generate))