Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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:=Gluon
  11. TITLE:=Scripts for generating a new site.json
  12. DEPENDS:=+gluon-core +luci-lib-json
  13. MAINTAINER:=Freifunk Hochstift <maschinenraum@paderborn.freifunk.net>
  14. URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
  15. SOURCE:=git@git.c3pb.de:freifunk-pb/ffho-packages.git
  16. endef
  17. define Package/ffho-site-generate/description
  18. endef
  19. define Build/Prepare
  20. mkdir -p $(PKG_BUILD_DIR)
  21. endef
  22. define Build/Configure
  23. endef
  24. define Build/Compile
  25. endef
  26. define Package/ffho-site-generate/preinst
  27. endef
  28. define Package/ffho-site-generate/install
  29. $(CP) ./files/* $(1)/
  30. lua -e 'print(require("cjson").encode(assert(dofile("$(GLUONDIR)/scripts/site_config.lua"))))' > $(1)/lib/gluon/site-select/default.json
  31. lua -e 'print(require("cjson").encode(assert(dofile("./scripts/sites.lua"))))' > $(1)/lib/gluon/site-select/sites.json
  32. 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
  33. endef
  34. $(eval $(call BuildPackage,ffho-site-generate))