b2571f750f2b7a1091aebb10b302d57c5280e0fc
[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-web
136 $(call Package/luci/libtemplate)
137 DEPENDS+=+luci-addons +luci-uci
138 TITLE:=MVC Webframework
139 endef
140
141 define Package/luci-web/conffiles
142 /etc/config/luci
143 endef
144
145 define Package/luci-web/install
146 $(call Package/luci/install/template,$(1),libs/web)
147 endef
148
149
150
151 ### Community Packages ###
152
153 define Package/luci-ff-halle
154 $(call Package/luci/fftemplate)
155 DEPENDS+= \
156 +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
157 +luci-app-ffwizard-leipzig \
158 +luci-theme-fledermaus \
159 +luci-i18n-german \
160 +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
161 +kmod-tun +ip
162 TITLE:=Freifunk Halle Community Meta-Package
163 endef
164
165 define Package/luci-ff-halle/install
166 $(call Package/luci/install/template,$(1),applications/community-halle)
167 endef
168
169
170 define Package/luci-ff-leipzig
171 $(call Package/luci/fftemplate)
172 DEPENDS+= \
173 +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
174 +luci-app-ffwizard-leipzig \
175 +luci-theme-fledermaus \
176 +luci-i18n-german \
177 +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
178 +kmod-tun +ip
179 TITLE:=Freifunk Leipzig Community Meta-Package
180 endef
181
182 define Package/luci-ff-leipzig/install
183 $(call Package/luci/install/template,$(1),applications/community-leipzig)
184 endef
185
186
187 define Package/luci-ff-hannover
188 $(call Package/luci/fftemplate)
189 DEPENDS+= \
190 +luci-sgi-cgi +luci-app-splash +luci-app-olsr \
191 +luci-theme-fledermaus \
192 +luci-i18n-german \
193 +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
194 TITLE:=Freifunk Hannover Community Meta-Package
195 URL:=http://www.freifunk-hannover.de/
196 MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
197 endef
198
199 define Package/luci-ff-hannover/install
200 $(call Package/luci/install/template,$(1),applications/community-hannover)
201 endef
202
203
204 ### Modules ###
205
206 define Package/luci-mod-admin-core
207 $(call Package/luci/webtemplate)
208 DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
209 TITLE:=Administration module
210 endef
211
212 define Package/luci-mod-admin-core/install
213 $(call Package/luci/install/template,$(1),modules/admin-core)
214 endef
215
216
217 define Package/luci-mod-freifunk
218 $(call Package/luci/fftemplate)
219 DEPENDS:=+luci-mod-admin-core
220 TITLE:=LuCI Freifunk module
221 endef
222
223 define Package/luci-mod-freifunk/conffiles
224 /etc/config/freifunk
225 endef
226
227 define Package/luci-mod-freifunk/install
228 $(call Package/luci/install/template,$(1),modules/freifunk)
229 endef
230
231
232
233 ### Applications ###
234
235 define Package/luci-app-ffwizard-leipzig
236 $(call Package/luci/fftemplate)
237 DEPENDS+=+luci-app-firewall
238 TITLE:=Freifunk Leipzig configuration wizard
239 endef
240
241 define Package/luci-app-ffwizard-leipzig/install
242 $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
243 endef
244
245
246 define Package/luci-app-firewall
247 $(call Package/luci/webtemplate)
248 DEPENDS+=+luci-mod-admin-core
249 TITLE:=Firewall and Portforwarding application
250 endef
251
252 define Package/luci-app-firewall/conffiles
253 /etc/config/luci_fw
254 endef
255
256 define Package/luci-app-firewall/install
257 $(call Package/luci/install/template,$(1),applications/luci-fw)
258 endef
259
260
261 define Package/luci-app-olsr
262 $(call Package/luci/webtemplate)
263 DEPENDS+=+luci-mod-admin-core +olsrd-mod-txtinfo
264 TITLE:=OLSR configuration and status module
265 endef
266
267 define Package/luci-app-olsr/install
268 $(call Package/luci/install/template,$(1),applications/luci-olsr)
269 endef
270
271
272 define Package/luci-app-qos
273 $(call Package/luci/webtemplate)
274 DEPENDS+=+luci-mod-admin-core +qos-scripts
275 TITLE:=Quality of Service configuration module
276 endef
277
278 define Package/luci-app-qos/install
279 $(call Package/luci/install/template,$(1),applications/luci-qos)
280 endef
281
282
283 define Package/luci-app-splash
284 $(call Package/luci/fftemplate)
285 DEPENDS+=+iptables-mod-nat +iptables-mod-ipopt
286 TITLE:=Freifunk DHCP-Splash application
287 endef
288
289 define Package/luci-app-splash/conffiles
290 /etc/config/luci_splash
291 endef
292
293 define Package/luci-app-splash/install
294 $(call Package/luci/install/template,$(1),applications/luci-splash)
295 endef
296
297
298 define Package/luci-app-statistics
299 $(call Package/luci/webtemplate)
300 DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
301 TITLE:=LuCI Statistics Application
302 endef
303
304 define Package/luci-app-statistics/conffiles
305 /etc/config/luci_statistics
306 endef
307
308 define Package/luci-app-statistics/install
309 $(call Package/luci/install/template,$(1),applications/luci-statistics)
310 endef
311
312
313 ### Server Gateway Interfaces ###
314
315 define Package/luci-sgi-cgi
316 $(call Package/luci/libtemplate)
317 DEPENDS+=+luci-web
318 TITLE:=SGI for CGI
319 endef
320
321 define Package/luci-sgi-cgi/install
322 $(call Package/luci/install/template,$(1),libs/sgi-cgi)
323 endef
324
325 define Package/luci-sgi-webuci
326 $(call Package/luci/libtemplate)
327 DEPENDS+=+luci-web
328 TITLE:=SGI for Webuci
329 endef
330
331 define Package/luci-sgi-webuci/install
332 $(call Package/luci/install/template,$(1),libs/sgi-webuci)
333 endef
334
335 ### Themes ###
336 define Package/luci-theme-fledermaus
337 $(call Package/luci/fftemplate)
338 DEPENDS:=+luci-web
339 TITLE:=Fledermaus Theme
340 endef
341
342 define Package/luci-theme-fledermaus/install
343 $(call Package/luci/install/template,$(1),themes/fledermaus)
344 endef
345
346 define Package/luci-theme-openwrt
347 $(call Package/luci/thtemplate)
348 TITLE:=OpenWRT.org (default)
349 endef
350
351 define Package/luci-theme-openwrt/install
352 $(call Package/luci/install/template,$(1),themes/openwrt.org)
353 endef
354
355 ### Translations ###
356 define Package/luci-i18n-german
357 $(call Package/luci/i18ntemplate)
358 TITLE:=German
359 endef
360
361 define Package/luci-i18n-german/install
362 $(call Package/luci/install/template,$(1),i18n/german)
363 endef
364
365
366 define Package/luci-i18n-english
367 $(call Package/luci/i18ntemplate)
368 TITLE:=English (incomplete)
369 endef
370
371 define Package/luci-i18n-english/install
372 $(call Package/luci/install/template,$(1),i18n/english)
373 endef
374
375
376
377 ### Compile ###
378 ifneq ($(CONFIG_PACKAGE_luci-core),)
379 PKG_SELECTED_MODULES+=libs/core
380 endif
381 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
382 PKG_SELECTED_MODULES+=libs/cbi
383 endif
384 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
385 PKG_SELECTED_MODULES+=libs/fastindex
386 endif
387 ifneq ($(CONFIG_PACKAGE_luci-uci),)
388 PKG_SELECTED_MODULES+=libs/uci
389 endif
390 ifneq ($(CONFIG_PACKAGE_luci-web),)
391 PKG_SELECTED_MODULES+=libs/web
392 endif
393
394 ifneq ($(CONFIG_PACKAGE_luci-ff-halle),)
395 PKG_SELECTED_MODULES+=applications/community-halle
396 endif
397 ifneq ($(CONFIG_PACKAGE_luci-ff-leipzig),)
398 PKG_SELECTED_MODULES+=applications/community-leipzig
399 endif
400 ifneq ($(CONFIG_PACKAGE_luci-ff-hannover),)
401 PKG_SELECTED_MODULES+=applications/community-hannover
402 endif
403
404 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),)
405 PKG_SELECTED_MODULES+=modules/admin-core
406 endif
407 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),)
408 PKG_SELECTED_MODULES+=modules/freifunk
409 endif
410
411 ifneq ($(CONFIG_PACKAGE_luci-app-ffwizard-leipzig),)
412 PKG_SELECTED_MODULES+=applications/luci-ffwizard-leipzig
413 endif
414 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
415 PKG_SELECTED_MODULES+=applications/luci-fw
416 endif
417 ifneq ($(CONFIG_PACKAGE_luci-app-olsr),)
418 PKG_SELECTED_MODULES+=applications/luci-olsr
419 endif
420 ifneq ($(CONFIG_PACKAGE_luci-app-qos),)
421 PKG_SELECTED_MODULES+=applications/luci-qos
422 endif
423 ifneq ($(CONFIG_PACKAGE_luci-app-splash),)
424 PKG_SELECTED_MODULES+=applications/luci-splash
425 endif
426 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
427 PKG_SELECTED_MODULES+=applications/luci-statistics
428 endif
429
430 ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
431 PKG_SELECTED_MODULES+=libs/sgi-cgi
432 endif
433 ifneq ($(CONFIG_PACKAGE_luci-sgi-webuci),)
434 PKG_SELECTED_MODULES+=libs/sgi-webuci
435 endif
436
437 ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
438 PKG_SELECTED_MODULES+=themes/fledermaus
439 endif
440 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
441 PKG_SELECTED_MODULES+=themes/openwrt.org
442 endif
443
444 ifneq ($(CONFIG_PACKAGE_luci-i18n-german),)
445 PKG_SELECTED_MODULES+=i18n/german
446 endif
447 ifneq ($(CONFIG_PACKAGE_luci-i18n-english),)
448 PKG_SELECTED_MODULES+=i18n/english
449 endif
450
451
452 MAKE_FLAGS += MODULES="$(PKG_SELECTED_MODULES)" LUA_TARGET="$(LUA_TARGET)" CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" LDFLAGS="$(TARGET_LDFLAGS)"
453
454
455 $(eval $(call BuildPackage,luci-core))
456 $(eval $(call BuildPackage,luci-cbi))
457 $(eval $(call BuildPackage,luci-fastindex))
458 $(eval $(call BuildPackage,luci-uci))
459 $(eval $(call BuildPackage,luci-web))
460
461 $(eval $(call BuildPackage,luci-ff-halle))
462 $(eval $(call BuildPackage,luci-ff-leipzig))
463 $(eval $(call BuildPackage,luci-ff-hannover))
464
465 $(eval $(call BuildPackage,luci-mod-admin-core))
466 $(eval $(call BuildPackage,luci-mod-freifunk))
467
468 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
469 $(eval $(call BuildPackage,luci-app-firewall))
470 $(eval $(call BuildPackage,luci-app-olsr))
471 $(eval $(call BuildPackage,luci-app-qos))
472 $(eval $(call BuildPackage,luci-app-splash))
473 $(eval $(call BuildPackage,luci-app-statistics))
474
475 $(eval $(call BuildPackage,luci-sgi-cgi))
476 $(eval $(call BuildPackage,luci-sgi-webuci))
477
478 $(eval $(call BuildPackage,luci-theme-fledermaus))
479 $(eval $(call BuildPackage,luci-theme-openwrt))
480
481 $(eval $(call BuildPackage,luci-i18n-german))
482 $(eval $(call BuildPackage,luci-i18n-english))