1 include $(TOPDIR)/rules.mk
6 USELOCAL:=$(shell grep luci ../../../.project 2>/dev/null >/dev/null && echo 1)
15 PKG_SOURCE_URL:=http://svn.luci.subsignal.org/luci/$(PKG_BRANCH)
17 PKG_REV:=$(shell LC_ALL=C svn info $(CURDIR) | sed -ne's/^Revision: //p')
18 PKG_VERSION:=0.10+svn$(PKG_REV)
20 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
21 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
23 PKG_SOURCE_VERSION:=$(PKG_REV)
26 PKG_BUILD_DEPENDS:=$(if $(STAGING_DIR_ROOT),lua/host)
27 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
28 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
32 PKG_SELECTED_MODULES:=
34 ifeq ($(BOARD),brcm-2.4)
35 MAKE_FLAGS += CRAP="1"
41 include $(INCLUDE_DIR)/package.mk
45 mkdir -p $(PKG_BUILD_DIR)
46 $(TAR) c -C ../../../ . \
47 --exclude=.pc --exclude=.svn --exclude=.git \
48 --exclude='boa-0*' --exclude='*.o' --exclude='*.so' \
50 tar x -C $(PKG_BUILD_DIR)/
54 define Build/Configure
58 MODULES="$(PKG_SELECTED_MODULES)" \
59 LUA_TARGET="$(LUA_TARGET)" \
60 LUA_SHLIBS="-llua -lm -ldl -lcrypt" \
61 CFLAGS="$(TARGET_CFLAGS) $(LUCI_CFLAGS) -I$(STAGING_DIR)/usr/include" \
62 LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
63 NIXIO_TLS="$(NIXIO_TLS)" OS="Linux"
68 define Package/luci/libtemplate
71 TITLE:=LuCI - Lua Configuration Interface
72 URL:=http://luci.freifunk-halle.net/
73 MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
74 SUBMENU:=Internal Libraries
78 define Package/luci/webservertemplate
79 $(call Package/luci/libtemplate)
83 define Package/luci/fftemplate
84 $(call Package/luci/libtemplate)
86 DEPENDS:=+luci-mod-freifunk
89 define Package/luci/i18ntemplate
90 $(call Package/luci/libtemplate)
95 define Package/luci/thtemplate
96 $(call Package/luci/libtemplate)
101 define Package/luci/maintemplate
102 $(call Package/luci/libtemplate)
106 define Package/luci/webtemplate
107 $(call Package/luci/libtemplate)
111 define Package/luci/collectiontemplate
112 $(call Package/luci/libtemplate)
117 define Package/luci/install/template
118 $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
119 $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
125 define Package/luci-core
126 $(call Package/luci/libtemplate)
127 DEPENDS:=+lua +luci-nixio
128 TITLE:=LuCI core libraries
131 define Package/luci-core/install
132 $(call Package/luci/install/template,$(1),libs/core)
133 $(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
135 "$(OPENWRTVERSION)" \
140 define Package/luci-core/config
142 prompt "Build Target"
143 default PACKAGE_luci-core_source
145 config PACKAGE_luci-core_compile
148 config PACKAGE_luci-core_stripped
151 config PACKAGE_luci-core_source
157 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
161 ifneq ($(CONFIG_PACKAGE_luci-core_stripped),)
165 ifneq ($(CONFIG_PACKAGE_luci-core_zipped),)
169 ifneq ($(CONFIG_PACKAGE_luci-core),)
170 PKG_SELECTED_MODULES+=libs/core
173 BUILD_PACKAGES += luci-core
178 define Package/luci-$(1)
179 $(call Package/luci/libtemplate)
180 TITLE:=$(if $(2),$(2),LuCI $(1) library)
181 $(if $(3),DEPENDS:=$(3))
184 define Package/luci-$(1)/install
185 $(call Package/luci/install/template,$$(1),libs/$(1))
186 $(call Package/luci-$(1)/extra-install)
189 ifneq ($(CONFIG_PACKAGE_luci-$(1)),)
190 PKG_SELECTED_MODULES+=libs/$(1)
193 BUILD_PACKAGES += luci-$(1)
196 define Package/luci-lucid/extra-install
197 $(call Package/luci/install/template,$(1),libs/lucid-http)
200 define Package/luci-web/conffiles
204 define Package/luci-nixio/config
206 prompt "TLS Provider"
207 default PACKAGE_luci-nixio_notls
209 config PACKAGE_luci-nixio_notls
212 config PACKAGE_luci-nixio_axtls
213 bool "Builtin (axTLS)"
215 config PACKAGE_luci-nixio_cyassl
217 select PACKAGE_libcyassl
219 config PACKAGE_luci-nixio_openssl
221 select PACKAGE_libopenssl
228 ifneq ($(CONFIG_PACKAGE_luci-nixio_axtls),)
232 ifneq ($(CONFIG_PACKAGE_luci-nixio_openssl),)
236 ifneq ($(CONFIG_PACKAGE_luci-nixio_cyassl),)
238 LUCI_CFLAGS+=-I$(STAGING_DIR)/usr/include/cyassl
242 $(eval $(call library,fastindex,Fastindex indexing module))
243 $(eval $(call library,httpclient,HTTP(S) client library,+luci-web +luci-nixio))
244 $(eval $(call library,ipkg,LuCI IPKG/OPKG call abstraction library))
245 $(eval $(call library,json,LuCI JSON library))
246 $(eval $(call library,lmo,LuCI LMO I18N library))
247 $(eval $(call library,luanet,LuCI luanet library,+libiw))
248 $(eval $(call library,lucid,LuCId Full-Stack Webserver,+luci-nixio +luci-web +luci-px5g))
249 $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-nixio_openssl:libopenssl +PACKAGE_luci-nixio_cyassl:libcyassl))
250 $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-nixio))
251 $(eval $(call library,sys,LuCI Linux/POSIX system library,+libiwinfo))
252 $(eval $(call library,web,MVC Webframework,+luci-sys +luci-nixio +luci-core +luci-sgi-cgi +luci-lmo))
253 $(eval $(call library,uvl,UVL - UCI Validation Layer,+luci-sys +luci-core))
256 ### Community Packages ###
257 define Package/luci-freifunk-community
258 $(call Package/luci/fftemplate)
259 TITLE:=Freifunk Community Meta-Package
261 +luci-web +luci-app-splash \
262 +luci-app-ffwizard-leipzig \
264 +PACKAGE_luci-freifunk-community:olsrd-luci +PACKAGE_luci-freifunk-community:olsrd-luci-mod-dyn-gw-plain \
265 +PACKAGE_luci-freifunk-community:olsrd-luci-mod-txtinfo +PACKAGE_luci-freifunk-community:olsrd-luci-mod-nameservice \
266 +PACKAGE_luci-freifunk-community:olsrd-luci-mod-watchdog +PACKAGE_luci-freifunk-community:kmod-tun \
267 +PACKAGE_luci-freifunk-community:ip +PACKAGE_luci-freifunk-community:freifunk-watchdog +luci-app-olsr
270 define Package/luci-freifunk-community/install
271 $(call Package/luci/install/template,$(1),applications/freifunk-community)
274 ifneq ($(CONFIG_PACKAGE_luci-freifunk-community),)
275 PKG_SELECTED_MODULES+=applications/freifunk-community
278 BUILD_PACKAGES += luci-freifunk-community
283 define Package/luci-$(1)
284 $(call Package/luci/webtemplate)
285 TITLE:=$(if $(2),$(2),LuCI luci-$(1) module)
286 $(if $(3),DEPENDS+=$(3))
289 define Package/luci-$(1)/install
290 $(call Package/luci/install/template,$$(1),modules/admin-core)
291 $(call Package/luci-$(1)/extra-install)
294 ifneq ($(CONFIG_PACKAGE_luci-$(1)),)
295 PKG_SELECTED_MODULES+=modules/$(1)
298 BUILD_PACKAGES += luci-$(1)
302 define Package/luci-admin-core/extra-install
303 touch $(1)/etc/init.d/luci_fixtime || true
306 define Package/luci-mod-freifunk/conffiles
310 $(eval $(call module,admin-core,Web UI Core module,+luci-web +luci-i18n-english))
311 $(eval $(call module,admin-mini,LuCI Essentials - stripped down and user-friendly,+luci-admin-core))
312 $(eval $(call module,admin-full,LuCI Administration - full-featured for full control,+luci-admin-core +luci-ipkg))
313 $(eval $(call module,admin-rpc,LuCI RPC - JSON-RPC API,+luci-json))
314 $(eval $(call module,mod-freifunk,LuCI Freifunk module,+luci-admin-full +luci-json +PACKAGE_luci-mod-freifunk:freifunk-firewall))
316 $(eval $(call module,niu,NIU - Next Generation Interface,+luci-admin-core @BROKEN))
321 define Package/luci-app-$(1)
322 $(call Package/luci/webtemplate)
323 TITLE:=$(if $(2),$(2),LuCI $(1) application)
324 $(if $(3),DEPENDS:=$(3))
327 define Package/luci-app-$(1)/install
328 $(call Package/luci/install/template,$$(1),applications/luci-$(1))
331 ifneq ($(CONFIG_PACKAGE_luci-app-$(1)),)
332 PKG_SELECTED_MODULES+=applications/luci-$(1)
335 BUILD_PACKAGES += luci-app-$(1)
338 define Package/luci-app-splash/conffiles
339 /etc/config/luci_splash
342 define Package/luci-app-statistics/conffiles
343 /etc/config/luci_statistics
346 define Package/luci-app-diag-devinfo/conffiles
347 /etc/config/luci_devinfo
351 $(eval $(call application,ffwizard-leipzig,Freifunk Leipzig configuration wizard))
353 $(eval $(call application,siitwizard,SIIT IPv4-over-IPv6 configuration wizard,\
354 +luci-admin-core +PACKAGE_luci-app-siitwizard:kmod-siit))
356 $(eval $(call application,firewall,Firmware and Portforwarding application,\
357 +luci-admin-core +PACKAGE_luci-app-firewall:firewall))
359 $(eval $(call application,olsr,OLSR configuration and status module,\
360 +luci-admin-full +PACKAGE_luci-app-olsr:olsrd-luci +PACKAGE_luci-app-olsr:olsrd-luci-mod-txtinfo))
362 $(eval $(call application,qos,Quality of Service configuration module,\
363 +luci-admin-core +PACKAGE_luci-app-qos:qos-scripts))
365 $(eval $(call application,splash,Freifunk DHCP-Splash application,\
366 +PACKAGE_luci-app-splash:luci-nixio +PACKAGE_luci-app-splash:tc \
367 +PACKAGE_luci-app-splash:kmod-sched +PACKAGE_luci-app-splash:iptables-mod-nat-extra \
368 +PACKAGE_luci-app-splash:iptables-mod-ipopt))
370 $(eval $(call application,statistics,LuCI Statistics Application,\
371 +luci-admin-full +PACKAGE_luci-app-statistics:collectd \
372 +PACKAGE_luci-app-statistics:rrdtool1 \
373 +PACKAGE_luci-app-statistics:collectd-mod-rrdtool \
374 +PACKAGE_luci-app-statistics:collectd-mod-wireless \
375 +PACKAGE_luci-app-statistics:collectd-mod-interface \
376 +PACKAGE_luci-app-statistics:collectd-mod-load))
379 $(eval $(call application,diag-core,LuCI Diagnostics Tools (Core),\
382 $(eval $(call application,diag-devinfo,LuCI Diagnostics Tools (Device Info),\
383 +PACKAGE_luci-app-diag-devinfo:luci-app-diag-core \
384 +PACKAGE_luci-app-diag-devinfo:smap \
385 +PACKAGE_luci-app-diag-devinfo:netdiscover \
386 +PACKAGE_luci-app-diag-devinfo:mac-to-devinfo \
387 +PACKAGE_luci-app-diag-devinfo:httping \
388 +PACKAGE_luci-app-diag-devinfo:smap-to-devinfo \
389 +PACKAGE_luci-app-diag-devinfo:netdiscover-to-devinfo))
391 $(eval $(call application,voice-core,LuCI Voice Software (Core),\
394 $(eval $(call application,voide-diag,LuCI Voice Software (Diagnostics),\
395 +PACKAGE_luci-app-voice-diag:luci-app-voice-core \
396 +PACKAGE_luci-app-voice-diag:luci-app-diag-devinfo))
399 $(eval $(call application,upnp,Universal Plug & Play configuration module,\
400 +luci-admin-core +PACKAGE_luci-app-upnp:miniupnpd))
402 $(eval $(call application,ntpc,NTP time synchronisation configuration module,\
403 +luci-admin-core +PACKAGE_luci-app-ntpc:ntpclient))
405 $(eval $(call application,ddns,Dynamic DNS configuration module,\
406 +luci-admin-core +PACKAGE_luci-app-ddns:ddns-scripts))
408 $(eval $(call application,samba,Network Shares - Samba SMB/CIFS module,\
409 +luci-admin-full +PACKAGE_luci-app-samba:samba3))
411 $(eval $(call application,mmc-over-gpio,MMC-over-GPIO configuration module,\
412 +luci-admin-full +PACKAGE_luci-app-mmc-over-gpio:kmod-mmc-over-gpio))
414 $(eval $(call application,p910nd,p910nd - Printer server module,\
415 +luci-admin-full +PACKAGE_luci-app-p910nd:p910nd))
417 $(eval $(call application,ushare,uShare - UPnP A/V & DLNA Media Server,\
418 +luci-admin-full +PACKAGE_luci-app-ushare:ushare))
420 $(eval $(call application,hd-idle,Hard Disk Idle Spin-Down module,\
421 +luci-admin-full +PACKAGE_luci-app-hd-idle:hd-idle))
423 $(eval $(call application,tinyproxy,Tinyproxy - HTTP(S)-Proxy configuration,\
424 +luci-admin-full +PACKAGE_luci-app-tinyproxy:tinyproxy))
426 $(eval $(call application,initmgr,LuCI Initscript Management,\
429 $(eval $(call application,livestats,LuCI Realtime Statistics,\
430 +luci-admin-core +luci-admin-rpc))
432 $(eval $(call application,asterisk,LuCI Support for Asterisk PBX,\
433 @BROKEN +luci-admin-core +PACKAGE_luci-app-asterisk:asterisk14-xip-core))
435 $(eval $(call application,polipo,LuCI Support for the Polipo Proxy,\
436 +luci-admin-core +PACKAGE_luci-app-polipo:polipo))
438 $(eval $(call application,openvpn,LuCI Support for OpenVPN,\
439 +luci-admin-core +PACKAGE_luci-app-openvpn:openvpn))
441 $(eval $(call application,p2pblock,LuCI Support for the Freifunk P2P-Block addon,\
442 +luci-admin-core +luci-app-firewall +PACKAGE_luci-app-p2pblock:freifunk-p2pblock))
444 $(eval $(call application,multiwan,LuCI Support for the OpenWrt MultiWAN agent,\
445 +luci-admin-core +luci-app-firewall +PACKAGE_luci-app-multiwan:multiwan))
447 $(eval $(call application,wol,LuCI Support for Wake-on-LAN,\
448 +luci-admin-core +PACKAGE_luci-app-wol:etherwake))
450 $(eval $(call application,vnstat,LuCI Support for VnStat,\
451 +luci-admin-core +PACKAGE_luci-app-vnstat:vnstat \
452 +PACKAGE_luci-app-vnstat:vnstati))
455 ### Server Gateway Interfaces ###
457 define Package/luci-sgi-$(1)
458 $(call Package/luci/webservertemplate)
459 TITLE:=$(if $(2),$(2),LuCI $(1) server gateway interface)
460 $(if $(3),DEPENDS:=$(3))
463 define Package/luci-sgi-$(1)/install
464 $(call Package/luci/install/template,$$(1),libs/sgi-$(1))
467 ifneq ($(CONFIG_PACKAGE_luci-sgi-$(1)),)
468 PKG_SELECTED_MODULES+=libs/sgi-$(1)
471 BUILD_PACKAGES += luci-sgi-$(1)
474 $(eval $(call sgi,cgi,CGI Gateway behind existing Webserver))
475 $(eval $(call sgi,uhttpd,Binding for the uHTTPd server,+uhttpd +uhttpd-mod-lua))
480 define Package/luci-theme-$(1)
481 $(call Package/luci/thtemplate)
482 TITLE:=$(if $(2),$(2),LuCI $(1) theme)
483 $(if $(3),MAINTAINER:=$(3))
484 $(if $(4),DEPENDS:=$(4))
485 $(if $(5),DEFAULT:=y if PACKAGE_luci-core)
488 define Package/luci-theme-$(1)/install
489 $(call Package/luci/install/template,$$(1),themes/$(1))
492 ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
493 PKG_SELECTED_MODULES+=themes/$(1)
496 BUILD_PACKAGES += luci-theme-$(1)
499 $(eval $(call theme,base,Common base for all themes,\
500 LuCI developers <luci-at-lists-dot-subsignal.org>))
502 $(eval $(call theme,openwrt,OpenWrt.org (default),\
503 LuCI developers <luci-at-lists-dot-subsignal.org>,\
504 +luci-theme-base luci-core,1))
506 $(eval $(call theme,openwrtlight,OpenWrt.org - light variant without images,\
507 LuCI developers <luci-at-lists-dot-subsignal.org>,+luci-theme-base))
509 $(eval $(call theme,fledermaus,Fledermaus Theme,\
510 LuCI developers <luci-at-lists-dot-subsignal.org>,+luci-web))
512 $(eval $(call theme,freifunk,alternative Freifunk Theme,\
513 Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>,+luci-web))
515 $(eval $(call theme,freifunk-bno,Freifunk Berlin Nordost Theme,\
516 Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>,+luci-web))
518 $(eval $(call theme,freifunk-hannover,Freifunk Hannover Theme,\
519 Mikolas Bingemer <mickey-at-freifunk-hannover-dot-de>,+luci-web))
524 define Package/luci-i18n-$(1)
525 $(call Package/luci/i18ntemplate)
526 TITLE:=$(if $(2),$(2),$(1))
529 define Package/luci-i18n-$(1)/install
530 $(call Package/luci/install/template,$$(1),i18n/$(1))
533 ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
534 PKG_SELECTED_MODULES+=i18n/$(1)
537 BUILD_PACKAGES += luci-i18n-$(1)
540 $(eval $(call translation,german,German))
541 $(eval $(call translation,english,English))
542 $(eval $(call translation,french,French (by Florian Fainelli)))
543 $(eval $(call translation,italian,Italian (by Matteo Croce)))
544 $(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
545 $(eval $(call translation,portuguese_brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
546 $(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
547 $(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
548 $(eval $(call translation,catalan,Catalan (by Eduard Duran)))
549 $(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
550 $(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
551 $(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
552 $(eval $(call translation,malay,Malay (by Teow Wai Chet)))
553 $(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
559 $(call Package/luci/collectiontemplate)
560 TITLE:=$(if $(2),$(2),LuCI $(1) collection)
561 $(if $(3),DEPENDS:=$(3))
564 define Package/$(1)/install
568 BUILD_PACKAGES += $(1)
571 $(eval $(call collection,luci,\
572 Standard OpenWrt set including full and mini admin and the standard theme,\
573 +uhttpd +luci-admin-full +luci-admin-mini +luci-theme-openwrt \
574 +luci-app-firewall +luci-app-initmgr))
576 $(eval $(call collection,luci-ssl,\
577 Standard OpenWrt set with HTTPS support,\
578 +uhttpd +uhttpd-mod-tls +px5g +luci-admin-full +luci-admin-mini \
579 +luci-theme-openwrt +luci-app-firewall +luci-app-initmgr))
581 $(eval $(call collection,luci-medium,\
582 Medium package set using only admin full and a theme without graphics,\
583 +uhttpd +luci-admin-full +luci-theme-openwrtlight))
585 $(eval $(call collection,luci-light,\
586 Minimum package set using only admin mini and a theme without graphics,\
587 +uhttpd +luci-admin-mini +luci-theme-openwrtlight))
590 $(foreach b,$(BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))