From 1a6670ef01a50f5b40d186cb1beeb84b55438f8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karsten=20B=C3=B6ddeker?= <freifunk@kb-light.de>
Date: Thu, 26 Jan 2017 14:14:37 +0100
Subject: [PATCH] update for lede based master

---
 ffho/ffho-ap-timer/Makefile                         |  2 +-
 ffho/ffho-ath9k-blackout-workaround/Makefile        |  2 +-
 ffho/ffho-autoupdater-wifi-fallback-legacy/Makefile |  2 +-
 ffho/ffho-autoupdater-wifi-fallback/Makefile        |  2 +-
 ffho/ffho-banner/Makefile                           |  2 +-
 ffho/ffho-config-mode-site-select/Makefile          |  2 +-
 ffho/ffho-debug/Makefile                            |  2 +-
 ffho/ffho-ebtables-net-rules/Makefile               |  2 +-
 ffho/ffho-fix-defaultroute/Makefile                 |  2 +-
 ffho/ffho-geo-location-altitude-delete/Makefile     |  2 +-
 ffho/ffho-luci-ap-timer/Makefile                    |  2 +-
 .../usr/lib/lua/luci/model/cbi/admin/ap-timer.lua   |  2 +-
 ffho/ffho-luci-autoupdater-wifi-fallback/Makefile   |  2 +-
 .../lib/lua/luci/model/cbi/admin/autoupdater.lua    |  2 +-
 ffho/ffho-luci-remote-syslog/Makefile               |  2 +-
 .../lib/lua/luci/model/cbi/admin/remote-syslog.lua  |  2 +-
 ffho/ffho-respondd-config/Makefile                  |  2 +-
 ffho/ffho-site-auto-select/Makefile                 |  5 +++--
 ffho/ffho-site-generate/Makefile                    | 13 ++++++++-----
 ffho/ffho-status-page/Makefile                      |  2 +-
 20 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/ffho/ffho-ap-timer/Makefile b/ffho/ffho-ap-timer/Makefile
index 6e2507d..73a8ae8 100644
--- a/ffho/ffho-ap-timer/Makefile
+++ b/ffho/ffho-ap-timer/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-ap-timer
   SECTION:=ffho
diff --git a/ffho/ffho-ath9k-blackout-workaround/Makefile b/ffho/ffho-ath9k-blackout-workaround/Makefile
index 9bd831b..224dca1 100644
--- a/ffho/ffho-ath9k-blackout-workaround/Makefile
+++ b/ffho/ffho-ath9k-blackout-workaround/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-ath9k-blackout-workaround
   SECTION:=ffho
diff --git a/ffho/ffho-autoupdater-wifi-fallback-legacy/Makefile b/ffho/ffho-autoupdater-wifi-fallback-legacy/Makefile
index b529e6f..d5c40cf 100644
--- a/ffho/ffho-autoupdater-wifi-fallback-legacy/Makefile
+++ b/ffho/ffho-autoupdater-wifi-fallback-legacy/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-autoupdater-wifi-fallback-legacy
   SECTION:=ffho
diff --git a/ffho/ffho-autoupdater-wifi-fallback/Makefile b/ffho/ffho-autoupdater-wifi-fallback/Makefile
index 23529d2..f70bcff 100644
--- a/ffho/ffho-autoupdater-wifi-fallback/Makefile
+++ b/ffho/ffho-autoupdater-wifi-fallback/Makefile
@@ -7,7 +7,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_BUILD_DEPENDS := respondd
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-autoupdater-wifi-fallback
   SECTION:=ffho
diff --git a/ffho/ffho-banner/Makefile b/ffho/ffho-banner/Makefile
index 45527b9..64be09a 100644
--- a/ffho/ffho-banner/Makefile
+++ b/ffho/ffho-banner/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-banner
   SECTION:=ffho
diff --git a/ffho/ffho-config-mode-site-select/Makefile b/ffho/ffho-config-mode-site-select/Makefile
index 9219ec6..1e92dd1 100644
--- a/ffho/ffho-config-mode-site-select/Makefile
+++ b/ffho/ffho-config-mode-site-select/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=1
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
 
diff --git a/ffho/ffho-debug/Makefile b/ffho/ffho-debug/Makefile
index 47804dc..7822bca 100644
--- a/ffho/ffho-debug/Makefile
+++ b/ffho/ffho-debug/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-debug
   SECTION:=ffho
diff --git a/ffho/ffho-ebtables-net-rules/Makefile b/ffho/ffho-ebtables-net-rules/Makefile
index 5a88286..0f491dc 100644
--- a/ffho/ffho-ebtables-net-rules/Makefile
+++ b/ffho/ffho-ebtables-net-rules/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-ebtables-net-rules
   SECTION:=ffho
diff --git a/ffho/ffho-fix-defaultroute/Makefile b/ffho/ffho-fix-defaultroute/Makefile
index 578005f..e59668f 100644
--- a/ffho/ffho-fix-defaultroute/Makefile
+++ b/ffho/ffho-fix-defaultroute/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-fix-defaultroute
   SECTION:=ffho
diff --git a/ffho/ffho-geo-location-altitude-delete/Makefile b/ffho/ffho-geo-location-altitude-delete/Makefile
index 42b5302..01046cf 100644
--- a/ffho/ffho-geo-location-altitude-delete/Makefile
+++ b/ffho/ffho-geo-location-altitude-delete/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-geo-location-altitude-delete
   SECTION:=ffho
diff --git a/ffho/ffho-luci-ap-timer/Makefile b/ffho/ffho-luci-ap-timer/Makefile
index 2b80b7c..9086027 100644
--- a/ffho/ffho-luci-ap-timer/Makefile
+++ b/ffho/ffho-luci-ap-timer/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
 
diff --git a/ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/model/cbi/admin/ap-timer.lua b/ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/model/cbi/admin/ap-timer.lua
index eed4ede..c3e9035 100644
--- a/ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/model/cbi/admin/ap-timer.lua
+++ b/ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/model/cbi/admin/ap-timer.lua
@@ -13,7 +13,7 @@ end
 m = Map('ap-timer', translate('AP Timer'), translate(
   'You can setup the AP Timer here'))
 m.pageaction = false
-m.template = "admin/expertmode"
+m.template = "cbi/simpleform"
 
 s = m:section(NamedSection, 'settings', 'ap-timer', nil)
 s.addremove = false
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile b/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
index 57dc476..07d0ec1 100644
--- a/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
 
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua b/ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
index 90e9bb8..1046039 100644
--- a/ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
@@ -34,6 +34,6 @@ s2:option(Flag, "enabled", translate("Enable"))
 
 local c = Compound(m, m2)
 c.pageaction = false
-c.template = "admin/expertmode"
+c.template = "cbi/simpleform"
 return c
 
diff --git a/ffho/ffho-luci-remote-syslog/Makefile b/ffho/ffho-luci-remote-syslog/Makefile
index ab86b49..1fdb82c 100644
--- a/ffho/ffho-luci-remote-syslog/Makefile
+++ b/ffho/ffho-luci-remote-syslog/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
 
diff --git a/ffho/ffho-luci-remote-syslog/luasrc/usr/lib/lua/luci/model/cbi/admin/remote-syslog.lua b/ffho/ffho-luci-remote-syslog/luasrc/usr/lib/lua/luci/model/cbi/admin/remote-syslog.lua
index ac781ce..e381a2a 100644
--- a/ffho/ffho-luci-remote-syslog/luasrc/usr/lib/lua/luci/model/cbi/admin/remote-syslog.lua
+++ b/ffho/ffho-luci-remote-syslog/luasrc/usr/lib/lua/luci/model/cbi/admin/remote-syslog.lua
@@ -1,7 +1,7 @@
 m = Map("system", translate("Remote Syslog"), translate(
   "If you want to use a remote syslog server, you can set it up here."))
 m.pageaction = false
-m.template = "admin/expertmode"
+m.template = "cbi/simpleform"
 
 s = m:section(TypedSection, "system", nil)
 s.addremove = false
diff --git a/ffho/ffho-respondd-config/Makefile b/ffho/ffho-respondd-config/Makefile
index ed208d9..df55d3d 100644
--- a/ffho/ffho-respondd-config/Makefile
+++ b/ffho/ffho-respondd-config/Makefile
@@ -7,7 +7,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_BUILD_DEPENDS := respondd
 
-include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-respondd-config
   SECTION:=ffho
diff --git a/ffho/ffho-site-auto-select/Makefile b/ffho/ffho-site-auto-select/Makefile
index 8cffbf1..76d249d 100644
--- a/ffho/ffho-site-auto-select/Makefile
+++ b/ffho/ffho-site-auto-select/Makefile
@@ -8,7 +8,7 @@ PFG_BUILD_DEPENDS := lua-cjson/host
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-site-auto-select
   SECTION:=ffho
@@ -31,13 +31,14 @@ define Build/Configure
 endef
 
 define Build/Compile
+	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
 	$(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
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/geo.json $(1)/lib/gluon/site-select/
 endef
 
 $(eval $(call BuildPackage,ffho-site-auto-select))
diff --git a/ffho/ffho-site-generate/Makefile b/ffho/ffho-site-generate/Makefile
index e1e2a17..b785781 100644
--- a/ffho/ffho-site-generate/Makefile
+++ b/ffho/ffho-site-generate/Makefile
@@ -8,7 +8,7 @@ PFG_BUILD_DEPENDS := lua-cjson/host
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-site-generate
   SECTION:=ffho
@@ -23,22 +23,25 @@ define Package/ffho-site-generate/description
 endef
 
 define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
+	mkdir -p $(PKG_BUILD_DIR)/site-select
 endef
 
 define Build/Configure
 endef
 
 define Build/Compile
+	GLUON_SITEDIR='$(call qstrip,$(CONFIG_GLUON_SITEDIR))' lua -e 'print(require("cjson").encode(assert(dofile("./scripts/sites.lua"))))' > $(PKG_BUILD_DIR)/site-select/sites.json
+	GLUON_SITEDIR='$(call qstrip,$(CONFIG_GLUON_SITEDIR))' lua -e 'print(require("cjson").encode(assert(dofile("./scripts/template.lua"))))' > $(PKG_BUILD_DIR)/site-select/template.json
+	if [ -e $(call qstrip,$(CONFIG_GLUON_SITEDIR))/extra/groups.conf  ]; then GLUON_SITEDIR='$(call qstrip,$(CONFIG_GLUON_SITEDIR))' lua -e 'print(require("cjson").encode(assert(dofile("./scripts/groups.lua"))))' >  $(PKG_BUILD_DIR)/site-select/groups.json; fi
 	$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
 endef
 
 define Package/ffho-site-generate/install
 	$(CP) ./files/* $(1)/
 	$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
-	lua -e 'print(require("cjson").encode(assert(dofile("./scripts/template.lua"))))' > $(1)/lib/gluon/site-select/template.json
-	lua -e 'print(require("cjson").encode(assert(dofile("./scripts/sites.lua"))))' >  $(1)/lib/gluon/site-select/sites.json
-	if [ -e $(GLUON_SITEDIR)/extra/groups.conf  ]; then lua -e 'print(require("cjson").encode(assert(dofile("./scripts/groups.lua"))))' >  $(1)/lib/gluon/site-select/groups.json; fi
+
+	$(INSTALL_DIR) $(1)/lib/gluon/site-select
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/site-select/* $(1)/lib/gluon/site-select/
 endef
 
 $(eval $(call BuildPackage,ffho-site-generate))
diff --git a/ffho/ffho-status-page/Makefile b/ffho/ffho-status-page/Makefile
index 1bea65f..bbf0061 100644
--- a/ffho/ffho-status-page/Makefile
+++ b/ffho/ffho-status-page/Makefile
@@ -6,7 +6,7 @@ PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-include $(GLUONDIR)/include/package.mk
+include $(TOPDIR)/../package/gluon.mk
 
 define Package/ffho-status-page
   SECTION:=ffho
-- 
GitLab