+$(eval $(call application,p2pblock,LuCI Support for the Freifunk P2P-Block addon,\
+ +luci-app-firewall +PACKAGE_luci-app-p2pblock:freifunk-p2pblock))
+
+$(eval $(call application,multiwan,LuCI Support for the OpenWrt MultiWAN agent,\
+ +luci-app-firewall +PACKAGE_luci-app-multiwan:multiwan))
+
+$(eval $(call application,wol,LuCI Support for Wake-on-LAN,\
+ +PACKAGE_luci-app-wol:etherwake))
+
+$(eval $(call application,vnstat,LuCI Support for VnStat,\
+ +PACKAGE_luci-app-vnstat:vnstat \
+ +PACKAGE_luci-app-vnstat:vnstati))
+
+$(eval $(call application,lqtapifoss,Lantiq voip))
+
+### Server Gateway Interfaces ###
+define sgi
+ define Package/luci-sgi-$(1)
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=LuCI - Lua Configuration Interface
+ URL:=http://luci.subsignal.org/
+ MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
+ SUBMENU:=Server Interfaces
+ TITLE:=$(if $(2),$(2),LuCI $(1) server gateway interface)
+ $(if $(3),DEPENDS:=$(3))
+ endef
+
+ define Package/luci-sgi-$(1)/install
+ $(call Package/luci/install/template,$$(1),libs/sgi-$(1))
+ endef
+
+ ifneq ($(CONFIG_PACKAGE_luci-sgi-$(1)),)
+ LUCI_SELECTED_MODULES+=libs/sgi-$(1)
+ endif
+
+ LUCI_BUILD_PACKAGES += luci-sgi-$(1)
+endef
+
+$(eval $(call sgi,cgi,CGI Gateway behind existing Webserver))
+$(eval $(call sgi,uhttpd,Binding for the uHTTPd server,+uhttpd +uhttpd-mod-lua))
+
+
+### Themes ###
+define theme
+ define Package/luci-theme-$(1)
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=LuCI - Lua Configuration Interface
+ URL:=http://luci.subsignal.org/
+ SUBMENU:=Themes
+ TITLE:=$(if $(2),$(2),LuCI $(1) theme)
+ MAINTAINER:=$(if $(3),$(3),LuCI Development Team <luci@lists.subsignal.org>)
+ DEPENDS:=$(if $(filter-out base,$(1)),+luci-theme-base) $(4)
+ $(if $(5),DEFAULT:=y if PACKAGE_luci-lib-core)
+ endef
+
+ define Package/luci-theme-$(1)/install
+ $(call Package/luci/install/template,$$(1),themes/$(1))
+ endef
+
+ ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
+ LUCI_SELECTED_MODULES+=themes/$(1)
+ endif
+
+ LUCI_BUILD_PACKAGES += luci-theme-$(1)
+endef
+
+$(eval $(call theme,base,Common base for all themes,,+luci-lib-web))
+$(eval $(call theme,openwrt,OpenWrt.org (default),,,1))
+$(eval $(call theme,fledermaus,Fledermaus Theme))
+
+$(eval $(call theme,freifunk,alternative Freifunk Theme,\
+ Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
+
+$(eval $(call theme,freifunk-bno,Freifunk Berlin Nordost Theme,\
+ Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
+
+$(eval $(call theme,freifunk-hannover,Freifunk Hannover Theme,\
+ Mikolas Bingemer <mickey-at-freifunk-hannover-dot-de>))
+
+
+### Translations ###
+define translation
+ define Package/luci-i18n-$(1)
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=LuCI - Lua Configuration Interface
+ URL:=http://luci.subsignal.org/
+ MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
+ SUBMENU:=Translations
+ TITLE:=$(if $(2),$(2),$(1))
+ endef
+
+ define Package/luci-i18n-$(1)/install
+ $(call Package/luci/install/template,$$(1),i18n/$(1))
+ endef
+
+ ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
+ LUCI_SELECTED_MODULES+=i18n/$(1)
+ endif
+
+ LUCI_BUILD_PACKAGES += luci-i18n-$(1)
+endef
+
+$(eval $(call translation,german,German))
+$(eval $(call translation,english,English))
+$(eval $(call translation,french,French (by Florian Fainelli)))
+$(eval $(call translation,italian,Italian (by Matteo Croce)))
+$(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
+$(eval $(call translation,portuguese_brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
+$(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
+$(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
+$(eval $(call translation,catalan,Catalan (by Eduard Duran)))
+$(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
+$(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
+$(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
+$(eval $(call translation,malay,Malay (by Teow Wai Chet)))
+$(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
+
+
+### Collections ###
+define collection
+ define Package/luci$(if $(1),-$(1))
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=LuCI - Lua Configuration Interface
+ URL:=http://luci.subsignal.org/
+ MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
+ SUBMENU:=Collections
+ TITLE:=$(if $(2),$(2),LuCI $(if $(1),$(1),general) collection)
+ $(if $(3),DEPENDS:=$(3))
+ endef
+
+ define Package/luci$(if $(1),-$(1))/install
+ true
+ endef
+
+ LUCI_BUILD_PACKAGES += luci$(if $(1),-$(1))
+endef
+
+$(eval $(call collection,,\
+ Standard OpenWrt set including full and mini admin and the standard theme,\
+ +uhttpd +luci-mod-admin-full +luci-theme-openwrt +luci-app-firewall \
+ +luci-app-initmgr))
+
+$(eval $(call collection,ssl,\
+ Standard OpenWrt set with HTTPS support,\
+ +uhttpd +uhttpd-mod-tls +px5g +luci-mod-admin-full +luci-theme-openwrt \
+ +luci-app-firewall +luci-app-initmgr))
+
+$(eval $(call collection,light,\
+ Minimum package set using only admin mini and the standard theme,\
+ +uhttpd +luci-mod-admin-mini +luci-theme-openwrt-light))
+
+
+### Compile ###
+PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(LUCI_BUILD_PACKAGES))
+$(foreach b,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))