Add temporary dependency for luci-web to luci-sgi-cgi
[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
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 ### Modules ###
257
258 define Package/luci-mod-admin-core
259   $(call Package/luci/webtemplate)
260   DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
261   TITLE:=Administration module
262 endef
263
264 define Package/luci-mod-admin-core/install
265         $(call Package/luci/install/template,$(1),modules/admin-core)
266 endef
267
268
269 define Package/luci-mod-freifunk
270   $(call Package/luci/fftemplate)
271   DEPENDS:=+luci-mod-admin-core
272   TITLE:=LuCI Freifunk module
273 endef
274
275 define Package/luci-mod-freifunk/conffiles
276 /etc/config/freifunk
277 endef
278
279 define Package/luci-mod-freifunk/install
280         $(call Package/luci/install/template,$(1),modules/freifunk)
281 endef
282
283
284
285 ### Applications ###
286
287 define Package/luci-app-ffwizard-leipzig
288   $(call Package/luci/fftemplate)
289   DEPENDS+=+luci-app-firewall
290   TITLE:=Freifunk Leipzig configuration wizard
291 endef
292
293 define Package/luci-app-ffwizard-leipzig/install
294         $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
295 endef
296
297
298 define Package/luci-app-firewall
299   $(call Package/luci/webtemplate)
300   DEPENDS+=+luci-mod-admin-core
301   TITLE:=Firewall and Portforwarding application
302 endef
303
304 define Package/luci-app-firewall/conffiles
305 /etc/config/luci_fw
306 endef
307
308 define Package/luci-app-firewall/install
309         $(call Package/luci/install/template,$(1),applications/luci-fw)
310 endef
311
312
313 define Package/luci-app-olsr
314   $(call Package/luci/webtemplate)
315   DEPENDS+=+luci-mod-admin-core +olsrd-mod-txtinfo
316   TITLE:=OLSR configuration and status module
317 endef
318
319 define Package/luci-app-olsr/install
320         $(call Package/luci/install/template,$(1),applications/luci-olsr)
321 endef
322
323
324 define Package/luci-app-qos
325   $(call Package/luci/webtemplate)
326   DEPENDS+=+luci-mod-admin-core +qos-scripts
327   TITLE:=Quality of Service configuration module
328 endef
329
330 define Package/luci-app-qos/install
331         $(call Package/luci/install/template,$(1),applications/luci-qos)
332 endef
333
334
335 define Package/luci-app-splash
336   $(call Package/luci/fftemplate)
337   DEPENDS+=+luasocket +iptables-mod-nat +iptables-mod-ipopt
338   TITLE:=Freifunk DHCP-Splash application
339 endef
340
341 define Package/luci-app-splash/conffiles
342 /etc/config/luci_splash
343 endef
344
345 define Package/luci-app-splash/install
346         $(call Package/luci/install/template,$(1),applications/luci-splash)
347 endef
348
349
350 define Package/luci-app-statistics
351   $(call Package/luci/webtemplate)
352   DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
353   TITLE:=LuCI Statistics Application
354 endef
355
356 define Package/luci-app-statistics/conffiles
357 /etc/config/luci_statistics
358 endef
359
360 define Package/luci-app-statistics/install
361         $(call Package/luci/install/template,$(1),applications/luci-statistics)
362 endef
363
364
365 ### Server Gateway Interfaces ###
366
367 define Package/luci-sgi-cgi
368   $(call Package/luci/libtemplate)
369   DEPENDS+=+luci-web
370   TITLE:=SGI for CGI
371 endef
372
373 define Package/luci-sgi-cgi/install
374         $(call Package/luci/install/template,$(1),libs/sgi-cgi)
375 endef
376
377 define Package/luci-sgi-luci
378   $(call Package/luci/libtemplate)
379   DEPENDS+=+luci-web +luci-httpd
380   TITLE:=SGI for LuCI HTTPD
381 endef
382
383 define Package/luci-sgi-luci/install
384         $(call Package/luci/install/template,$(1),libs/sgi-luci)
385 endef
386
387 define Package/luci-sgi-webuci
388   $(call Package/luci/libtemplate)
389   DEPENDS+=+luci-web
390   TITLE:=SGI for Webuci
391 endef
392
393 define Package/luci-sgi-webuci/install
394         $(call Package/luci/install/template,$(1),libs/sgi-webuci)
395 endef
396
397 ### Themes ###
398 define Package/luci-theme-fledermaus
399   $(call Package/luci/fftemplate)
400   DEPENDS:=+luci-web
401   TITLE:=Fledermaus Theme
402 endef
403
404 define Package/luci-theme-fledermaus/install
405         $(call Package/luci/install/template,$(1),themes/fledermaus)
406 endef
407
408 define Package/luci-theme-openwrt
409   $(call Package/luci/thtemplate)
410   TITLE:=OpenWRT.org (default)
411 endef
412
413 define Package/luci-theme-openwrt/install
414         $(call Package/luci/install/template,$(1),themes/openwrt.org)
415 endef
416
417 ### Translations ###
418 define Package/luci-i18n-german
419   $(call Package/luci/i18ntemplate)
420   TITLE:=German
421 endef
422
423 define Package/luci-i18n-german/install
424         $(call Package/luci/install/template,$(1),i18n/german)
425 endef
426
427
428 define Package/luci-i18n-english
429   $(call Package/luci/i18ntemplate)
430   TITLE:=English
431 endef
432
433 define Package/luci-i18n-english/install
434         $(call Package/luci/install/template,$(1),i18n/english)
435 endef
436
437
438
439 ### Compile ###
440 ifneq ($(CONFIG_PACKAGE_luci-core),)
441         PKG_SELECTED_MODULES+=libs/core
442 endif
443 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
444         PKG_SELECTED_MODULES+=libs/cbi
445 endif
446 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
447         PKG_SELECTED_MODULES+=libs/fastindex
448 endif
449 ifneq ($(CONFIG_PACKAGE_luci-http),)
450         PKG_SELECTED_MODULES+=libs/http
451 endif
452 ifneq ($(CONFIG_PACKAGE_luci-uci),)
453         PKG_SELECTED_MODULES+=libs/uci
454 endif
455 ifneq ($(CONFIG_PACKAGE_luci-web),)
456         PKG_SELECTED_MODULES+=libs/web
457 endif
458
459 ifneq ($(CONFIG_PACKAGE_luci-httpd),)
460         PKG_SELECTED_MODULES+=libs/httpd
461 endif
462
463 ifneq ($(CONFIG_PACKAGE_luci-ff-halle),)
464         PKG_SELECTED_MODULES+=applications/community-halle
465 endif
466 ifneq ($(CONFIG_PACKAGE_luci-ff-leipzig),)
467         PKG_SELECTED_MODULES+=applications/community-leipzig
468 endif
469 ifneq ($(CONFIG_PACKAGE_luci-ff-hannover),)
470         PKG_SELECTED_MODULES+=applications/community-hannover
471 endif
472
473 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),)
474         PKG_SELECTED_MODULES+=modules/admin-core
475 endif
476 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),)
477         PKG_SELECTED_MODULES+=modules/freifunk
478 endif
479
480 ifneq ($(CONFIG_PACKAGE_luci-app-ffwizard-leipzig),)
481         PKG_SELECTED_MODULES+=applications/luci-ffwizard-leipzig
482 endif
483 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
484         PKG_SELECTED_MODULES+=applications/luci-fw
485 endif
486 ifneq ($(CONFIG_PACKAGE_luci-app-olsr),)
487         PKG_SELECTED_MODULES+=applications/luci-olsr
488 endif
489 ifneq ($(CONFIG_PACKAGE_luci-app-qos),)
490         PKG_SELECTED_MODULES+=applications/luci-qos
491 endif
492 ifneq ($(CONFIG_PACKAGE_luci-app-splash),)
493         PKG_SELECTED_MODULES+=applications/luci-splash
494 endif
495 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
496         PKG_SELECTED_MODULES+=applications/luci-statistics
497 endif
498
499 ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
500         PKG_SELECTED_MODULES+=libs/sgi-cgi
501 endif
502 ifneq ($(CONFIG_PACKAGE_luci-sgi-luci),)
503         PKG_SELECTED_MODULES+=libs/sgi-luci
504 endif
505 ifneq ($(CONFIG_PACKAGE_luci-sgi-webuci),)
506         PKG_SELECTED_MODULES+=libs/sgi-webuci
507 endif
508
509 ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
510         PKG_SELECTED_MODULES+=themes/fledermaus
511 endif
512 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
513         PKG_SELECTED_MODULES+=themes/openwrt.org
514 endif
515
516 ifneq ($(CONFIG_PACKAGE_luci-i18n-german),)
517         PKG_SELECTED_MODULES+=i18n/german
518 endif
519 ifneq ($(CONFIG_PACKAGE_luci-i18n-english),)
520         PKG_SELECTED_MODULES+=i18n/english
521 endif
522
523
524 MAKE_FLAGS += \
525         MODULES="$(PKG_SELECTED_MODULES)" \
526         LUA_TARGET="$(LUA_TARGET)" \
527         LUA_SHLIBS="-llua -lm" \
528         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
529         LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
530         OS="Linux"
531
532
533 $(eval $(call BuildPackage,luci-core))
534 $(eval $(call BuildPackage,luci-cbi))
535 $(eval $(call BuildPackage,luci-fastindex))
536 $(eval $(call BuildPackage,luci-http))
537 $(eval $(call BuildPackage,luci-uci))
538 $(eval $(call BuildPackage,luci-web))
539
540 $(eval $(call BuildPackage,luci-httpd))
541
542 $(eval $(call BuildPackage,luci-ff-halle))
543 $(eval $(call BuildPackage,luci-ff-leipzig))
544 $(eval $(call BuildPackage,luci-ff-hannover))
545
546 $(eval $(call BuildPackage,luci-mod-admin-core))
547 $(eval $(call BuildPackage,luci-mod-freifunk))
548
549 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
550 $(eval $(call BuildPackage,luci-app-firewall))
551 $(eval $(call BuildPackage,luci-app-olsr))
552 $(eval $(call BuildPackage,luci-app-qos))
553 $(eval $(call BuildPackage,luci-app-splash))
554 $(eval $(call BuildPackage,luci-app-statistics))
555
556 $(eval $(call BuildPackage,luci-sgi-cgi))
557 $(eval $(call BuildPackage,luci-sgi-luci))
558 $(eval $(call BuildPackage,luci-sgi-webuci))
559
560 $(eval $(call BuildPackage,luci-theme-fledermaus))
561 $(eval $(call BuildPackage,luci-theme-openwrt))
562
563 $(eval $(call BuildPackage,luci-i18n-german))
564 $(eval $(call BuildPackage,luci-i18n-english))