f0029eb1e22d0775171d3e32ee4f6e3f5718a150
[project/luci.git] / contrib / package / luci / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_BRANCH:=trunk
4
5 ifeq ($(DUMP),)
6   USELOCAL:=$(shell grep luci ../../../.project 2>/dev/null >/dev/null && echo 1)
7 endif
8
9 PKG_NAME:=luci
10 PKG_RELEASE:=1
11
12 PKG_BUILD_PARALLEL:=0
13
14 ifeq ($(USELOCAL),1)
15   PKG_VERSION:=trunk+svn
16 else
17   PKG_SOURCE_URL:=http://svn.luci.subsignal.org/luci/$(PKG_BRANCH)
18   ifeq ($(DUMP),)
19     PKG_REV:=$(shell LC_ALL=C svn info $(CURDIR) | sed -ne's/^Revision: //p')
20     PKG_VERSION:=trunk+svn$(PKG_REV)
21   endif
22   PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
23   PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
24   PKG_SOURCE_PROTO:=svn
25   PKG_SOURCE_VERSION:=$(PKG_REV)
26 endif
27
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
31
32 LUA_TARGET:=source
33 LUCI_CFLAGS:=
34 LUCI_BUILD_PACKAGES:=
35 LUCI_SELECTED_MODULES:=
36
37 ifeq ($(BOARD),brcm-2.4)
38   MAKE_FLAGS += CRAP="1"
39 endif
40
41
42 ### Templates ###
43 define Package/luci/install/template
44         $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
45         $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
46 endef
47
48
49 ### Core package ###
50 define Package/luci-lib-core
51   SECTION:=luci
52   CATEGORY:=LuCI
53   TITLE:=LuCI - Lua Configuration Interface
54   URL:=http://luci.subsignal.org/
55   MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
56   SUBMENU:=8. Libraries
57   DEPENDS:=+lua +libuci-lua +libubus-lua
58   TITLE:=LuCI core libraries
59 endef
60
61 define Package/luci-lib-core/install
62         $(call Package/luci/install/template,$(1),libs/core)
63         $(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
64                 "OpenWrt Firmware" \
65                 "$(OPENWRTVERSION)" \
66                 "$(PKG_BRANCH)" \
67                 "$(PKG_VERSION)"
68 endef
69
70 define Package/luci-lib-core/config
71        choice
72                prompt "Build Target"
73                default PACKAGE_luci-lib-core_source
74
75        config PACKAGE_luci-lib-core_compile
76                bool "Precompiled"
77
78        config PACKAGE_luci-lib-core_stripped
79                bool "Stripped"
80
81        config PACKAGE_luci-lib-core_srcdiet
82                bool "Compressed Source"
83
84        config PACKAGE_luci-lib-core_source
85                bool "Full Source"
86
87        endchoice
88 endef
89
90 ifneq ($(CONFIG_PACKAGE_luci-lib-core_compile),)
91   LUA_TARGET:=compile
92 endif
93
94 ifneq ($(CONFIG_PACKAGE_luci-lib-core_stripped),)
95   LUA_TARGET:=strip
96 endif
97
98 ifneq ($(CONFIG_PACKAGE_luci-lib-core_srcdiet),)
99   LUA_TARGET:=diet
100 endif
101
102 ifneq ($(CONFIG_PACKAGE_luci-lib-core),)
103   LUCI_SELECTED_MODULES+=libs/core
104 endif
105
106 LUCI_BUILD_PACKAGES += luci-lib-core
107
108
109 ### Libraries ###
110 define library
111   define Package/luci-lib-$(1)
112     SECTION:=luci
113     CATEGORY:=LuCI
114     TITLE:=LuCI - Lua Configuration Interface
115     URL:=http://luci.subsignal.org/
116     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
117     SUBMENU:=8. Libraries
118     TITLE:=$(if $(2),$(2),LuCI $(1) library)
119     $(if $(3),DEPENDS:=+luci-lib-core $(3))
120   endef
121
122   define Package/luci-lib-$(1)/install
123         $(call Package/luci/install/template,$$(1),libs/$(1))
124         $(call Package/luci-lib-$(1)/extra-install)
125   endef
126
127   ifneq ($(CONFIG_PACKAGE_luci-lib-$(1)),)
128     LUCI_SELECTED_MODULES+=libs/$(1)
129   endif
130
131   LUCI_BUILD_PACKAGES += luci-lib-$(1)
132 endef
133
134 define Package/luci-lib-web/conffiles
135 /etc/config/luci
136 endef
137
138 define Package/luci-lib-nixio/config
139         choice
140                 prompt "TLS Provider"
141                 default PACKAGE_luci-lib-nixio_notls
142
143                 config PACKAGE_luci-lib-nixio_notls
144                         bool "Disabled"
145
146                 config PACKAGE_luci-lib-nixio_axtls
147                         bool "Builtin (axTLS)"
148
149                 config PACKAGE_luci-lib-nixio_cyassl
150                         bool "CyaSSL"
151                         select PACKAGE_libcyassl
152
153                 config PACKAGE_luci-lib-nixio_openssl
154                         bool "OpenSSL"
155                         select PACKAGE_libopenssl
156         endchoice
157 endef
158
159
160 NIXIO_TLS:=
161
162 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_axtls),)
163   NIXIO_TLS:=axtls
164 endif
165
166 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_openssl),)
167   NIXIO_TLS:=openssl
168 endif
169
170 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_cyassl),)
171   NIXIO_TLS:=cyassl
172   LUCI_CFLAGS+=-I$(STAGING_DIR)/usr/include/cyassl
173 endif
174
175
176 $(eval $(call library,fastindex,Fastindex indexing module,+PACKAGE_luci-lib-fastindex:liblua))
177 $(eval $(call library,httpclient,HTTP(S) client library,+luci-lib-web +luci-lib-nixio))
178 $(eval $(call library,ipkg,LuCI IPKG/OPKG call abstraction library))
179 $(eval $(call library,json,LuCI JSON library))
180 $(eval $(call library,lucid,LuCId Full-Stack Webserver,+luci-lib-nixio +luci-lib-web +luci-lib-px5g))
181 $(eval $(call library,lucid-http,LuCId HTTP Backend,+luci-lib-lucid))
182 $(eval $(call library,lucid-rpc,LuCId RPC Backend,+luci-lib-lucid))
183 $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-lib-nixio_openssl:libopenssl +PACKAGE_luci-lib-nixio_cyassl:libcyassl))
184 $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-lib-nixio))
185 $(eval $(call library,sys,LuCI Linux/POSIX system library))
186 $(eval $(call library,web,MVC Webframework,+luci-lib-sys +luci-lib-nixio +luci-lib-core +luci-sgi-cgi))
187
188
189 ### Protocols ###
190 define protocol
191   define Package/luci-proto-$(1)
192     SECTION:=luci
193     CATEGORY:=LuCI
194     TITLE:=LuCI - Lua Configuration Interface
195     URL:=http://luci.subsignal.org/
196     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
197     SUBMENU:=6. Protocols
198     TITLE:=$(if $(2),$(2),LuCI $(1) protocol support)
199     DEPENDS:=$(3)
200   endef
201
202   define Package/luci-proto-$(1)/install
203         $(call Package/luci/install/template,$$(1),protocols/$(1))
204   endef
205
206   ifneq ($(CONFIG_PACKAGE_luci-proto-$(1)),)
207     LUCI_SELECTED_MODULES+=protocols/$(1)
208   endif
209
210   LUCI_BUILD_PACKAGES += luci-proto-$(1)
211 endef
212
213 $(eval $(call protocol,core,Support for static/dhcp/none))
214 $(eval $(call protocol,ppp,Support for PPP/PPPoE/PPPoA/PPtP))
215 $(eval $(call protocol,6x4,Support for 6in4/6to4/6rd,+PACKAGE_luci-proto-6x4:6in4 +PACKAGE_luci-proto-6x4:6to4 +PACKAGE_luci-proto-6x4:6rd))
216 $(eval $(call protocol,3g,Support for 3G,+PACKAGE_luci-proto-3g:comgt))
217 $(eval $(call protocol,relay,Support for relayd pseudo bridges,+PACKAGE_luci-proto-relay:relayd))
218
219
220 ### Community Packages ###
221 define Package/luci-mod-freifunk-community
222   SECTION:=luci
223   CATEGORY:=LuCI
224   TITLE:=LuCI - Lua Configuration Interface
225   URL:=http://luci.subsignal.org/
226   MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
227   SUBMENU:=9. Freifunk
228   TITLE:=Freifunk Community Meta-Package
229   DEPENDS+= \
230    +luci-lib-web +luci-app-splash +luci-i18n-german \
231    +PACKAGE_luci-mod-freifunk-community:olsrd +PACKAGE_luci-mod-freifunk-community:olsrd-mod-dyn-gw-plain \
232    +PACKAGE_luci-mod-freifunk-community:olsrd-mod-txtinfo +PACKAGE_luci-mod-freifunk-community:olsrd-mod-nameservice \
233    +PACKAGE_luci-mod-freifunk-community:olsrd-mod-watchdog +PACKAGE_luci-mod-freifunk-community:kmod-tun \
234    +PACKAGE_luci-mod-freifunk-community:ip +PACKAGE_luci-mod-freifunk-community:freifunk-watchdog +luci-app-olsr \
235    +luci-app-olsr-services +freifunk-gwcheck +freifunk-mapupdate
236 endef
237
238 define Package/luci-mod-freifunk-community/install
239         $(call Package/luci/install/template,$(1),applications/freifunk-community)
240 endef
241
242 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk-community),)
243         LUCI_SELECTED_MODULES+=applications/freifunk-community
244 endif
245
246 LUCI_BUILD_PACKAGES += luci-mod-freifunk-community
247
248
249 ### Modules ###
250 define module
251   define Package/luci-mod-$(1)
252     SECTION:=luci
253     CATEGORY:=LuCI
254     TITLE:=LuCI - Lua Configuration Interface
255     URL:=http://luci.subsignal.org/
256     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
257     SUBMENU:=2. Modules
258     TITLE:=$(if $(2),$(2),LuCI $(1) module)
259     $(if $(3),DEPENDS+=$(3))
260   endef
261
262   define Package/luci-mod-$(1)/install
263         $(call Package/luci/install/template,$$(1),modules/$(1))
264         $(call Package/luci-mod-$(1)/extra-install)
265   endef
266
267   ifneq ($(CONFIG_PACKAGE_luci-mod-$(1)),)
268     LUCI_SELECTED_MODULES+=modules/$(1)
269   endif
270
271   LUCI_BUILD_PACKAGES += luci-mod-$(1)
272 endef
273
274
275 define Package/luci-mod-admin-core/extra-install
276         touch $(1)/etc/init.d/luci_fixtime || true
277 endef
278
279 $(eval $(call module,admin-core,Web UI Core module,+luci-lib-web +luci-proto-core +luci-i18n-english))
280 $(eval $(call module,admin-mini,LuCI Essentials - stripped down and user-friendly,+luci-mod-admin-core @BROKEN))
281 $(eval $(call module,admin-full,LuCI Administration - full-featured for full control,+luci-mod-admin-core +luci-lib-ipkg))
282 $(eval $(call module,failsafe,LuCI Fail-Safe - Fail-Safe sysupgrade module,+luci-mod-admin-core))
283 $(eval $(call module,rpc,LuCI RPC - JSON-RPC API,+luci-lib-json))
284 $(eval $(call module,freifunk,LuCI Freifunk module,+luci-mod-admin-full +luci-lib-json +PACKAGE_luci-mod-freifunk:freifunk-firewall +freifunk-common +community-profiles))
285 $(eval $(call module,niu,NIU - Next Generation Interface,+luci-mod-admin-core @BROKEN))
286
287
288 ### Applications ###
289 define application
290   define Package/luci-app-$(1)
291     SECTION:=luci
292     CATEGORY:=LuCI
293     TITLE:=LuCI - Lua Configuration Interface
294     URL:=http://luci.subsignal.org/
295     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
296     SUBMENU:=3. Applications
297     TITLE:=$(if $(2),$(2),LuCI $(1) application)
298         DEPENDS:=$(3)
299   endef
300
301   define Package/luci-app-$(1)/install
302         $(call Package/luci/install/template,$$(1),applications/luci-$(1))
303   endef
304
305   ifneq ($(CONFIG_PACKAGE_luci-app-$(1)),)
306     LUCI_SELECTED_MODULES+=applications/luci-$(1)
307   endif
308
309   LUCI_BUILD_PACKAGES += luci-app-$(1)
310 endef
311
312 define Package/luci-app-splash/conffiles
313 /etc/config/luci_splash
314 /usr/lib/luci-splash/splashtext.html
315 endef
316
317 define Package/luci-app-statistics/conffiles
318 /etc/config/luci_statistics
319 endef
320
321 define Package/luci-app-diag-devinfo/conffiles
322 /etc/config/luci_devinfo
323 endef
324
325
326 $(eval $(call application,siitwizard,SIIT IPv4-over-IPv6 configuration wizard,\
327         +PACKAGE_luci-app-siitwizard:kmod-siit))
328
329 $(eval $(call application,firewall,Firewall and Portforwarding application,\
330         +PACKAGE_luci-app-firewall:firewall))
331
332 $(eval $(call application,freifunk-policyrouting,Policy routing for mesh traffic,\
333         +PACKAGE_luci-app-freifunk-policyrouting:freifunk-policyrouting))
334
335 $(eval $(call application,freifunk-widgets,Widgets for the Freifunk index page,\
336         +PACKAGE_luci-app-freifunk-widgets:luci-mod-freifunk))
337
338 $(eval $(call application,meshwizard, Shellscript based wizard to setup mesh networks,\
339         +PACKAGE_luci-app-freifunk-meshwizard:meshwizard))
340
341 $(eval $(call application,olsr,OLSR configuration and status module,\
342         +olsrd-mod-txtinfo))
343
344 $(eval $(call application,olsr-viz,OLSR Visualisation,\
345         luci-app-olsr +olsrd-mod-txtinfo))
346
347 $(eval $(call application,freifunk-diagnostics,Tools for network diagnosis like traceroute and ping))
348
349 $(eval $(call application,olsr-services,Show services announced with the nameservice plugin,\
350         luci-app-olsr +olsrd-mod-nameservice))
351
352 $(eval $(call application,qos,Quality of Service configuration module,\
353         +PACKAGE_luci-app-qos:qos-scripts))
354
355 $(eval $(call application,splash,Freifunk DHCP-Splash application,\
356         +luci-lib-nixio +tc +kmod-sched +iptables-mod-nat-extra +iptables-mod-ipopt))
357
358 $(eval $(call application,statistics,LuCI Statistics Application,\
359         +PACKAGE_luci-app-statistics:collectd \
360         +PACKAGE_luci-app-statistics:rrdtool1 \
361         +PACKAGE_luci-app-statistics:collectd-mod-rrdtool \
362         +PACKAGE_luci-app-statistics:collectd-mod-iwinfo \
363         +PACKAGE_luci-app-statistics:collectd-mod-interface \
364         +PACKAGE_luci-app-statistics:collectd-mod-load)) \
365         +PACKAGE_luci-app-statistics:collectd-mod-network))
366
367
368 $(eval $(call application,diag-core,LuCI Diagnostics Tools (Core)))
369
370 $(eval $(call application,diag-devinfo,LuCI Diagnostics Tools (Device Info),\
371         +luci-app-diag-core \
372         +PACKAGE_luci-app-diag-devinfo:smap \
373         +PACKAGE_luci-app-diag-devinfo:netdiscover \
374         +PACKAGE_luci-app-diag-devinfo:mac-to-devinfo \
375         +PACKAGE_luci-app-diag-devinfo:httping \
376         +PACKAGE_luci-app-diag-devinfo:smap-to-devinfo \
377         +PACKAGE_luci-app-diag-devinfo:netdiscover-to-devinfo))
378
379 $(eval $(call application,voice-core,LuCI Voice Software (Core)))
380
381 $(eval $(call application,voice-diag,LuCI Voice Software (Diagnostics),\
382         luci-app-diag-devinfo))
383
384 $(eval $(call application,commands,LuCI Shell Command Module))
385
386 $(eval $(call application,upnp,Universal Plug & Play configuration module,\
387         +PACKAGE_luci-app-upnp:miniupnpd))
388
389 $(eval $(call application,ntpc,NTP time synchronisation configuration module,\
390         +PACKAGE_luci-app-ntpc:ntpclient))
391
392 $(eval $(call application,ddns,Dynamic DNS configuration module,\
393         +PACKAGE_luci-app-ddns:ddns-scripts))
394
395 $(eval $(call application,samba,Network Shares - Samba SMB/CIFS module,\
396         +PACKAGE_luci-app-samba:samba36-server))
397
398 $(eval $(call application,mmc-over-gpio,MMC-over-GPIO configuration module,\
399         +PACKAGE_luci-app-mmc-over-gpio:kmod-mmc-over-gpio))
400
401 $(eval $(call application,p910nd,p910nd - Printer server module,\
402         +PACKAGE_luci-app-p910nd:p910nd))
403
404 $(eval $(call application,ushare,uShare - UPnP A/V & DLNA Media Server,\
405         +PACKAGE_luci-app-ushare:ushare))
406
407 $(eval $(call application,hd-idle,Hard Disk Idle Spin-Down module,\
408         +PACKAGE_luci-app-hd-idle:hd-idle))
409
410 $(eval $(call application,tinyproxy,Tinyproxy - HTTP(S)-Proxy configuration,\
411         +PACKAGE_luci-app-tinyproxy:tinyproxy))
412
413 $(eval $(call application,polipo,LuCI Support for the Polipo Proxy,\
414         +PACKAGE_luci-app-polipo:polipo))
415
416 $(eval $(call application,openvpn,LuCI Support for OpenVPN,\
417         +PACKAGE_luci-app-openvpn:openvpn @BROKEN))
418
419 $(eval $(call application,p2pblock,LuCI Support for the Freifunk P2P-Block addon,\
420         luci-app-firewall +PACKAGE_luci-app-p2pblock:freifunk-p2pblock))
421
422 $(eval $(call application,multiwan,LuCI Support for the OpenWrt MultiWAN agent,\
423         luci-app-firewall +PACKAGE_luci-app-multiwan:multiwan))
424
425 $(eval $(call application,wol,LuCI Support for Wake-on-LAN,\
426         +PACKAGE_luci-app-wol:etherwake))
427
428 $(eval $(call application,vnstat,LuCI Support for VnStat,\
429         +PACKAGE_luci-app-vnstat:vnstat \
430     +PACKAGE_luci-app-vnstat:vnstati))
431
432 $(eval $(call application,radvd,LuCI Support for Radvd,\
433         +PACKAGE_luci-app-radvd:radvd))
434
435 $(eval $(call application,ahcp,LuCI Support for AHCPd,\
436         +PACKAGE_luci-app-ahcp:ahcpd))
437
438 $(eval $(call application,wshaper,LuCI Support for wshaper,\
439         +PACKAGE_luci-app-wshaper:wshaper))
440
441 $(eval $(call application,pbx,LuCI PBX Administration,\
442         +PACKAGE_luci-app-pbx:asterisk18 \
443         +PACKAGE_luci-app-pbx:asterisk18-app-authenticate \
444         +PACKAGE_luci-app-pbx:asterisk18-app-disa \
445         +PACKAGE_luci-app-pbx:asterisk18-app-setcallerid \
446         +PACKAGE_luci-app-pbx:asterisk18-app-system \
447         +PACKAGE_luci-app-pbx:asterisk18-chan-gtalk \
448         +PACKAGE_luci-app-pbx:asterisk18-codec-a-mu \
449         +PACKAGE_luci-app-pbx:asterisk18-codec-alaw \
450         +PACKAGE_luci-app-pbx:asterisk18-func-cut \
451         +PACKAGE_luci-app-pbx:asterisk18-res-clioriginate))
452
453 $(eval $(call application,pbx-voicemail,LuCI PBX Administration Voicemail Support,\
454         luci-app-pbx +PACKAGE_luci-app-pbx-voicemail:msmtp))
455
456 $(eval $(call application,ltqtapi,Lantiq voip))
457
458 $(eval $(call application,minidlna,LuCI Support for miniDLNA,\
459         +PACKAGE_luci-app-minidlna:minidlna))
460
461 $(eval $(call application,transmission,LuCI Support for Transmission,\
462         +PACKAGE_luci-app-transmission:transmission-daemon))
463
464 $(eval $(call application,watchcat,LuCI Support for Watchcat,\
465         +PACKAGE_luci-app-watchcat:watchcat))
466
467 ### Server Gateway Interfaces ###
468 define sgi
469   define Package/luci-sgi-$(1)
470     SECTION:=luci
471     CATEGORY:=LuCI
472     TITLE:=LuCI - Lua Configuration Interface
473     URL:=http://luci.subsignal.org/
474     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
475     SUBMENU:=7. Server Interfaces
476     TITLE:=$(if $(2),$(2),LuCI $(1) server gateway interface)
477         DEPENDS:=$(3)
478   endef
479
480   define Package/luci-sgi-$(1)/install
481         $(call Package/luci/install/template,$$(1),libs/sgi-$(1))
482   endef
483
484   ifneq ($(CONFIG_PACKAGE_luci-sgi-$(1)),)
485     LUCI_SELECTED_MODULES+=libs/sgi-$(1)
486   endif
487
488   LUCI_BUILD_PACKAGES += luci-sgi-$(1)
489 endef
490
491 $(eval $(call sgi,cgi,CGI Gateway behind existing Webserver))
492 $(eval $(call sgi,uhttpd,Binding for the uHTTPd server,+uhttpd +uhttpd-mod-lua))
493
494
495 ### Themes ###
496 define theme
497   define Package/luci-theme-$(1)
498     SECTION:=luci
499     CATEGORY:=LuCI
500     TITLE:=LuCI - Lua Configuration Interface
501     URL:=http://luci.subsignal.org/
502     SUBMENU:=4. Themes
503     TITLE:=$(if $(2),$(2),LuCI $(1) theme)
504         MAINTAINER:=$(if $(3),$(3),LuCI Development Team <luci@lists.subsignal.org>)
505         DEPENDS:=$(if $(filter-out base,$(1)),+luci-theme-base) $(4)
506         $(if $(5),DEFAULT:=PACKAGE_luci-lib-core)
507   endef
508
509   define Package/luci-theme-$(1)/install
510         $(call Package/luci/install/template,$$(1),themes/$(1))
511   endef
512
513   ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
514     LUCI_SELECTED_MODULES+=themes/$(1)
515   endif
516
517   LUCI_BUILD_PACKAGES += luci-theme-$(1)
518 endef
519
520 $(eval $(call theme,base,Common base for all themes))
521 $(eval $(call theme,openwrt,OpenWrt.org (default),,,1))
522 $(eval $(call theme,bootstrap,Bootstrap Theme))
523
524 $(eval $(call theme,freifunk-bno,Freifunk Berlin Nordost Theme,\
525         Stefan Pirwitz <stefan-at-freifunk-bno-dot-de>))
526
527 $(eval $(call theme,freifunk-generic,Freifunk Generic Theme,\
528         Manuel Munz <freifunk-at-somakoma-dot-de>))
529
530 ### Translations ###
531 define translation
532   define Package/luci-i18n-$(1)
533     SECTION:=luci
534     CATEGORY:=LuCI
535     TITLE:=LuCI - Lua Configuration Interface
536     URL:=http://luci.subsignal.org/
537     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
538     SUBMENU:=5. Translations
539     TITLE:=$(if $(2),$(2),$(1))
540   endef
541
542   define Package/luci-i18n-$(1)/install
543         $(call Package/luci/install/template,$$(1),i18n/$(1))
544   endef
545
546   ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
547     LUCI_SELECTED_MODULES+=i18n/$(1)
548   endif
549
550   LUCI_BUILD_PACKAGES += luci-i18n-$(1)
551 endef
552
553 $(eval $(call translation,german,German))
554 $(eval $(call translation,english,English))
555 $(eval $(call translation,french,French (by Florian Fainelli)))
556 $(eval $(call translation,italian,Italian (by Matteo Croce)))
557 $(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
558 $(eval $(call translation,portuguese-brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
559 $(eval $(call translation,chinese,Chinese (by Chinese Translators)))
560 $(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
561 $(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
562 $(eval $(call translation,catalan,Catalan (by Eduard Duran)))
563 $(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
564 $(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
565 $(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
566 $(eval $(call translation,malay,Malay (by Teow Wai Chet)))
567 $(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
568 $(eval $(call translation,hebrew,Hebrew))
569 $(eval $(call translation,romanian,Romanian))
570 $(eval $(call translation,ukrainian,Ukrainian))
571 $(eval $(call translation,hungarian,Hungarian))
572 $(eval $(call translation,polish,Polish))
573
574
575 ### Collections ###
576 define collection
577   define Package/luci$(if $(1),-$(1))
578     SECTION:=luci
579     CATEGORY:=LuCI
580     TITLE:=LuCI - Lua Configuration Interface
581     URL:=http://luci.subsignal.org/
582     MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
583     SUBMENU:=1. Collections
584     TITLE:=$(if $(2),$(2),LuCI $(if $(1),$(1),general) collection)
585     $(if $(3),DEPENDS:=$(3))
586   endef
587
588   define Package/luci$(if $(1),-$(1))/install
589         true
590   endef
591
592   LUCI_BUILD_PACKAGES += luci$(if $(1),-$(1))
593 endef
594
595 $(eval $(call collection,,\
596         Standard OpenWrt set including full admin with ppp support and the \
597         default OpenWrt theme,\
598         +uhttpd +luci-mod-admin-full +luci-theme-openwrt +luci-app-firewall \
599         +luci-proto-core +luci-proto-ppp +libiwinfo-lua))
600
601 $(eval $(call collection,ssl,\
602         Standard OpenWrt set with HTTPS support,\
603         +luci +uhttpd-mod-tls +px5g))
604
605 $(eval $(call collection,light,\
606         Minimum package set using only admin mini and the standard theme,\
607         +uhttpd +luci-mod-admin-mini +luci-theme-openwrt @BROKEN))
608
609
610 ### Compile ###
611 PKG_CONFIG_DEPENDS=$(patsubst %,CONFIG_PACKAGE_%,$(LUCI_BUILD_PACKAGES))
612
613 include $(INCLUDE_DIR)/package.mk
614
615 ifeq ($(USELOCAL),1)
616   define Build/Prepare
617         mkdir -p $(PKG_BUILD_DIR)
618         $(TAR) c -C ../../../ . \
619                 --exclude=.pc --exclude=.svn --exclude=.git \
620                 --exclude='boa-0*' --exclude='*.o' --exclude='*.so' \
621                 --exclude=dist | \
622                         tar x -C $(PKG_BUILD_DIR)/
623   endef
624 endif
625
626 define Build/Configure
627 endef
628
629 MAKE_FLAGS += \
630         MODULES="$(LUCI_SELECTED_MODULES)" \
631         LUA_TARGET="$(LUA_TARGET)" \
632         LUA_SHLIBS="-llua -lm -ldl -lcrypt" \
633         CFLAGS="$(TARGET_CFLAGS) $(LUCI_CFLAGS) -I$(STAGING_DIR)/usr/include" \
634         LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
635         NIXIO_TLS="$(NIXIO_TLS)" OS="Linux"
636
637
638 $(foreach b,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))