1 include $(TOPDIR)/rules.mk
10 PKG_VERSION:=$(shell $(LUCI_TOPDIR)/build/mkrevision.sh 2>/dev/null || echo unknown)
12 PKG_BUILD_DEPENDS:=$(if $(STAGING_DIR_ROOT),lua/host)
13 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
14 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20 LUCI_SELECTED_MODULES:=
24 define Package/luci/install/template
25 $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
26 $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
31 define Package/luci-lib-core
34 TITLE:=LuCI - Lua Configuration Interface
35 URL:=http://luci.subsignal.org/
36 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
38 DEPENDS:=+lua +libuci-lua +libubus-lua
39 TITLE:=LuCI core libraries
42 define Package/luci-lib-core/install
43 $(call Package/luci/install/template,$(1),libs/core)
44 $(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
51 define Package/luci-lib-core/config
54 default PACKAGE_luci-lib-core_source
56 config PACKAGE_luci-lib-core_compile
59 config PACKAGE_luci-lib-core_stripped
62 config PACKAGE_luci-lib-core_srcdiet
63 bool "Compressed Source"
65 config PACKAGE_luci-lib-core_source
71 ifneq ($(CONFIG_PACKAGE_luci-lib-core_compile),)
75 ifneq ($(CONFIG_PACKAGE_luci-lib-core_stripped),)
79 ifneq ($(CONFIG_PACKAGE_luci-lib-core_srcdiet),)
83 ifneq ($(CONFIG_PACKAGE_luci-lib-core),)
84 LUCI_SELECTED_MODULES+=libs/core
87 LUCI_BUILD_PACKAGES += luci-lib-core
92 define Package/luci-lib-$(1)
95 TITLE:=LuCI - Lua Configuration Interface
96 URL:=http://luci.subsignal.org/
97 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
99 TITLE:=$(if $(2),$(2),LuCI $(1) library)
100 $(if $(3),DEPENDS:=+luci-lib-core $(3))
103 define Package/luci-lib-$(1)/install
104 $(call Package/luci/install/template,$$(1),libs/$(1))
105 $(call Package/luci-lib-$(1)/extra-install)
108 ifneq ($(CONFIG_PACKAGE_luci-lib-$(1)),)
109 LUCI_SELECTED_MODULES+=libs/$(1)
112 LUCI_BUILD_PACKAGES += luci-lib-$(1)
115 define Package/luci-lib-web/conffiles
119 define Package/luci-lib-nixio/config
121 prompt "TLS Provider"
122 default PACKAGE_luci-lib-nixio_notls
124 config PACKAGE_luci-lib-nixio_notls
127 config PACKAGE_luci-lib-nixio_axtls
128 bool "Builtin (axTLS)"
130 config PACKAGE_luci-lib-nixio_cyassl
132 select PACKAGE_libcyassl
134 config PACKAGE_luci-lib-nixio_openssl
136 select PACKAGE_libopenssl
143 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_axtls),)
147 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_openssl),)
151 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_cyassl),)
153 LUCI_CFLAGS+=-I$(STAGING_DIR)/usr/include/cyassl
157 $(eval $(call library,fastindex,Fastindex indexing module,+PACKAGE_luci-lib-fastindex:liblua))
158 $(eval $(call library,httpclient,HTTP(S) client library,+luci-lib-web +luci-lib-nixio))
159 $(eval $(call library,ipkg,LuCI IPKG/OPKG call abstraction library))
160 $(eval $(call library,json,LuCI JSON library))
161 $(eval $(call library,lucid,LuCId Full-Stack Webserver,+luci-lib-nixio +luci-lib-web +luci-lib-px5g))
162 $(eval $(call library,lucid-http,LuCId HTTP Backend,+luci-lib-lucid))
163 $(eval $(call library,lucid-rpc,LuCId RPC Backend,+luci-lib-lucid))
164 $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-lib-nixio_openssl:libopenssl +PACKAGE_luci-lib-nixio_cyassl:libcyassl))
165 $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-lib-nixio))
166 $(eval $(call library,sys,LuCI Linux/POSIX system library))
167 $(eval $(call library,web,MVC Webframework,+luci-lib-sys +luci-lib-nixio +luci-lib-core +luci-sgi-cgi))
168 $(eval $(call library,luaneightbl,neightbl - Lua lib for IPv6 neighbors,+luci-lib-core))
173 define Package/luci-proto-$(1)
176 TITLE:=LuCI - Lua Configuration Interface
177 URL:=http://luci.subsignal.org/
178 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
179 SUBMENU:=6. Protocols
180 TITLE:=$(if $(2),$(2),LuCI $(1) protocol support)
184 define Package/luci-proto-$(1)/install
185 $(call Package/luci/install/template,$$(1),protocols/$(1))
188 ifneq ($(CONFIG_PACKAGE_luci-proto-$(1)),)
189 LUCI_SELECTED_MODULES+=protocols/$(1)
192 LUCI_BUILD_PACKAGES += luci-proto-$(1)
195 $(eval $(call protocol,core,Support for static/dhcp/none))
196 $(eval $(call protocol,ppp,Support for PPP/PPPoE/PPPoA/PPtP))
197 $(eval $(call protocol,ipv6,Support for DHCPv6/6in4/6to4/6rd/DS-Lite))
198 $(eval $(call protocol,3g,Support for 3G,+PACKAGE_luci-proto-3g:comgt))
199 $(eval $(call protocol,relay,Support for relayd pseudo bridges,+PACKAGE_luci-proto-relay:relayd))
204 define Package/luci-mod-$(1)
207 TITLE:=LuCI - Lua Configuration Interface
208 URL:=http://luci.subsignal.org/
209 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
211 TITLE:=$(if $(2),$(2),LuCI $(1) module)
212 $(if $(3),DEPENDS+=$(3))
215 define Package/luci-mod-$(1)/install
216 $(call Package/luci/install/template,$$(1),modules/$(1))
217 $(call Package/luci-mod-$(1)/extra-install)
220 ifneq ($(CONFIG_PACKAGE_luci-mod-$(1)),)
221 LUCI_SELECTED_MODULES+=modules/$(1)
224 LUCI_BUILD_PACKAGES += luci-mod-$(1)
228 define Package/luci-mod-admin-core/extra-install
229 touch $(1)/etc/init.d/luci_fixtime || true
232 $(eval $(call module,admin-core,Web UI Core module,+luci-lib-web +luci-proto-core +luci-i18n-english))
233 $(eval $(call module,admin-mini,LuCI Essentials - stripped down and user-friendly,+luci-mod-admin-core @BROKEN))
234 $(eval $(call module,admin-full,LuCI Administration - full-featured for full control,+luci-mod-admin-core +luci-lib-ipkg))
235 $(eval $(call module,failsafe,LuCI Fail-Safe - Fail-Safe sysupgrade module,+luci-mod-admin-core))
236 $(eval $(call module,rpc,LuCI RPC - JSON-RPC API,+luci-lib-json))
237 $(eval $(call module,niu,NIU - Next Generation Interface,+luci-mod-admin-core @BROKEN))
242 define Package/luci-app-$(1)
245 TITLE:=LuCI - Lua Configuration Interface
246 URL:=http://luci.subsignal.org/
247 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
248 SUBMENU:=3. Applications
249 TITLE:=$(if $(2),$(2),LuCI $(1) application)
253 define Package/luci-app-$(1)/install
254 $(call Package/luci/install/template,$$(1),applications/luci-$(1))
257 ifneq ($(CONFIG_PACKAGE_luci-app-$(1)),)
258 LUCI_SELECTED_MODULES+=applications/luci-$(1)
261 LUCI_BUILD_PACKAGES += luci-app-$(1)
265 $(eval $(call application,firewall,Firewall and Portforwarding application,\
266 +PACKAGE_luci-app-firewall:firewall))
268 $(eval $(call application,qos,Quality of Service configuration module,\
269 +PACKAGE_luci-app-qos:qos-scripts))
271 $(eval $(call application,commands,LuCI Shell Command Module))
274 ### Server Gateway Interfaces ###
276 define Package/luci-sgi-$(1)
279 TITLE:=LuCI - Lua Configuration Interface
280 URL:=http://luci.subsignal.org/
281 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
282 SUBMENU:=7. Server Interfaces
283 TITLE:=$(if $(2),$(2),LuCI $(1) server gateway interface)
287 define Package/luci-sgi-$(1)/install
288 $(call Package/luci/install/template,$$(1),libs/sgi-$(1))
291 ifneq ($(CONFIG_PACKAGE_luci-sgi-$(1)),)
292 LUCI_SELECTED_MODULES+=libs/sgi-$(1)
295 LUCI_BUILD_PACKAGES += luci-sgi-$(1)
298 $(eval $(call sgi,cgi,CGI Gateway behind existing Webserver))
299 $(eval $(call sgi,uhttpd,Binding for the uHTTPd server,+uhttpd +uhttpd-mod-lua))
304 define Package/luci-theme-$(1)
307 TITLE:=LuCI - Lua Configuration Interface
308 URL:=http://luci.subsignal.org/
310 TITLE:=$(if $(2),$(2),LuCI $(1) theme)
311 MAINTAINER:=$(if $(3),$(3),LuCI Development Team <luci@lists.subsignal.org>)
312 DEPENDS:=$(if $(filter-out base,$(1)),+luci-theme-base) $(4)
313 $(if $(5),DEFAULT:=PACKAGE_luci-lib-core)
316 define Package/luci-theme-$(1)/install
317 $(call Package/luci/install/template,$$(1),themes/$(1))
320 ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
321 LUCI_SELECTED_MODULES+=themes/$(1)
324 LUCI_BUILD_PACKAGES += luci-theme-$(1)
327 $(eval $(call theme,base,Common base for all themes))
328 $(eval $(call theme,openwrt,OpenWrt.org))
329 $(eval $(call theme,bootstrap,Bootstrap Theme (default),,,1))
331 $(eval $(call theme,freifunk-bno,Freifunk Berlin Nordost Theme,\
332 Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
334 $(eval $(call theme,freifunk-generic,Freifunk Generic Theme,\
335 Manuel Munz <freifunk-at-somakoma-dot-de>))
339 define Package/luci-i18n-$(1)
342 TITLE:=LuCI - Lua Configuration Interface
343 URL:=http://luci.subsignal.org/
344 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
345 SUBMENU:=5. Translations
346 TITLE:=$(if $(2),$(2),$(1))
349 define Package/luci-i18n-$(1)/install
350 $(call Package/luci/install/template,$$(1),i18n/$(1))
353 ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
354 LUCI_SELECTED_MODULES+=i18n/$(1)
357 LUCI_BUILD_PACKAGES += luci-i18n-$(1)
360 $(eval $(call translation,german,German))
361 $(eval $(call translation,english,English))
362 $(eval $(call translation,french,French (by Florian Fainelli)))
363 $(eval $(call translation,italian,Italian (by Matteo Croce)))
364 $(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
365 $(eval $(call translation,portuguese-brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
366 $(eval $(call translation,chinese,Chinese (by Chinese Translators)))
367 $(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
368 $(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
369 $(eval $(call translation,catalan,Catalan (by Eduard Duran)))
370 $(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
371 $(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
372 $(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
373 $(eval $(call translation,malay,Malay (by Teow Wai Chet)))
374 $(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
375 $(eval $(call translation,hebrew,Hebrew))
376 $(eval $(call translation,romanian,Romanian))
377 $(eval $(call translation,ukrainian,Ukrainian))
378 $(eval $(call translation,hungarian,Hungarian))
379 $(eval $(call translation,polish,Polish))
384 define Package/luci$(if $(1),-$(1))
387 TITLE:=LuCI - Lua Configuration Interface
388 URL:=http://luci.subsignal.org/
389 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
390 SUBMENU:=1. Collections
391 TITLE:=$(if $(2),$(2),LuCI $(if $(1),$(1),general) collection)
392 $(if $(3),DEPENDS:=$(3))
395 define Package/luci$(if $(1),-$(1))/install
399 LUCI_BUILD_PACKAGES += luci$(if $(1),-$(1))
402 $(eval $(call collection,,\
403 Standard OpenWrt set including full admin with ppp support and the \
404 default OpenWrt theme,\
405 +uhttpd +uhttpd-mod-ubus +luci-mod-admin-full +luci-theme-bootstrap \
406 +luci-app-firewall +luci-proto-core +luci-proto-ppp +libiwinfo-lua))
408 $(eval $(call collection,ssl,\
409 Standard OpenWrt set with HTTPS support,\
410 +luci +libustream-cyassl +px5g))
412 $(eval $(call collection,light,\
413 Minimum package set using only admin mini and the standard theme,\
414 +uhttpd +luci-mod-admin-mini +luci-theme-openwrt @BROKEN))
418 PKG_CONFIG_DEPENDS=$(patsubst %,CONFIG_PACKAGE_%,$(LUCI_BUILD_PACKAGES))
420 include $(INCLUDE_DIR)/package.mk
423 @if [ ! -x $(LUCI_TOPDIR)/build/mkrevision.sh ]; then \
424 echo "*** Repository layout changed!" >&2; \
425 echo "*** Please change the LuCI url in feeds.conf to http://svn.luci.subsignal.org/luci/trunk and reinstall the feed with" >&2; \
426 echo "*** ./scripts/feeds update luci; ./scripts/feeds install -a -p luci" >&2; \
429 mkdir -p $(PKG_BUILD_DIR)
430 $(TAR) c -C $(LUCI_TOPDIR) . \
431 --exclude=.pc --exclude=.svn --exclude=.git \
432 --exclude='boa-0*' --exclude='*.o' --exclude='*.so' \
434 tar x -C $(PKG_BUILD_DIR)/
435 $(call Build/Prepare/Default)
438 define Build/Configure
442 MODULES="$(LUCI_SELECTED_MODULES)" \
443 LUA_TARGET="$(LUA_TARGET)" \
444 LUA_SHLIBS="-llua -lm -ldl -lcrypt" \
445 CFLAGS="$(TARGET_CFLAGS) $(LUCI_CFLAGS) -I$(STAGING_DIR)/usr/include" \
446 LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
447 NIXIO_TLS="$(NIXIO_TLS)" OS="Linux"
450 $(foreach b,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))