1 include $(TOPDIR)/rules.mk
6 USELOCAL:=$(shell grep luci ../../../.project 2>/dev/null >/dev/null && echo 1)
17 PKG_SOURCE_URL:=http://svn.luci.subsignal.org/luci/$(PKG_BRANCH)
19 PKG_REV:=$(shell LC_ALL=C svn info $(CURDIR) | sed -ne's/^Revision: //p')
20 PKG_VERSION:=0.10+svn$(PKG_REV)
22 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
23 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
25 PKG_SOURCE_VERSION:=$(PKG_REV)
28 PKG_BUILD_DEPENDS:=$(if $(STAGING_DIR_ROOT),lua/host)
29 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
30 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
35 LUCI_SELECTED_MODULES:=
37 ifeq ($(BOARD),brcm-2.4)
38 MAKE_FLAGS += CRAP="1"
42 include $(INCLUDE_DIR)/package.mk
46 mkdir -p $(PKG_BUILD_DIR)
47 $(TAR) c -C ../../../ . \
48 --exclude=.pc --exclude=.svn --exclude=.git \
49 --exclude='boa-0*' --exclude='*.o' --exclude='*.so' \
51 tar x -C $(PKG_BUILD_DIR)/
55 define Build/Configure
59 MODULES="$(LUCI_SELECTED_MODULES)" \
60 LUA_TARGET="$(LUA_TARGET)" \
61 LUA_SHLIBS="-llua -lm -ldl -lcrypt" \
62 CFLAGS="$(TARGET_CFLAGS) $(LUCI_CFLAGS) -I$(STAGING_DIR)/usr/include" \
63 LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
64 NIXIO_TLS="$(NIXIO_TLS)" OS="Linux"
68 define Package/luci/install/template
69 $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
70 $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
75 define Package/luci-lib-core
78 TITLE:=LuCI - Lua Configuration Interface
79 URL:=http://luci.subsignal.org/
80 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
82 DEPENDS:=+lua +libuci-lua
83 TITLE:=LuCI core libraries
86 define Package/luci-lib-core/install
87 $(call Package/luci/install/template,$(1),libs/core)
88 $(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
95 define Package/luci-lib-core/config
98 default PACKAGE_luci-lib-core_source
100 config PACKAGE_luci-lib-core_compile
103 config PACKAGE_luci-lib-core_stripped
106 config PACKAGE_luci-lib-core_source
112 ifneq ($(CONFIG_PACKAGE_luci-lib-core_compile),)
116 ifneq ($(CONFIG_PACKAGE_luci-lib-core_stripped),)
120 ifneq ($(CONFIG_PACKAGE_luci-lib-core_zipped),)
124 ifneq ($(CONFIG_PACKAGE_luci-lib-core),)
125 LUCI_SELECTED_MODULES+=libs/core
128 LUCI_BUILD_PACKAGES += luci-lib-core
133 define Package/luci-lib-$(1)
136 TITLE:=LuCI - Lua Configuration Interface
137 URL:=http://luci.subsignal.org/
138 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
140 TITLE:=$(if $(2),$(2),LuCI $(1) library)
141 $(if $(3),DEPENDS:=+luci-lib-core $(3))
144 define Package/luci-lib-$(1)/install
145 $(call Package/luci/install/template,$$(1),libs/$(1))
146 $(call Package/luci-lib-$(1)/extra-install)
149 ifneq ($(CONFIG_PACKAGE_luci-lib-$(1)),)
150 LUCI_SELECTED_MODULES+=libs/$(1)
153 LUCI_BUILD_PACKAGES += luci-lib-$(1)
156 define Package/luci-lib-web/conffiles
160 define Package/luci-lib-nixio/config
162 prompt "TLS Provider"
163 default PACKAGE_luci-lib-nixio_notls
165 config PACKAGE_luci-lib-nixio_notls
168 config PACKAGE_luci-lib-nixio_axtls
169 bool "Builtin (axTLS)"
171 config PACKAGE_luci-lib-nixio_cyassl
173 select PACKAGE_libcyassl
175 config PACKAGE_luci-lib-nixio_openssl
177 select PACKAGE_libopenssl
184 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_axtls),)
188 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_openssl),)
192 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_cyassl),)
194 LUCI_CFLAGS+=-I$(STAGING_DIR)/usr/include/cyassl
198 $(eval $(call library,fastindex,Fastindex indexing module))
199 $(eval $(call library,httpclient,HTTP(S) client library,+luci-lib-web +luci-lib-nixio))
200 $(eval $(call library,ipkg,LuCI IPKG/OPKG call abstraction library))
201 $(eval $(call library,json,LuCI JSON library))
202 $(eval $(call library,lmo,LuCI LMO I18N library))
203 $(eval $(call library,lucid,LuCId Full-Stack Webserver,+luci-lib-nixio +luci-lib-web +luci-lib-px5g))
204 $(eval $(call library,lucid-http,LuCId HTTP Backend,+luci-lib-lucid))
205 $(eval $(call library,lucid-rpc,LuCId RPC Backend,+luci-lib-lucid))
206 $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-lib-nixio_openssl:libopenssl +PACKAGE_luci-lib-nixio_cyassl:libcyassl))
207 $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-lib-nixio))
208 $(eval $(call library,sys,LuCI Linux/POSIX system library,+libiwinfo))
209 $(eval $(call library,web,MVC Webframework,+luci-lib-sys +luci-lib-nixio +luci-lib-core +luci-sgi-cgi +luci-lib-lmo))
210 $(eval $(call library,uvl,UVL - UCI Validation Layer,+luci-lib-sys +luci-lib-core))
213 ### Community Packages ###
214 define Package/luci-mod-freifunk-community
217 TITLE:=LuCI - Lua Configuration Interface
218 URL:=http://luci.subsignal.org/
219 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
221 TITLE:=Freifunk Community Meta-Package
223 +luci-lib-web +luci-app-splash \
224 +luci-app-ffwizard-leipzig \
226 +PACKAGE_luci-mod-freifunk-community:olsrd-luci +PACKAGE_luci-mod-freifunk-community:olsrd-luci-mod-dyn-gw-plain \
227 +PACKAGE_luci-mod-freifunk-community:olsrd-luci-mod-txtinfo +PACKAGE_luci-mod-freifunk-community:olsrd-luci-mod-nameservice \
228 +PACKAGE_luci-mod-freifunk-community:olsrd-luci-mod-watchdog +PACKAGE_luci-mod-freifunk-community:kmod-tun \
229 +PACKAGE_luci-mod-freifunk-community:ip +PACKAGE_luci-mod-freifunk-community:freifunk-watchdog +luci-app-olsr
232 define Package/luci-mod-freifunk-community/install
233 $(call Package/luci/install/template,$(1),applications/freifunk-community)
236 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk-community),)
237 LUCI_SELECTED_MODULES+=applications/freifunk-community
240 LUCI_BUILD_PACKAGES += luci-mod-freifunk-community
245 define Package/luci-mod-$(1)
248 TITLE:=LuCI - Lua Configuration Interface
249 URL:=http://luci.subsignal.org/
250 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
252 TITLE:=$(if $(2),$(2),LuCI $(1) module)
253 $(if $(3),DEPENDS+=$(3))
256 define Package/luci-mod-$(1)/install
257 $(call Package/luci/install/template,$$(1),modules/$(1))
258 $(call Package/luci-mod-$(1)/extra-install)
261 ifneq ($(CONFIG_PACKAGE_luci-mod-$(1)),)
262 LUCI_SELECTED_MODULES+=modules/$(1)
265 LUCI_BUILD_PACKAGES += luci-mod-$(1)
269 define Package/luci-mod-admin-core/extra-install
270 touch $(1)/etc/init.d/luci_fixtime || true
273 define Package/luci-mod-freifunk/conffiles
277 $(eval $(call module,admin-core,Web UI Core module,+luci-lib-web +luci-i18n-english))
278 $(eval $(call module,admin-mini,LuCI Essentials - stripped down and user-friendly,+luci-mod-admin-core))
279 $(eval $(call module,admin-full,LuCI Administration - full-featured for full control,+luci-mod-admin-core +luci-lib-ipkg))
280 $(eval $(call module,rpc,LuCI RPC - JSON-RPC API,+luci-lib-json))
281 $(eval $(call module,freifunk,LuCI Freifunk module,+luci-mod-admin-full +luci-lib-json +PACKAGE_luci-mod-freifunk:freifunk-firewall))
282 $(eval $(call module,niu,NIU - Next Generation Interface,+luci-mod-admin-core @BROKEN))
287 define Package/luci-app-$(1)
290 TITLE:=LuCI - Lua Configuration Interface
291 URL:=http://luci.subsignal.org/
292 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
293 SUBMENU:=Applications
294 TITLE:=$(if $(2),$(2),LuCI $(1) application)
295 DEPENDS:=+luci-mod-admin-core $(3)
298 define Package/luci-app-$(1)/install
299 $(call Package/luci/install/template,$$(1),applications/luci-$(1))
302 ifneq ($(CONFIG_PACKAGE_luci-app-$(1)),)
303 LUCI_SELECTED_MODULES+=applications/luci-$(1)
306 LUCI_BUILD_PACKAGES += luci-app-$(1)
309 define Package/luci-app-splash/conffiles
310 /etc/config/luci_splash
311 /usr/lib/luci-splash/splashtext.html
314 define Package/luci-app-statistics/conffiles
315 /etc/config/luci_statistics
318 define Package/luci-app-diag-devinfo/conffiles
319 /etc/config/luci_devinfo
323 $(eval $(call application,ffwizard-leipzig,Freifunk Leipzig configuration wizard))
325 $(eval $(call application,siitwizard,SIIT IPv4-over-IPv6 configuration wizard,\
326 +PACKAGE_luci-app-siitwizard:kmod-siit))
328 $(eval $(call application,firewall,Firmware and Portforwarding application,\
329 +PACKAGE_luci-app-firewall:firewall))
331 $(eval $(call application,olsr,OLSR configuration and status module,\
332 +luci-mod-admin-full +PACKAGE_luci-app-olsr:olsrd-luci +PACKAGE_luci-app-olsr:olsrd-luci-mod-txtinfo))
334 $(eval $(call application,qos,Quality of Service configuration module,\
335 +PACKAGE_luci-app-qos:qos-scripts))
337 $(eval $(call application,splash,Freifunk DHCP-Splash application,\
338 +luci-lib-nixio +PACKAGE_luci-app-splash:tc \
339 +PACKAGE_luci-app-splash:kmod-sched +PACKAGE_luci-app-splash:iptables-mod-nat-extra \
340 +PACKAGE_luci-app-splash:iptables-mod-ipopt))
342 $(eval $(call application,statistics,LuCI Statistics Application,\
343 +luci-mod-admin-full +PACKAGE_luci-app-statistics:collectd \
344 +PACKAGE_luci-app-statistics:rrdtool1 \
345 +PACKAGE_luci-app-statistics:collectd-mod-rrdtool \
346 +PACKAGE_luci-app-statistics:collectd-mod-wireless \
347 +PACKAGE_luci-app-statistics:collectd-mod-interface \
348 +PACKAGE_luci-app-statistics:collectd-mod-load))
351 $(eval $(call application,diag-core,LuCI Diagnostics Tools (Core)))
353 $(eval $(call application,diag-devinfo,LuCI Diagnostics Tools (Device Info),\
354 +luci-app-diag-core \
355 +PACKAGE_luci-app-diag-devinfo:smap \
356 +PACKAGE_luci-app-diag-devinfo:netdiscover \
357 +PACKAGE_luci-app-diag-devinfo:mac-to-devinfo \
358 +PACKAGE_luci-app-diag-devinfo:httping \
359 +PACKAGE_luci-app-diag-devinfo:smap-to-devinfo \
360 +PACKAGE_luci-app-diag-devinfo:netdiscover-to-devinfo))
362 $(eval $(call application,voice-core,LuCI Voice Software (Core)))
364 $(eval $(call application,voice-diag,LuCI Voice Software (Diagnostics),\
365 +luci-app-voice-core +luci-app-diag-devinfo))
368 $(eval $(call application,upnp,Universal Plug & Play configuration module,\
369 +PACKAGE_luci-app-upnp:miniupnpd))
371 $(eval $(call application,ntpc,NTP time synchronisation configuration module,\
372 +PACKAGE_luci-app-ntpc:ntpclient))
374 $(eval $(call application,ddns,Dynamic DNS configuration module,\
375 +PACKAGE_luci-app-ddns:ddns-scripts))
377 $(eval $(call application,samba,Network Shares - Samba SMB/CIFS module,\
378 +luci-mod-admin-full +PACKAGE_luci-app-samba:samba3))
380 $(eval $(call application,mmc-over-gpio,MMC-over-GPIO configuration module,\
381 +luci-mod-admin-full +PACKAGE_luci-app-mmc-over-gpio:kmod-mmc-over-gpio))
383 $(eval $(call application,p910nd,p910nd - Printer server module,\
384 +luci-mod-admin-full +PACKAGE_luci-app-p910nd:p910nd))
386 $(eval $(call application,ushare,uShare - UPnP A/V & DLNA Media Server,\
387 +luci-mod-admin-full +PACKAGE_luci-app-ushare:ushare))
389 $(eval $(call application,hd-idle,Hard Disk Idle Spin-Down module,\
390 +luci-mod-admin-full +PACKAGE_luci-app-hd-idle:hd-idle))
392 $(eval $(call application,tinyproxy,Tinyproxy - HTTP(S)-Proxy configuration,\
393 +luci-mod-admin-full +PACKAGE_luci-app-tinyproxy:tinyproxy))
395 $(eval $(call application,initmgr,LuCI Initscript Management,\
396 +luci-mod-admin-full))
398 $(eval $(call application,livestats,LuCI Realtime Statistics,\
401 $(eval $(call application,polipo,LuCI Support for the Polipo Proxy,\
402 +PACKAGE_luci-app-polipo:polipo))
404 $(eval $(call application,openvpn,LuCI Support for OpenVPN,\
405 +PACKAGE_luci-app-openvpn:openvpn))
407 $(eval $(call application,p2pblock,LuCI Support for the Freifunk P2P-Block addon,\
408 +luci-app-firewall +PACKAGE_luci-app-p2pblock:freifunk-p2pblock))
410 $(eval $(call application,multiwan,LuCI Support for the OpenWrt MultiWAN agent,\
411 +luci-app-firewall +PACKAGE_luci-app-multiwan:multiwan))
413 $(eval $(call application,wol,LuCI Support for Wake-on-LAN,\
414 +PACKAGE_luci-app-wol:etherwake))
416 $(eval $(call application,vnstat,LuCI Support for VnStat,\
417 +PACKAGE_luci-app-vnstat:vnstat \
418 +PACKAGE_luci-app-vnstat:vnstati))
420 $(eval $(call application,radvd,LuCI Support for Radvd,\
421 +luci-mod-admin-full +PACKAGE_luci-app-radvd:radvd))
423 $(eval $(call application,lqtapifoss,Lantiq voip))
425 ### Server Gateway Interfaces ###
427 define Package/luci-sgi-$(1)
430 TITLE:=LuCI - Lua Configuration Interface
431 URL:=http://luci.subsignal.org/
432 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
433 SUBMENU:=Server Interfaces
434 TITLE:=$(if $(2),$(2),LuCI $(1) server gateway interface)
435 $(if $(3),DEPENDS:=$(3))
438 define Package/luci-sgi-$(1)/install
439 $(call Package/luci/install/template,$$(1),libs/sgi-$(1))
442 ifneq ($(CONFIG_PACKAGE_luci-sgi-$(1)),)
443 LUCI_SELECTED_MODULES+=libs/sgi-$(1)
446 LUCI_BUILD_PACKAGES += luci-sgi-$(1)
449 $(eval $(call sgi,cgi,CGI Gateway behind existing Webserver))
450 $(eval $(call sgi,uhttpd,Binding for the uHTTPd server,+uhttpd +uhttpd-mod-lua))
455 define Package/luci-theme-$(1)
458 TITLE:=LuCI - Lua Configuration Interface
459 URL:=http://luci.subsignal.org/
461 TITLE:=$(if $(2),$(2),LuCI $(1) theme)
462 MAINTAINER:=$(if $(3),$(3),LuCI Development Team <luci@lists.subsignal.org>)
463 DEPENDS:=$(if $(filter-out base,$(1)),+luci-theme-base) $(4)
464 $(if $(5),DEFAULT:=PACKAGE_luci-lib-core)
467 define Package/luci-theme-$(1)/install
468 $(call Package/luci/install/template,$$(1),themes/$(1))
471 ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
472 LUCI_SELECTED_MODULES+=themes/$(1)
475 LUCI_BUILD_PACKAGES += luci-theme-$(1)
478 $(eval $(call theme,base,Common base for all themes,,+luci-lib-web))
479 $(eval $(call theme,openwrt,OpenWrt.org (default),,,1))
480 $(eval $(call theme,fledermaus,Fledermaus Theme))
482 $(eval $(call theme,freifunk,alternative Freifunk Theme,\
483 Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
485 $(eval $(call theme,freifunk-bno,Freifunk Berlin Nordost Theme,\
486 Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
488 $(eval $(call theme,freifunk-hannover,Freifunk Hannover Theme,\
489 Mikolas Bingemer <mickey-at-freifunk-hannover-dot-de>))
491 $(eval $(call theme,freifunk-generic,Freifunk Generic Theme,\
492 Manuel Munz <freifunk-at-somakoma-dot-de>))
496 define Package/luci-i18n-$(1)
499 TITLE:=LuCI - Lua Configuration Interface
500 URL:=http://luci.subsignal.org/
501 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
502 SUBMENU:=Translations
503 TITLE:=$(if $(2),$(2),$(1))
506 define Package/luci-i18n-$(1)/install
507 $(call Package/luci/install/template,$$(1),i18n/$(1))
510 ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
511 LUCI_SELECTED_MODULES+=i18n/$(1)
514 LUCI_BUILD_PACKAGES += luci-i18n-$(1)
517 $(eval $(call translation,german,German))
518 $(eval $(call translation,english,English))
519 $(eval $(call translation,french,French (by Florian Fainelli)))
520 $(eval $(call translation,italian,Italian (by Matteo Croce)))
521 $(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
522 $(eval $(call translation,portuguese_brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
523 $(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
524 $(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
525 $(eval $(call translation,catalan,Catalan (by Eduard Duran)))
526 $(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
527 $(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
528 $(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
529 $(eval $(call translation,malay,Malay (by Teow Wai Chet)))
530 $(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
535 define Package/luci$(if $(1),-$(1))
538 TITLE:=LuCI - Lua Configuration Interface
539 URL:=http://luci.subsignal.org/
540 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
542 TITLE:=$(if $(2),$(2),LuCI $(if $(1),$(1),general) collection)
543 $(if $(3),DEPENDS:=$(3))
546 define Package/luci$(if $(1),-$(1))/install
550 LUCI_BUILD_PACKAGES += luci$(if $(1),-$(1))
553 $(eval $(call collection,,\
554 Standard OpenWrt set including full and mini admin and the standard theme,\
555 +uhttpd +luci-mod-admin-full +luci-theme-openwrt +luci-app-firewall \
558 $(eval $(call collection,ssl,\
559 Standard OpenWrt set with HTTPS support,\
560 +uhttpd +uhttpd-mod-tls +px5g +luci-mod-admin-full +luci-theme-openwrt \
561 +luci-app-firewall +luci-app-initmgr))
563 $(eval $(call collection,light,\
564 Minimum package set using only admin mini and the standard theme,\
565 +uhttpd +luci-mod-admin-mini +luci-theme-openwrt))
569 PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(LUCI_BUILD_PACKAGES))
570 $(foreach b,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))