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