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