* Added preliminary OpenWRT support for luci-httpd
[project/luci.git] / contrib / package / luci / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_BRANCH:=trunk
4 PKG_SOURCE_URL:=https://dev.leipzig.freifunk.net/svn/ff-luci/$(PKG_BRANCH)
5 PKG_REV:=$(shell LC_ALL=C svn info ${PKG_SOURCE_URL} | sed -ne's/^Last Changed Rev: //p')
6
7 PKG_NAME:=luci
8 PKG_VERSION:=0.7+svn$(PKG_REV)
9 PKG_RELEASE:=1
10
11 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
12 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
13 PKG_SOURCE_PROTO:=svn
14 PKG_SOURCE_VERSION:=$(PKG_REV)
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 LUA_TARGET:=source
20 PKG_SELECTED_MODULES:=
21
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Build/Configure
26 endef
27
28 ### Templates ###
29
30 define Package/luci/libtemplate
31   SECTION:=admin
32   CATEGORY:=Administration
33   TITLE:=LuCI - Lua Configuration Interface
34   URL:=http://luci.freifunk-halle.net/
35   MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
36   SUBMENU:=LuCI - Libraries
37   DEPENDS:=+luci-core
38 endef
39
40 define Package/luci/fftemplate
41   $(call Package/luci/libtemplate)
42   SUBMENU:=LuCI - Freifunk Support
43   DEPENDS:=+luci-mod-freifunk
44 endef
45
46 define Package/luci/httpdtemplate
47   $(call Package/luci/libtemplate)
48   SUBMENU:=LuCI - Non-Forking HTTP-Daemon (EXPERIMENTAL)
49   DEPENDS:=+luci-httpd
50 endef
51
52 define Package/luci/i18ntemplate
53   $(call Package/luci/libtemplate)
54   SUBMENU:=LuCI - Translations
55   DEPENDS:=+luci-web
56 endef
57
58 define Package/luci/thtemplate
59   $(call Package/luci/libtemplate)
60   SUBMENU:=LuCI - Themes
61   DEPENDS:=+luci-web
62 endef
63
64 define Package/luci/webtemplate
65   $(call Package/luci/libtemplate)
66   SUBMENU:=LuCI - Webinterface Components
67 endef
68
69
70 define Package/luci/install/template
71         $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
72         $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
73 endef
74
75
76
77 ### Core package ###
78
79 define Package/luci-core
80   $(call Package/luci/libtemplate)
81   DEPENDS:=+lua +luaposix
82   TITLE:=LuCI core libraries
83 endef
84
85 define Package/luci-core/install                
86         $(call Package/luci/install/template,$(1),libs/core)
87 endef
88
89 define Package/luci-core/config
90        choice
91                prompt "Build Target"
92                default PACKAGE_luci-core_compile
93
94        config PACKAGE_luci-core_compile
95                bool "Production"
96
97        config PACKAGE_luci-core_source
98                bool "Debug"
99
100        endchoice
101 endef
102
103 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
104         LUA_TARGET:=compile
105 endif
106
107
108 ### Libraries ###
109 define Package/luci-cbi
110   $(call Package/luci/libtemplate)
111   DEPENDS+=+luci-web
112   TITLE:=Configuration Binding Interface
113 endef
114
115 define Package/luci-cbi/install
116         $(call Package/luci/install/template,$(1),libs/cbi)
117 endef
118
119
120 define Package/luci-uci
121   $(call Package/luci/libtemplate)
122   DEPENDS+=+libuci-lua
123   TITLE:=High-Level UCI API
124 endef
125
126 define Package/luci-uci/install
127         $(call Package/luci/install/template,$(1),libs/uci)
128 endef
129
130
131 define Package/luci-fastindex
132   $(call Package/luci/libtemplate)
133   TITLE:=Fastindex indexing module
134 endef
135
136 define Package/luci-fastindex/install
137         $(call Package/luci/install/template,$(1),libs/fastindex)
138 endef
139
140
141 define Package/luci-http
142   $(call Package/luci/libtemplate)
143   TITLE:=HTTP Protocol implementation
144 endef
145
146 define Package/luci-http/install
147         $(call Package/luci/install/template,$(1),libs/http)
148 endef
149
150
151 define Package/luci-web
152   $(call Package/luci/libtemplate)
153   DEPENDS+=+luci-http +luci-addons +luci-uci
154   TITLE:=MVC Webframework
155 endef
156
157 define Package/luci-web/conffiles
158 /etc/config/luci
159 endef
160
161 define Package/luci-web/install
162         $(call Package/luci/install/template,$(1),libs/web)
163 endef
164
165
166
167 ### HTTPD ###
168
169 define Package/luci-httpd
170   $(call Package/luci/httpdtemplate)
171   DEPENDS:=+luci-http +luasocket
172   TITLE:=Server Core
173 endef
174
175 define Package/luci-httpd/install
176         $(call Package/luci/install/template,$(1),libs/httpd)
177 endef
178
179
180
181 ### Community Packages ###
182
183 define Package/luci-ff-halle
184   $(call Package/luci/fftemplate)
185   DEPENDS+= \
186    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
187    +luci-app-ffwizard-leipzig \
188    +luci-theme-fledermaus \
189    +luci-i18n-german \
190    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
191    +kmod-tun +ip
192   TITLE:=Freifunk Halle Community Meta-Package
193 endef
194
195 define Package/luci-ff-halle/install
196         $(call Package/luci/install/template,$(1),applications/community-halle)
197 endef
198
199
200 define Package/luci-ff-leipzig
201   $(call Package/luci/fftemplate)
202   DEPENDS+= \
203    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
204    +luci-app-ffwizard-leipzig \
205    +luci-theme-fledermaus \
206    +luci-i18n-german \
207    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
208    +kmod-tun +ip
209   TITLE:=Freifunk Leipzig Community Meta-Package
210 endef
211
212 define Package/luci-ff-leipzig/install
213         $(call Package/luci/install/template,$(1),applications/community-leipzig)
214 endef
215
216
217 define Package/luci-ff-hannover
218   $(call Package/luci/fftemplate)
219   DEPENDS+= \
220    +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
221    +luci-theme-fledermaus \
222    +luci-i18n-german \
223    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
224   TITLE:=Freifunk Hannover Community Meta-Package
225   URL:=http://www.freifunk-hannover.de/
226   MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
227 endef
228
229 define Package/luci-ff-hannover/install
230         $(call Package/luci/install/template,$(1),applications/community-hannover)
231 endef
232
233
234 ### Modules ###
235
236 define Package/luci-mod-admin-core
237   $(call Package/luci/webtemplate)
238   DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
239   TITLE:=Administration module
240 endef
241
242 define Package/luci-mod-admin-core/install
243         $(call Package/luci/install/template,$(1),modules/admin-core)
244 endef
245
246
247 define Package/luci-mod-freifunk
248   $(call Package/luci/fftemplate)
249   DEPENDS:=+luci-mod-admin-core
250   TITLE:=LuCI Freifunk module
251 endef
252
253 define Package/luci-mod-freifunk/conffiles
254 /etc/config/freifunk
255 endef
256
257 define Package/luci-mod-freifunk/install
258         $(call Package/luci/install/template,$(1),modules/freifunk)
259 endef
260
261
262
263 ### Applications ###
264
265 define Package/luci-app-ffwizard-leipzig
266   $(call Package/luci/fftemplate)
267   DEPENDS+=+luci-app-firewall
268   TITLE:=Freifunk Leipzig configuration wizard
269 endef
270
271 define Package/luci-app-ffwizard-leipzig/install
272         $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
273 endef
274
275
276 define Package/luci-app-firewall
277   $(call Package/luci/webtemplate)
278   DEPENDS+=+luci-mod-admin-core
279   TITLE:=Firewall and Portforwarding application
280 endef
281
282 define Package/luci-app-firewall/conffiles
283 /etc/config/luci_fw
284 endef
285
286 define Package/luci-app-firewall/install
287         $(call Package/luci/install/template,$(1),applications/luci-fw)
288 endef
289
290
291 define Package/luci-app-olsr
292   $(call Package/luci/webtemplate)
293   DEPENDS+=+luci-mod-admin-core +olsrd-mod-txtinfo
294   TITLE:=OLSR configuration and status module
295 endef
296
297 define Package/luci-app-olsr/install
298         $(call Package/luci/install/template,$(1),applications/luci-olsr)
299 endef
300
301
302 define Package/luci-app-qos
303   $(call Package/luci/webtemplate)
304   DEPENDS+=+luci-mod-admin-core +qos-scripts
305   TITLE:=Quality of Service configuration module
306 endef
307
308 define Package/luci-app-qos/install
309         $(call Package/luci/install/template,$(1),applications/luci-qos)
310 endef
311
312
313 define Package/luci-app-splash
314   $(call Package/luci/fftemplate)
315   DEPENDS+=+iptables-mod-nat +iptables-mod-ipopt
316   TITLE:=Freifunk DHCP-Splash application
317 endef
318
319 define Package/luci-app-splash/conffiles
320 /etc/config/luci_splash
321 endef
322
323 define Package/luci-app-splash/install
324         $(call Package/luci/install/template,$(1),applications/luci-splash)
325 endef
326
327
328 define Package/luci-app-statistics
329   $(call Package/luci/webtemplate)
330   DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
331   TITLE:=LuCI Statistics Application
332 endef
333
334 define Package/luci-app-statistics/conffiles
335 /etc/config/luci_statistics
336 endef
337
338 define Package/luci-app-statistics/install
339         $(call Package/luci/install/template,$(1),applications/luci-statistics)
340 endef
341
342
343 ### Server Gateway Interfaces ###
344
345 define Package/luci-sgi-cgi
346   $(call Package/luci/libtemplate)
347   DEPENDS+=+luci-web
348   TITLE:=SGI for CGI
349 endef
350
351 define Package/luci-sgi-cgi/install
352         $(call Package/luci/install/template,$(1),libs/sgi-cgi)
353 endef
354
355 define Package/luci-sgi-luci
356   $(call Package/luci/libtemplate)
357   DEPENDS+=+luci-web +luci-httpd
358   TITLE:=SGI for LuCI HTTPD
359 endef
360
361 define Package/luci-sgi-luci/install
362         $(call Package/luci/install/template,$(1),libs/sgi-luci)
363 endef
364
365 define Package/luci-sgi-webuci
366   $(call Package/luci/libtemplate)
367   DEPENDS+=+luci-web
368   TITLE:=SGI for Webuci
369 endef
370
371 define Package/luci-sgi-webuci/install
372         $(call Package/luci/install/template,$(1),libs/sgi-webuci)
373 endef
374
375 ### Themes ###
376 define Package/luci-theme-fledermaus
377   $(call Package/luci/fftemplate)
378   DEPENDS:=+luci-web
379   TITLE:=Fledermaus Theme
380 endef
381
382 define Package/luci-theme-fledermaus/install
383         $(call Package/luci/install/template,$(1),themes/fledermaus)
384 endef
385
386 define Package/luci-theme-openwrt
387   $(call Package/luci/thtemplate)
388   TITLE:=OpenWRT.org (default)
389 endef
390
391 define Package/luci-theme-openwrt/install
392         $(call Package/luci/install/template,$(1),themes/openwrt.org)
393 endef
394
395 ### Translations ###
396 define Package/luci-i18n-german
397   $(call Package/luci/i18ntemplate)
398   TITLE:=German
399 endef
400
401 define Package/luci-i18n-german/install
402         $(call Package/luci/install/template,$(1),i18n/german)
403 endef
404
405
406 define Package/luci-i18n-english
407   $(call Package/luci/i18ntemplate)
408   TITLE:=English (incomplete)
409 endef
410
411 define Package/luci-i18n-english/install
412         $(call Package/luci/install/template,$(1),i18n/english)
413 endef
414
415
416
417 ### Compile ###
418 ifneq ($(CONFIG_PACKAGE_luci-core),)
419         PKG_SELECTED_MODULES+=libs/core
420 endif
421 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
422         PKG_SELECTED_MODULES+=libs/cbi
423 endif
424 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
425         PKG_SELECTED_MODULES+=libs/fastindex
426 endif
427 ifneq ($(CONFIG_PACKAGE_luci-http),)
428         PKG_SELECTED_MODULES+=libs/http
429 endif
430 ifneq ($(CONFIG_PACKAGE_luci-uci),)
431         PKG_SELECTED_MODULES+=libs/uci
432 endif
433 ifneq ($(CONFIG_PACKAGE_luci-web),)
434         PKG_SELECTED_MODULES+=libs/web
435 endif
436
437 ifneq ($(CONFIG_PACKAGE_luci-httpd),)
438         PKG_SELECTED_MODULES+=libs/httpd
439 endif
440
441 ifneq ($(CONFIG_PACKAGE_luci-ff-halle),)
442         PKG_SELECTED_MODULES+=applications/community-halle
443 endif
444 ifneq ($(CONFIG_PACKAGE_luci-ff-leipzig),)
445         PKG_SELECTED_MODULES+=applications/community-leipzig
446 endif
447 ifneq ($(CONFIG_PACKAGE_luci-ff-hannover),)
448         PKG_SELECTED_MODULES+=applications/community-hannover
449 endif
450
451 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),)
452         PKG_SELECTED_MODULES+=modules/admin-core
453 endif
454 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),)
455         PKG_SELECTED_MODULES+=modules/freifunk
456 endif
457
458 ifneq ($(CONFIG_PACKAGE_luci-app-ffwizard-leipzig),)
459         PKG_SELECTED_MODULES+=applications/luci-ffwizard-leipzig
460 endif
461 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
462         PKG_SELECTED_MODULES+=applications/luci-fw
463 endif
464 ifneq ($(CONFIG_PACKAGE_luci-app-olsr),)
465         PKG_SELECTED_MODULES+=applications/luci-olsr
466 endif
467 ifneq ($(CONFIG_PACKAGE_luci-app-qos),)
468         PKG_SELECTED_MODULES+=applications/luci-qos
469 endif
470 ifneq ($(CONFIG_PACKAGE_luci-app-splash),)
471         PKG_SELECTED_MODULES+=applications/luci-splash
472 endif
473 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
474         PKG_SELECTED_MODULES+=applications/luci-statistics
475 endif
476
477 ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
478         PKG_SELECTED_MODULES+=libs/sgi-cgi
479 endif
480 ifneq ($(CONFIG_PACKAGE_luci-sgi-luci),)
481         PKG_SELECTED_MODULES+=libs/sgi-luci
482 endif
483 ifneq ($(CONFIG_PACKAGE_luci-sgi-webuci),)
484         PKG_SELECTED_MODULES+=libs/sgi-webuci
485 endif
486
487 ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
488         PKG_SELECTED_MODULES+=themes/fledermaus
489 endif
490 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
491         PKG_SELECTED_MODULES+=themes/openwrt.org
492 endif
493
494 ifneq ($(CONFIG_PACKAGE_luci-i18n-german),)
495         PKG_SELECTED_MODULES+=i18n/german
496 endif
497 ifneq ($(CONFIG_PACKAGE_luci-i18n-english),)
498         PKG_SELECTED_MODULES+=i18n/english
499 endif
500
501
502 MAKE_FLAGS += MODULES="$(PKG_SELECTED_MODULES)" LUA_TARGET="$(LUA_TARGET)" CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" LDFLAGS="$(TARGET_LDFLAGS)"
503
504
505 $(eval $(call BuildPackage,luci-core))
506 $(eval $(call BuildPackage,luci-cbi))
507 $(eval $(call BuildPackage,luci-fastindex))
508 $(eval $(call BuildPackage,luci-http))
509 $(eval $(call BuildPackage,luci-uci))
510 $(eval $(call BuildPackage,luci-web))
511
512 $(eval $(call BuildPackage,luci-httpd))
513
514 $(eval $(call BuildPackage,luci-ff-halle))
515 $(eval $(call BuildPackage,luci-ff-leipzig))
516 $(eval $(call BuildPackage,luci-ff-hannover))
517
518 $(eval $(call BuildPackage,luci-mod-admin-core))
519 $(eval $(call BuildPackage,luci-mod-freifunk))
520
521 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
522 $(eval $(call BuildPackage,luci-app-firewall))
523 $(eval $(call BuildPackage,luci-app-olsr))
524 $(eval $(call BuildPackage,luci-app-qos))
525 $(eval $(call BuildPackage,luci-app-splash))
526 $(eval $(call BuildPackage,luci-app-statistics))
527
528 $(eval $(call BuildPackage,luci-sgi-cgi))
529 $(eval $(call BuildPackage,luci-sgi-luci))
530 $(eval $(call BuildPackage,luci-sgi-webuci))
531
532 $(eval $(call BuildPackage,luci-theme-fledermaus))
533 $(eval $(call BuildPackage,luci-theme-openwrt))
534
535 $(eval $(call BuildPackage,luci-i18n-german))
536 $(eval $(call BuildPackage,luci-i18n-english))