From 46c1b5962d178e4c5fcb0204c5b2e7f005482cbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karsten=20B=C3=B6ddeker?= <freifunk@kb-light.de>
Date: Sat, 16 Apr 2016 01:33:28 +0200
Subject: [PATCH] ffho-luci-autoupdater-wifi-fallback: new package

Luci module for gluon-autoupdater and ffho-autoupdater-wifi-fallback, based on
gluon-luci-autoupdater.
---
 .../Makefile                                  | 39 +++++++++++++++++++
 .../ReadMe.md                                 |  5 +++
 .../lua/luci/controller/admin/autoupdater.lua | 19 +++++++++
 .../lua/luci/model/cbi/admin/autoupdater.lua  | 39 +++++++++++++++++++
 .../i18n/de.po                                | 20 ++++++++++
 .../ffho-luci-autoupdater-wifi-fallback.pot   | 11 ++++++
 6 files changed, 133 insertions(+)
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/ReadMe.md
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/controller/admin/autoupdater.lua
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/i18n/de.po
 create mode 100644 ffho/ffho-luci-autoupdater-wifi-fallback/i18n/ffho-luci-autoupdater-wifi-fallback.pot

diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile b/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
new file mode 100644
index 0000000..3f8ae5b
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/Makefile
@@ -0,0 +1,39 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ffho-luci-autoupdater-wifi-fallback
+PKG_VERSION:=1
+PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(GLUONDIR)/include/package.mk
+
+PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
+
+define Package/ffho-luci-autoupdater-wifi-fallback
+  SECTION:=ffho
+  CATEGORY:=FFHO
+  TITLE:=Luci module for gluon-autoupdater and ffho-autoupdater-wifi-fallback
+  DEPENDS:=+gluon-luci-admin +gluon-autoupdater +ffho-autoupdater-wifi-fallback
+  PROVIDES:=gluon-luci-autoupdater
+  MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
+  URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+	$(call GluonBuildI18N,ffho-luci-autoupdater-wifi-fallback,i18n)
+endef
+
+define Package/gluon-luci-autoupdater/install
+	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,ffho-luci-autoupdater-wifi-fallback,$(1))
+endef
+
+$(eval $(call BuildPackage,ffho-luci-autoupdater-wifi-fallback))
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/ReadMe.md b/ffho/ffho-luci-autoupdater-wifi-fallback/ReadMe.md
new file mode 100644
index 0000000..dee4e93
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/ReadMe.md
@@ -0,0 +1,5 @@
+ffho-luci-autoupdater-wifi-fallback
+===================================
+
+Luci module for ``gluon-autoupdater`` and ``ffho-autoupdater-wifi-fallback``,
+based on ``gluon-luci-autoupdater``.
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/controller/admin/autoupdater.lua b/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/controller/admin/autoupdater.lua
new file mode 100644
index 0000000..64e1acb
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/controller/admin/autoupdater.lua
@@ -0,0 +1,19 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2013 Nils Schneider <nils@nilsschneider.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+module("luci.controller.admin.autoupdater", package.seeall)
+
+function index()
+        entry({"admin", "autoupdater"}, cbi("admin/autoupdater"), _("Automatic updates"), 80)
+end
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua b/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
new file mode 100644
index 0000000..90e9bb8
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
@@ -0,0 +1,39 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2013 Nils Schneider <nils@nilsschneider.net>
+Copyright 2016 Karsten Böddeker <freifunk@kb-light.de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+m = Map("autoupdater", translate("Automatic updates"))
+
+s = m:section(TypedSection, "autoupdater", nil)
+s.addremove = false
+s.anonymous = true
+
+s:option(Flag, "enabled", translate("Enable"))
+f = s:option(ListValue, "branch", translate("Branch"))
+
+uci.cursor():foreach("autoupdater", "branch", function (section) f:value(section[".name"]) end)
+
+m2 = Map("autoupdater-wifi-fallback", translate("Wifi fallback updates"))
+
+s2 = m2:section(TypedSection, "autoupdater-wifi-fallback", nil)
+s2.addremove = false
+s2.anonymous = true
+
+s2:option(Flag, "enabled", translate("Enable"))
+
+local c = Compound(m, m2)
+c.pageaction = false
+c.template = "admin/expertmode"
+return c
+
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/de.po b/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/de.po
new file mode 100644
index 0000000..d0ac361
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/de.po
@@ -0,0 +1,20 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-04-16 01:26+0200\n"
+"Last-Translator:  <freifunk@kb-light.de>\n"
+"Language-Team: German\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "Automatic updates"
+msgstr "Automatische Updates"
+
+msgid "Branch"
+msgstr "Branch"
+
+msgid "Wifi fallback updates"
+msgstr "Wifi-Fallback Updates"
diff --git a/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/ffho-luci-autoupdater-wifi-fallback.pot b/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/ffho-luci-autoupdater-wifi-fallback.pot
new file mode 100644
index 0000000..fd8f775
--- /dev/null
+++ b/ffho/ffho-luci-autoupdater-wifi-fallback/i18n/ffho-luci-autoupdater-wifi-fallback.pot
@@ -0,0 +1,11 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Automatic updates"
+msgstr ""
+
+msgid "Branch"
+msgstr ""
+
+msgid "Wifi fallback updates"
+msgstr ""
-- 
GitLab