Added new application luci-ntpc to luci-full and luci-mini
[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 ifeq ($(USELOCAL),1)
13   PKG_VERSION:=0.7+svn
14 else
15   PKG_SOURCE_URL:=https://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.7+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/fftemplate
63   $(call Package/luci/libtemplate)
64   SUBMENU:=LuCI - Freifunk Support (GERMAN ONLY)
65   DEPENDS:=+luci-mod-freifunk
66 endef
67
68 define Package/luci/httpdtemplate
69   $(call Package/luci/libtemplate)
70   SUBMENU:=LuCI - Non-Forking HTTP-Daemon (EXPERIMENTAL)
71   DEPENDS:=+luci-httpd
72 endef
73
74 define Package/luci/i18ntemplate
75   $(call Package/luci/libtemplate)
76   SUBMENU:=LuCI - Translations
77   DEPENDS:=+luci-web
78 endef
79
80 define Package/luci/thtemplate
81   $(call Package/luci/libtemplate)
82   SUBMENU:=LuCI - Themes
83   DEPENDS:=+luci-web
84 endef
85
86 define Package/luci/webtemplate
87   $(call Package/luci/libtemplate)
88   SUBMENU:=LuCI - Webinterface Components
89 endef
90
91
92 define Package/luci/install/template
93         $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
94         $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
95 endef
96
97
98
99 ### Core package ###
100
101 define Package/luci-core
102   $(call Package/luci/libtemplate)
103   DEPENDS:=+lua +luaposix
104   TITLE:=LuCI core libraries
105 endef
106
107 define Package/luci-core/install                
108         $(call Package/luci/install/template,$(1),libs/core)
109 endef
110
111 define Package/luci-core/config
112        choice
113                prompt "Build Target"
114                default PACKAGE_luci-core_compile
115
116        config PACKAGE_luci-core_compile
117                bool "Production"
118
119        config PACKAGE_luci-core_source
120                bool "Debug"
121
122        endchoice
123 endef
124
125 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
126   LUA_TARGET:=compile
127 endif
128
129
130 ### Libraries ###
131 define Package/luci-cbi
132   $(call Package/luci/libtemplate)
133   DEPENDS+=+luci-web
134   TITLE:=Configuration Binding Interface
135 endef
136
137 define Package/luci-cbi/install
138         $(call Package/luci/install/template,$(1),libs/cbi)
139 endef
140
141
142 define Package/luci-uci
143   $(call Package/luci/libtemplate)
144   DEPENDS+=+libuci-lua
145   TITLE:=High-Level UCI API
146 endef
147
148 define Package/luci-uci/install
149         $(call Package/luci/install/template,$(1),libs/uci)
150 endef
151
152
153 define Package/luci-fastindex
154   $(call Package/luci/libtemplate)
155   TITLE:=Fastindex indexing module
156 endef
157
158 define Package/luci-fastindex/install
159         $(call Package/luci/install/template,$(1),libs/fastindex)
160 endef
161
162
163 define Package/luci-http
164   $(call Package/luci/libtemplate)
165   TITLE:=HTTP Protocol implementation
166 endef
167
168 define Package/luci-http/install
169         $(call Package/luci/install/template,$(1),libs/http)
170 endef
171
172
173 define Package/luci-web
174   $(call Package/luci/libtemplate)
175   DEPENDS+=+luci-http +luci-addons +luci-uci +luci-sgi-cgi
176   TITLE:=MVC Webframework
177 endef
178
179 define Package/luci-web/conffiles
180 /etc/config/luci
181 endef
182
183 define Package/luci-web/install
184         $(call Package/luci/install/template,$(1),libs/web)
185 endef
186
187
188
189 ### HTTPD ###
190
191 define Package/luci-httpd
192   $(call Package/luci/httpdtemplate)
193   DEPENDS:=+luci-http +luasocket
194   TITLE:=Server Core
195 endef
196
197 define Package/luci-httpd/install
198         $(call Package/luci/install/template,$(1),libs/httpd)
199 endef
200
201
202
203 ### Community Packages ###
204
205 define Package/luci-ff-halle
206   $(call Package/luci/fftemplate)
207   DEPENDS+= \
208    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
209    +luci-app-ffwizard-leipzig \
210    +luci-theme-fledermaus \
211    +luci-i18n-german \
212    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
213    +kmod-tun +ip
214   TITLE:=Freifunk Halle Community Meta-Package
215 endef
216
217 define Package/luci-ff-halle/install
218         $(call Package/luci/install/template,$(1),applications/community-halle)
219 endef
220
221
222 define Package/luci-ff-leipzig
223   $(call Package/luci/fftemplate)
224   DEPENDS+= \
225    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
226    +luci-app-ffwizard-leipzig \
227    +luci-theme-fledermaus \
228    +luci-i18n-german \
229    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
230    +kmod-tun +ip
231   TITLE:=Freifunk Leipzig Community Meta-Package
232 endef
233
234 define Package/luci-ff-leipzig/install
235         $(call Package/luci/install/template,$(1),applications/community-leipzig)
236 endef
237
238
239 define Package/luci-ff-hannover
240   $(call Package/luci/fftemplate)
241   DEPENDS+= \
242    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
243    +luci-theme-fledermaus \
244    +luci-i18n-german \
245    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
246   TITLE:=Freifunk Hannover Community Meta-Package
247   URL:=http://www.freifunk-hannover.de/
248   MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
249 endef
250
251 define Package/luci-ff-hannover/install
252         $(call Package/luci/install/template,$(1),applications/community-hannover)
253 endef
254
255
256 define Package/luci-ff-berlin
257   $(call Package/luci/fftemplate)
258   DEPENDS+= \
259    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
260    +luci-theme-fledermaus \
261    +luci-i18n-german \
262    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
263   TITLE:=Freifunk Berlin Community Meta-Package
264 endef
265
266 define Package/luci-ff-berlin/install
267         $(call Package/luci/install/template,$(1),applications/community-berlin)
268 endef
269
270 define Package/luci-ff-augsburg
271   $(call Package/luci/fftemplate)
272   DEPENDS+= \
273    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
274    +luci-theme-fledermaus \
275    +luci-i18n-german \
276    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
277   TITLE:=Freifunk Augsburg Community Meta-Package
278 endef
279
280 define Package/luci-ff-augsburg/install
281         $(call Package/luci/install/template,$(1),applications/community-augsburg)
282 endef
283
284 ### Modules ###
285
286 define Package/luci-mod-admin-core
287   $(call Package/luci/webtemplate)
288   DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
289   TITLE:=Administration core module
290 endef
291
292 define Package/luci-mod-admin-core/install
293         $(call Package/luci/install/template,$(1),modules/admin-core)
294 endef
295
296
297 define Package/luci-mod-admin-mini
298   $(call Package/luci/webtemplate)
299   DEPENDS+=+luci-mod-admin-core
300   TITLE:=Simplified Administration module (INCOMPLETE)
301 endef
302
303 define Package/luci-mod-admin-mini/install
304         $(call Package/luci/install/template,$(1),modules/admin-mini)
305 endef
306
307
308 define Package/luci-mod-admin-full
309   $(call Package/luci/webtemplate)
310   DEPENDS+=+luci-mod-admin-core
311   TITLE:=Full featured Administration module
312 endef
313
314 define Package/luci-mod-admin-full/install
315         $(call Package/luci/install/template,$(1),modules/admin-full)
316 endef
317
318
319 define Package/luci-mod-freifunk
320   $(call Package/luci/fftemplate)
321   DEPENDS:=+luci-mod-admin-full
322   TITLE:=LuCI Freifunk module
323 endef
324
325 define Package/luci-mod-freifunk/conffiles
326 /etc/config/freifunk
327 endef
328
329 define Package/luci-mod-freifunk/install
330         $(call Package/luci/install/template,$(1),modules/freifunk)
331 endef
332
333
334
335 ### Applications ###
336
337 define Package/luci-app-ffwizard-leipzig
338   $(call Package/luci/fftemplate)
339   DEPENDS+=+luci-app-firewall
340   TITLE:=Freifunk Leipzig configuration wizard
341 endef
342
343 define Package/luci-app-ffwizard-leipzig/install
344         $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
345 endef
346
347
348 define Package/luci-app-firewall
349   $(call Package/luci/webtemplate)
350   DEPENDS+=+luci-mod-admin-core
351   TITLE:=Firewall and Portforwarding application
352 endef
353
354 define Package/luci-app-firewall/conffiles
355 /etc/config/luci_fw
356 endef
357
358 define Package/luci-app-firewall/install
359         $(call Package/luci/install/template,$(1),applications/luci-fw)
360 endef
361
362
363 define Package/luci-app-olsr
364   $(call Package/luci/webtemplate)
365   DEPENDS+=+luci-mod-admin-full +olsrd-mod-txtinfo
366   TITLE:=OLSR configuration and status module
367 endef
368
369 define Package/luci-app-olsr/install
370         $(call Package/luci/install/template,$(1),applications/luci-olsr)
371 endef
372
373
374 define Package/luci-app-qos
375   $(call Package/luci/webtemplate)
376   DEPENDS+=+luci-mod-admin-core +qos-scripts
377   TITLE:=Quality of Service configuration module
378 endef
379
380 define Package/luci-app-qos/install
381         $(call Package/luci/install/template,$(1),applications/luci-qos)
382 endef
383
384
385 define Package/luci-app-splash
386   $(call Package/luci/fftemplate)
387   DEPENDS+=+luasocket +iptables-mod-nat +iptables-mod-ipopt
388   TITLE:=Freifunk DHCP-Splash application
389 endef
390
391 define Package/luci-app-splash/conffiles
392 /etc/config/luci_splash
393 endef
394
395 define Package/luci-app-splash/install
396         $(call Package/luci/install/template,$(1),applications/luci-splash)
397 endef
398
399
400 define Package/luci-app-statistics
401   $(call Package/luci/webtemplate)
402   DEPENDS+=+luci-mod-admin-full +collectd +collectd-mod-rrdtool1 +rrdtool1
403   TITLE:=LuCI Statistics Application
404 endef
405
406 define Package/luci-app-statistics/conffiles
407 /etc/config/luci_statistics
408 endef
409
410 define Package/luci-app-statistics/install
411         $(call Package/luci/install/template,$(1),applications/luci-statistics)
412 endef
413
414
415 define Package/luci-app-upnp
416   $(call Package/luci/webtemplate)
417   DEPENDS+=+luci-mod-admin-core +miniupnpd
418   TITLE:=Universal Plug & Play configuration module
419 endef
420
421 define Package/luci-app-upnp/install
422         $(call Package/luci/install/template,$(1),applications/luci-upnp)
423 endef
424
425
426 define Package/luci-app-ntpc
427   $(call Package/luci/webtemplate)
428   DEPENDS+=+luci-mod-admin-core +ntpclient
429   TITLE:=NTP time synchronisation client configuration
430 endef
431
432 define Package/luci-app-ntpc/install
433         $(call Package/luci/install/template,$(1),applications/luci-ntpc)
434 endef
435
436
437 ### Server Gateway Interfaces ###
438
439 define Package/luci-sgi-cgi
440   $(call Package/luci/libtemplate)
441   TITLE:=SGI for CGI
442 endef
443
444 define Package/luci-sgi-cgi/install
445         $(call Package/luci/install/template,$(1),libs/sgi-cgi)
446 endef
447
448 define Package/luci-sgi-luci
449   $(call Package/luci/libtemplate)
450   DEPENDS+=+luci-httpd
451   TITLE:=SGI for LuCI HTTPD
452 endef
453
454 define Package/luci-sgi-luci/install
455         $(call Package/luci/install/template,$(1),libs/sgi-luci)
456 endef
457
458 define Package/luci-sgi-webuci
459   $(call Package/luci/libtemplate)
460   TITLE:=SGI for Webuci
461 endef
462
463 define Package/luci-sgi-webuci/install
464         $(call Package/luci/install/template,$(1),libs/sgi-webuci)
465 endef
466
467 ### Themes ###
468 define Package/luci-theme-fledermaus
469   $(call Package/luci/fftemplate)
470   DEPENDS:=+luci-web
471   TITLE:=Fledermaus Theme
472 endef
473
474 define Package/luci-theme-fledermaus/install
475         $(call Package/luci/install/template,$(1),themes/fledermaus)
476 endef
477
478 define Package/luci-theme-openwrt
479   $(call Package/luci/thtemplate)
480   TITLE:=OpenWRT.org (default)
481 endef
482
483 define Package/luci-theme-openwrt/install
484         $(call Package/luci/install/template,$(1),themes/openwrt.org)
485 endef
486
487 ### Translations ###
488 define Package/luci-i18n-german
489   $(call Package/luci/i18ntemplate)
490   TITLE:=German
491 endef
492
493 define Package/luci-i18n-german/install
494         $(call Package/luci/install/template,$(1),i18n/german)
495 endef
496
497
498 define Package/luci-i18n-english
499   $(call Package/luci/i18ntemplate)
500   TITLE:=English
501 endef
502
503 define Package/luci-i18n-english/install
504         $(call Package/luci/install/template,$(1),i18n/english)
505 endef
506
507
508 define Package/luci-i18n-french
509   $(call Package/luci/i18ntemplate)
510   TITLE:=French
511 endef
512
513 define Package/luci-i18n-french/install
514         $(call Package/luci/install/template,$(1),i18n/french)
515 endef
516
517
518
519
520 ### Compile ###
521 ifneq ($(CONFIG_PACKAGE_luci-core),)
522         PKG_SELECTED_MODULES+=libs/core
523 endif
524 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
525         PKG_SELECTED_MODULES+=libs/cbi
526 endif
527 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
528         PKG_SELECTED_MODULES+=libs/fastindex
529 endif
530 ifneq ($(CONFIG_PACKAGE_luci-http),)
531         PKG_SELECTED_MODULES+=libs/http
532 endif
533 ifneq ($(CONFIG_PACKAGE_luci-uci),)
534         PKG_SELECTED_MODULES+=libs/uci
535 endif
536 ifneq ($(CONFIG_PACKAGE_luci-web),)
537         PKG_SELECTED_MODULES+=libs/web
538 endif
539
540 ifneq ($(CONFIG_PACKAGE_luci-httpd),)
541         PKG_SELECTED_MODULES+=libs/httpd
542 endif
543
544 ifneq ($(CONFIG_PACKAGE_luci-ff-halle),)
545         PKG_SELECTED_MODULES+=applications/community-halle
546 endif
547 ifneq ($(CONFIG_PACKAGE_luci-ff-leipzig),)
548         PKG_SELECTED_MODULES+=applications/community-leipzig
549 endif
550 ifneq ($(CONFIG_PACKAGE_luci-ff-hannover),)
551         PKG_SELECTED_MODULES+=applications/community-hannover
552 endif
553 ifneq ($(CONFIG_PACKAGE_luci-ff-berlin),)
554         PKG_SELECTED_MODULES+=applications/community-berlin
555 endif
556 ifneq ($(CONFIG_PACKAGE_luci-ff-augsburg),)
557         PKG_SELECTED_MODULES+=applications/community-augsburg
558 endif
559
560 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),)
561         PKG_SELECTED_MODULES+=modules/admin-core
562 endif
563 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-mini),)
564         PKG_SELECTED_MODULES+=modules/admin-mini
565 endif
566 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-full),)
567         PKG_SELECTED_MODULES+=modules/admin-full
568 endif
569 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),)
570         PKG_SELECTED_MODULES+=modules/freifunk
571 endif
572
573 ifneq ($(CONFIG_PACKAGE_luci-app-ffwizard-leipzig),)
574         PKG_SELECTED_MODULES+=applications/luci-ffwizard-leipzig
575 endif
576 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
577         PKG_SELECTED_MODULES+=applications/luci-fw
578 endif
579 ifneq ($(CONFIG_PACKAGE_luci-app-olsr),)
580         PKG_SELECTED_MODULES+=applications/luci-olsr
581 endif
582 ifneq ($(CONFIG_PACKAGE_luci-app-qos),)
583         PKG_SELECTED_MODULES+=applications/luci-qos
584 endif
585 ifneq ($(CONFIG_PACKAGE_luci-app-splash),)
586         PKG_SELECTED_MODULES+=applications/luci-splash
587 endif
588 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
589         PKG_SELECTED_MODULES+=applications/luci-statistics
590 endif
591 ifneq ($(CONFIG_PACKAGE_luci-app-upnp),)
592         PKG_SELECTED_MODULES+=applications/luci-upnp
593 endif
594 ifneq ($(CONFIG_PACKAGE_luci-app-ntpc),)
595         PKG_SELECTED_MODULES+=applications/luci-ntpc
596 endif
597
598 ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
599         PKG_SELECTED_MODULES+=libs/sgi-cgi
600 endif
601 ifneq ($(CONFIG_PACKAGE_luci-sgi-luci),)
602         PKG_SELECTED_MODULES+=libs/sgi-luci
603 endif
604 ifneq ($(CONFIG_PACKAGE_luci-sgi-webuci),)
605         PKG_SELECTED_MODULES+=libs/sgi-webuci
606 endif
607
608 ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
609         PKG_SELECTED_MODULES+=themes/fledermaus
610 endif
611 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
612         PKG_SELECTED_MODULES+=themes/openwrt.org
613 endif
614
615 ifneq ($(CONFIG_PACKAGE_luci-i18n-german),)
616         PKG_SELECTED_MODULES+=i18n/german
617 endif
618 ifneq ($(CONFIG_PACKAGE_luci-i18n-english),)
619         PKG_SELECTED_MODULES+=i18n/english
620 endif
621 ifneq ($(CONFIG_PACKAGE_luci-i18n-french),)
622         PKG_SELECTED_MODULES+=i18n/french
623 endif
624
625
626 MAKE_FLAGS += \
627         MODULES="$(PKG_SELECTED_MODULES)" \
628         LUA_TARGET="$(LUA_TARGET)" \
629         LUA_SHLIBS="-llua -lm" \
630         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
631         LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
632         OS="Linux"
633
634
635 $(eval $(call BuildPackage,luci-core))
636 $(eval $(call BuildPackage,luci-cbi))
637 $(eval $(call BuildPackage,luci-fastindex))
638 $(eval $(call BuildPackage,luci-http))
639 $(eval $(call BuildPackage,luci-uci))
640 $(eval $(call BuildPackage,luci-web))
641
642 $(eval $(call BuildPackage,luci-httpd))
643
644 $(eval $(call BuildPackage,luci-ff-halle))
645 $(eval $(call BuildPackage,luci-ff-leipzig))
646 $(eval $(call BuildPackage,luci-ff-hannover))
647 $(eval $(call BuildPackage,luci-ff-berlin))
648 $(eval $(call BuildPackage,luci-ff-augsburg))
649
650 $(eval $(call BuildPackage,luci-mod-admin-core))
651 $(eval $(call BuildPackage,luci-mod-admin-mini))
652 $(eval $(call BuildPackage,luci-mod-admin-full))
653 $(eval $(call BuildPackage,luci-mod-freifunk))
654
655 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
656 $(eval $(call BuildPackage,luci-app-firewall))
657 $(eval $(call BuildPackage,luci-app-olsr))
658 $(eval $(call BuildPackage,luci-app-qos))
659 $(eval $(call BuildPackage,luci-app-splash))
660 $(eval $(call BuildPackage,luci-app-statistics))
661 $(eval $(call BuildPackage,luci-app-upnp))
662 $(eval $(call BuildPackage,luci-app-ntpc))
663
664 $(eval $(call BuildPackage,luci-sgi-cgi))
665 $(eval $(call BuildPackage,luci-sgi-luci))
666 $(eval $(call BuildPackage,luci-sgi-webuci))
667
668 $(eval $(call BuildPackage,luci-theme-fledermaus))
669 $(eval $(call BuildPackage,luci-theme-openwrt))
670
671 $(eval $(call BuildPackage,luci-i18n-german))
672 $(eval $(call BuildPackage,luci-i18n-english))
673 $(eval $(call BuildPackage,luci-i18n-french))