* luci-0.8: backport p910nd application
[project/luci.git] / contrib / package / luci / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_BRANCH:=branches/luci-0.8
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 ifeq ($(USELOCAL),1)
13 PKG_VERSION:=0.8+svn
14 else
15 PKG_SOURCE_URL:=http://dev.leipzig.freifunk.net/svn/ff-luci/$(PKG_BRANCH)
16 ifeq ($(DUMP),)
17 PKG_REV:=$(shell LC_ALL=C svn info ${PKG_SOURCE_URL} | sed -ne's/^Last Changed Rev: //p')
18 PKG_VERSION:=0.8+svn$(PKG_REV)
19 endif
20 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
21 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22 PKG_SOURCE_PROTO:=svn
23 PKG_SOURCE_VERSION:=$(PKG_REV)
24 endif
25
26 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
27 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
28
29 PKG_BUILD_DEPENDS:=libnotimpl
30 LUA_TARGET:=source
31 PKG_SELECTED_MODULES:=
32
33
34 include $(INCLUDE_DIR)/package.mk
35
36 ifeq ($(USELOCAL),1)
37 define Build/Prepare
38 mkdir -p $(PKG_BUILD_DIR)
39 $(TAR) c -C ../../../ . \
40 --exclude=.pc --exclude=.svn --exclude=.git \
41 --exclude='boa-0*' --exclude='*.o' --exclude='*.so' \
42 --exclude=dist | \
43 tar x -C $(PKG_BUILD_DIR)/
44 endef
45 endif
46
47 define Build/Configure
48 endef
49
50 ### Templates ###
51
52 define Package/luci/libtemplate
53 SECTION:=admin
54 CATEGORY:=Administration
55 TITLE:=LuCI - Lua Configuration Interface
56 URL:=http://luci.freifunk-halle.net/
57 MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
58 SUBMENU:=LuCI Libraries
59 DEPENDS:=+luci-core
60 endef
61
62 define Package/luci/i18ntemplate
63 $(call Package/luci/libtemplate)
64 SUBMENU:=LuCI Translations
65 DEPENDS:=+luci-web
66 endef
67
68 define Package/luci/thtemplate
69 $(call Package/luci/libtemplate)
70 SUBMENU:=LuCI Themes
71 DEPENDS:=+luci-web
72 endef
73
74 define Package/luci/webtemplate
75 $(call Package/luci/libtemplate)
76 SUBMENU:=LuCI Components
77 endef
78
79
80 define Package/luci/install/template
81 $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
82 $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
83 endef
84
85
86
87 ### Core package ###
88
89 define Package/luci-core
90 $(call Package/luci/libtemplate)
91 DEPENDS:=+lua +luaposix +bitlib
92 TITLE:=LuCI core libraries
93 endef
94
95 define Package/luci-core/install
96 $(call Package/luci/install/template,$(1),libs/core)
97 endef
98
99 define Package/luci-core/config
100 choice
101 prompt "Build Target"
102 default PACKAGE_luci-core_source
103
104 config PACKAGE_luci-core_compile
105 bool "Precompiled"
106
107 config PACKAGE_luci-core_stripped
108 bool "Stripped"
109
110 config PACKAGE_luci-core_source
111 bool "Full Source"
112
113 endchoice
114 endef
115
116 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
117 LUA_TARGET:=compile
118 endif
119
120 ifneq ($(CONFIG_PACKAGE_luci-core_stripped),)
121 LUA_TARGET:=strip
122 endif
123
124
125 ### Libraries ###
126 define Package/luci-cbi
127 $(call Package/luci/libtemplate)
128 DEPENDS+=+luci-web +luci-uvl +luci-uci
129 TITLE:=Configuration Binding Interface
130 endef
131
132 define Package/luci-cbi/install
133 $(call Package/luci/install/template,$(1),libs/cbi)
134 endef
135
136
137 define Package/luci-uci
138 $(call Package/luci/libtemplate)
139 DEPENDS+=+libuci-lua
140 TITLE:=High-Level UCI API
141 endef
142
143 define Package/luci-uci/install
144 $(call Package/luci/install/template,$(1),libs/uci)
145 endef
146
147
148 define Package/luci-fastindex
149 $(call Package/luci/libtemplate)
150 TITLE:=Fastindex indexing module
151 endef
152
153 define Package/luci-fastindex/install
154 $(call Package/luci/install/template,$(1),libs/fastindex)
155 endef
156
157
158 define Package/luci-http
159 $(call Package/luci/libtemplate)
160 TITLE:=HTTP Protocol implementation
161 endef
162
163 define Package/luci-http/install
164 $(call Package/luci/install/template,$(1),libs/http)
165 endef
166
167
168 define Package/luci-ipkg
169 $(call Package/luci/libtemplate)
170 TITLE:=LuCI IPKG/OPKG call abstraction library
171 endef
172
173 define Package/luci-ipkg/install
174 $(call Package/luci/install/template,$(1),libs/ipkg)
175 endef
176
177
178 define Package/luci-json
179 $(call Package/luci/libtemplate)
180 TITLE:=LuCI JSON Library
181 endef
182
183 define Package/luci-json/install
184 $(call Package/luci/install/template,$(1),libs/json)
185 endef
186
187
188 define Package/luci-sys
189 $(call Package/luci/libtemplate)
190 TITLE:=LuCI Linux/POSIX system library
191 endef
192
193 define Package/luci-sys/install
194 $(call Package/luci/install/template,$(1),libs/sys)
195 endef
196
197
198 define Package/luci-web
199 $(call Package/luci/libtemplate)
200 DEPENDS+=+luci-http +luci-sys +luci-addons +luci-uci +luci-sgi-cgi
201 TITLE:=MVC Webframework
202 endef
203
204 define Package/luci-web/conffiles
205 /etc/config/luci
206 endef
207
208 define Package/luci-web/install
209 $(call Package/luci/install/template,$(1),libs/web)
210 endef
211
212
213 define Package/luci-uvl
214 $(call Package/luci/libtemplate)
215 DEPENDS+=+luci-sys +luci-uci +luci-core
216 TITLE:=UVL - UCI Validation Layer
217 endef
218
219 define Package/luci-uvl/install
220 $(call Package/luci/install/template,$(1),libs/uvl)
221 endef
222
223
224 ### Modules ###
225
226 define Package/luci-admin-core
227 $(call Package/luci/webtemplate)
228 DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
229 TITLE:=Web UI Core Module
230 endef
231
232 define Package/luci-admin-core/install
233 $(call Package/luci/install/template,$(1),modules/admin-core)
234 endef
235
236
237 define Package/luci-admin-mini
238 $(call Package/luci/webtemplate)
239 DEPENDS+=+luci-admin-core
240 TITLE:=LuCI Essentials - stripped down and user-friendly
241 endef
242
243 define Package/luci-admin-mini/install
244 $(call Package/luci/install/template,$(1),modules/admin-mini)
245 endef
246
247
248 define Package/luci-admin-full
249 $(call Package/luci/webtemplate)
250 DEPENDS+=+luci-admin-core +luci-ipkg
251 TITLE:=LuCI Administration - full-featured for full control
252 endef
253
254 define Package/luci-admin-full/install
255 $(call Package/luci/install/template,$(1),modules/admin-full)
256 endef
257
258
259 define Package/luci-admin-rpc
260 $(call Package/luci/webtemplate)
261 DEPENDS+=+luci-json
262 TITLE:=LuCI RPC - JSON-RPC API
263 endef
264
265 define Package/luci-admin-rpc/install
266 $(call Package/luci/install/template,$(1),modules/rpc)
267 endef
268
269
270 ### Applications ###
271
272 define Package/luci-app-firewall
273 $(call Package/luci/webtemplate)
274 DEPENDS+=+luci-admin-core
275 TITLE:=Firewall and Portforwarding application
276 endef
277
278 define Package/luci-app-firewall/install
279 $(call Package/luci/install/template,$(1),applications/luci-fw)
280 endef
281
282
283 define Package/luci-app-olsr
284 $(call Package/luci/webtemplate)
285 DEPENDS+=+luci-admin-full +olsrd-luci +olsrd-luci-mod-txtinfo
286 TITLE:=OLSR configuration and status module
287 endef
288
289 define Package/luci-app-olsr/install
290 $(call Package/luci/install/template,$(1),applications/luci-olsr)
291 endef
292
293
294 define Package/luci-app-qos
295 $(call Package/luci/webtemplate)
296 DEPENDS+=+luci-admin-core +qos-scripts
297 TITLE:=Quality of Service configuration module
298 endef
299
300 define Package/luci-app-qos/install
301 $(call Package/luci/install/template,$(1),applications/luci-qos)
302 endef
303
304
305 define Package/luci-app-statistics
306 $(call Package/luci/webtemplate)
307 DEPENDS+=+luci-admin-full +collectd +collectd-mod-rrdtool1 +rrdtool1
308 TITLE:=LuCI Statistics Application
309 endef
310
311 define Package/luci-app-statistics/conffiles
312 /etc/config/luci_statistics
313 endef
314
315 define Package/luci-app-statistics/install
316 $(call Package/luci/install/template,$(1),applications/luci-statistics)
317 endef
318
319
320 define Package/luci-app-upnp
321 $(call Package/luci/webtemplate)
322 DEPENDS+=+luci-admin-core +miniupnpd
323 TITLE:=Universal Plug & Play configuration module
324 endef
325
326 define Package/luci-app-upnp/install
327 $(call Package/luci/install/template,$(1),applications/luci-upnp)
328 endef
329
330
331 define Package/luci-app-ntpc
332 $(call Package/luci/webtemplate)
333 DEPENDS+=+luci-admin-core +ntpclient
334 TITLE:=NTP time synchronisation client configuration module
335 endef
336
337 define Package/luci-app-ntpc/install
338 $(call Package/luci/install/template,$(1),applications/luci-ntpc)
339 endef
340
341
342 define Package/luci-app-ddns
343 $(call Package/luci/webtemplate)
344 DEPENDS+=+luci-admin-core +ddns-scripts
345 TITLE:=Dynamic DNS configuration module
346 endef
347
348 define Package/luci-app-ddns/install
349 $(call Package/luci/install/template,$(1),applications/luci-ddns)
350 endef
351
352
353 define Package/luci-app-samba
354 $(call Package/luci/webtemplate)
355 DEPENDS+=+luci-admin-full +samba3
356 TITLE:=Network Shares - Samba SMB/CIFS module
357 endef
358
359 define Package/luci-app-samba/install
360 $(call Package/luci/install/template,$(1),applications/luci-samba)
361 endef
362
363
364 define Package/luci-app-uvc_streamer
365 $(call Package/luci/webtemplate)
366 DEPENDS+=+luci-admin-full +uvc-streamer
367 TITLE:=Webcam Streaming - UVC-Streamer module
368 endef
369
370 define Package/luci-app-uvc_streamer/install
371 $(call Package/luci/install/template,$(1),applications/luci-uvc_streamer)
372 endef
373
374
375 define Package/luci-app-p910nd
376 $(call Package/luci/webtemplate)
377 DEPENDS+=+luci-admin-full +p910nd
378 TITLE:=p910nd - Printer server module
379 endef
380
381 define Package/luci-app-p910nd/install
382 $(call Package/luci/install/template,$(1),applications/luci-p910nd)
383 endef
384
385
386 ### Server Gateway Interfaces ###
387
388 define Package/luci-sgi-cgi
389 $(call Package/luci/libtemplate)
390 TITLE:=SGI for CGI
391 endef
392
393 define Package/luci-sgi-cgi/install
394 $(call Package/luci/install/template,$(1),libs/sgi-cgi)
395 endef
396
397
398 ### Themes ###
399 define Package/luci-theme-openwrt
400 $(call Package/luci/thtemplate)
401 TITLE:=OpenWRT.org (default)
402 endef
403
404 define Package/luci-theme-openwrt/install
405 $(call Package/luci/install/template,$(1),themes/openwrt.org)
406 endef
407
408 define Package/luci-theme-openwrtlight
409 $(call Package/luci/thtemplate)
410 TITLE:=OpenWRT.org - light variant without images
411 endef
412
413 define Package/luci-theme-openwrtlight/install
414 $(call Package/luci/install/template,$(1),themes/openwrt-light)
415 endef
416
417
418 ### Translations ###
419 define Package/luci-i18n-german
420 $(call Package/luci/i18ntemplate)
421 TITLE:=German
422 endef
423
424 define Package/luci-i18n-german/install
425 $(call Package/luci/install/template,$(1),i18n/german)
426 endef
427
428
429 define Package/luci-i18n-english
430 $(call Package/luci/i18ntemplate)
431 TITLE:=English
432 endef
433
434 define Package/luci-i18n-english/install
435 $(call Package/luci/install/template,$(1),i18n/english)
436 endef
437
438
439 define Package/luci-i18n-french
440 $(call Package/luci/i18ntemplate)
441 TITLE:=French (by Florian Fainelli)
442 endef
443
444 define Package/luci-i18n-french/install
445 $(call Package/luci/install/template,$(1),i18n/french)
446 endef
447
448
449 define Package/luci-i18n-russian
450 $(call Package/luci/i18ntemplate)
451 TITLE:=Russian (by Skryabin Dmitry)
452 endef
453
454 define Package/luci-i18n-russian/install
455 $(call Package/luci/install/template,$(1),i18n/russian)
456 endef
457
458
459
460 ### Compile ###
461 ifneq ($(CONFIG_PACKAGE_luci-core),)
462 PKG_SELECTED_MODULES+=libs/core
463 endif
464 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
465 PKG_SELECTED_MODULES+=libs/cbi
466 endif
467 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
468 PKG_SELECTED_MODULES+=libs/fastindex
469 endif
470 ifneq ($(CONFIG_PACKAGE_luci-http),)
471 PKG_SELECTED_MODULES+=libs/http
472 endif
473 ifneq ($(CONFIG_PACKAGE_luci-ipkg),)
474 PKG_SELECTED_MODULES+=libs/ipkg
475 endif
476 ifneq ($(CONFIG_PACKAGE_luci-json),)
477 PKG_SELECTED_MODULES+=libs/json
478 endif
479 ifneq ($(CONFIG_PACKAGE_luci-uci),)
480 PKG_SELECTED_MODULES+=libs/uci
481 endif
482 ifneq ($(CONFIG_PACKAGE_luci-sys),)
483 PKG_SELECTED_MODULES+=libs/sys
484 endif
485 ifneq ($(CONFIG_PACKAGE_luci-web),)
486 PKG_SELECTED_MODULES+=libs/web
487 endif
488 ifneq ($(CONFIG_PACKAGE_luci-uvl),)
489 PKG_SELECTED_MODULES+=libs/uvl
490 endif
491
492 ifneq ($(CONFIG_PACKAGE_luci-admin-core),)
493 PKG_SELECTED_MODULES+=modules/admin-core
494 endif
495 ifneq ($(CONFIG_PACKAGE_luci-admin-mini),)
496 PKG_SELECTED_MODULES+=modules/admin-mini
497 endif
498 ifneq ($(CONFIG_PACKAGE_luci-admin-full),)
499 PKG_SELECTED_MODULES+=modules/admin-full
500 endif
501 ifneq ($(CONFIG_PACKAGE_luci-admin-rpc),)
502 PKG_SELECTED_MODULES+=modules/rpc
503 endif
504
505 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
506 PKG_SELECTED_MODULES+=applications/luci-fw
507 endif
508 ifneq ($(CONFIG_PACKAGE_luci-app-olsr),)
509 PKG_SELECTED_MODULES+=applications/luci-olsr
510 endif
511 ifneq ($(CONFIG_PACKAGE_luci-app-qos),)
512 PKG_SELECTED_MODULES+=applications/luci-qos
513 endif
514 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
515 PKG_SELECTED_MODULES+=applications/luci-statistics
516 endif
517 ifneq ($(CONFIG_PACKAGE_luci-app-upnp),)
518 PKG_SELECTED_MODULES+=applications/luci-upnp
519 endif
520 ifneq ($(CONFIG_PACKAGE_luci-app-ntpc),)
521 PKG_SELECTED_MODULES+=applications/luci-ntpc
522 endif
523 ifneq ($(CONFIG_PACKAGE_luci-app-ddns),)
524 PKG_SELECTED_MODULES+=applications/luci-ddns
525 endif
526 ifneq ($(CONFIG_PACKAGE_luci-app-samba),)
527 PKG_SELECTED_MODULES+=applications/luci-samba
528 endif
529 ifneq ($(CONFIG_PACKAGE_luci-app-uvc_streamer),)
530 PKG_SELECTED_MODULES+=applications/luci-uvc_streamer
531 endif
532 ifneq ($(CONFIG_PACKAGE_luci-app-p910nd),)
533 PKG_SELECTED_MODULES+=applications/luci-p910nd
534 endif
535
536
537 ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
538 PKG_SELECTED_MODULES+=libs/sgi-cgi
539 endif
540
541 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
542 PKG_SELECTED_MODULES+=themes/openwrt.org
543 endif
544 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrtlight),)
545 PKG_SELECTED_MODULES+=themes/openwrt-light
546 endif
547
548 ifneq ($(CONFIG_PACKAGE_luci-i18n-german),)
549 PKG_SELECTED_MODULES+=i18n/german
550 endif
551 ifneq ($(CONFIG_PACKAGE_luci-i18n-english),)
552 PKG_SELECTED_MODULES+=i18n/english
553 endif
554 ifneq ($(CONFIG_PACKAGE_luci-i18n-french),)
555 PKG_SELECTED_MODULES+=i18n/french
556 endif
557 ifneq ($(CONFIG_PACKAGE_luci-i18n-russian),)
558 PKG_SELECTED_MODULES+=i18n/russian
559 endif
560
561
562 MAKE_FLAGS += \
563 MODULES="$(PKG_SELECTED_MODULES)" \
564 LUA_TARGET="$(LUA_TARGET)" \
565 LUA_SHLIBS="-llua -lm" \
566 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
567 LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
568 OS="Linux"
569
570
571 $(eval $(call BuildPackage,luci-core))
572 $(eval $(call BuildPackage,luci-cbi))
573 $(eval $(call BuildPackage,luci-fastindex))
574 $(eval $(call BuildPackage,luci-http))
575 $(eval $(call BuildPackage,luci-ipkg))
576 $(eval $(call BuildPackage,luci-json))
577 $(eval $(call BuildPackage,luci-uci))
578 $(eval $(call BuildPackage,luci-sys))
579 $(eval $(call BuildPackage,luci-web))
580 $(eval $(call BuildPackage,luci-uvl))
581
582 $(eval $(call BuildPackage,luci-admin-core))
583 $(eval $(call BuildPackage,luci-admin-mini))
584 $(eval $(call BuildPackage,luci-admin-full))
585 $(eval $(call BuildPackage,luci-admin-rpc))
586
587 $(eval $(call BuildPackage,luci-app-firewall))
588 $(eval $(call BuildPackage,luci-app-olsr))
589 $(eval $(call BuildPackage,luci-app-qos))
590 $(eval $(call BuildPackage,luci-app-statistics))
591 $(eval $(call BuildPackage,luci-app-upnp))
592 $(eval $(call BuildPackage,luci-app-ntpc))
593 $(eval $(call BuildPackage,luci-app-ddns))
594 $(eval $(call BuildPackage,luci-app-samba))
595 $(eval $(call BuildPackage,luci-app-uvc_streamer))
596 $(eval $(call BuildPackage,luci-app-p910nd))
597
598 $(eval $(call BuildPackage,luci-sgi-cgi))
599
600 $(eval $(call BuildPackage,luci-theme-openwrt))
601 $(eval $(call BuildPackage,luci-theme-openwrtlight))
602
603 $(eval $(call BuildPackage,luci-i18n-german))
604 $(eval $(call BuildPackage,luci-i18n-english))
605 $(eval $(call BuildPackage,luci-i18n-french))
606 $(eval $(call BuildPackage,luci-i18n-russian))