* luci/statistics: add postinstall for package, fix permissions of luci-ff-hannover...
[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.6+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) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
66 endef
67
68
69
70 ### Core package ###
71
72 define Package/luci-core
73 $(call Package/luci/libtemplate)
74 DEPENDS:=+lua +luaposix
75 TITLE:=LuCI core libraries
76 endef
77
78 define Package/luci-core/install
79 $(call Package/luci/install/template,$(1),libs/core)
80 endef
81
82 define Package/luci-core/config
83 choice
84 prompt "Build Target"
85 default PACKAGE_luci-core_compile
86
87 config PACKAGE_luci-core_compile
88 bool "Production"
89
90 config PACKAGE_luci-core_source
91 bool "Debug"
92
93 endchoice
94 endef
95
96 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
97 LUA_TARGET:=compile
98 endif
99
100
101 ### Libraries ###
102 define Package/luci-cbi
103 $(call Package/luci/libtemplate)
104 DEPENDS+=+luci-web
105 TITLE:=Configuration Binding Interface
106 endef
107
108 define Package/luci-cbi/install
109 $(call Package/luci/install/template,$(1),libs/cbi)
110 endef
111
112
113 define Package/luci-uci
114 $(call Package/luci/libtemplate)
115 DEPENDS+=+libuci-lua
116 TITLE:=High-Level UCI API
117 endef
118
119 define Package/luci-uci/install
120 $(call Package/luci/install/template,$(1),libs/uci)
121 endef
122
123
124 define Package/luci-fastindex
125 $(call Package/luci/libtemplate)
126 TITLE:=Fastindex indexing module
127 endef
128
129 define Package/luci-fastindex/install
130 $(call Package/luci/install/template,$(1),libs/fastindex)
131 endef
132
133
134 define Package/luci-web
135 $(call Package/luci/libtemplate)
136 DEPENDS+=+luci-addons +luci-uci
137 TITLE:=MVC Webframework
138 endef
139
140 define Package/luci-web/conffiles
141 /etc/config/luci
142 endef
143
144 define Package/luci-web/install
145 $(call Package/luci/install/template,$(1),libs/web)
146 endef
147
148
149
150 ### Community Packages ###
151
152 define Package/luci-ff-halle
153 $(call Package/luci/fftemplate)
154 DEPENDS+= \
155 +luci-sgi-haserl +luci-app-splash +luci-app-olsr \
156 +luci-app-ffwizard-leipzig \
157 +luci-theme-fledermaus \
158 +luci-i18n-german \
159 +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
160 +kmod-tun +ip
161 TITLE:=Freifunk Halle Community Meta-Package
162 endef
163
164 define Package/luci-ff-halle/install
165 $(call Package/luci/install/template,$(1),applications/community-halle)
166 $(CP) -a ./ipkg/luci-ff-halle.postinst $(1)/CONTROL/postinst
167 endef
168
169
170 define Package/luci-ff-leipzig
171 $(call Package/luci/fftemplate)
172 DEPENDS+= \
173 +luci-sgi-haserl +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 $(CP) -a ./ipkg/luci-ff-leipzig.postinst $(1)/CONTROL/postinst
185 endef
186
187
188 define Package/luci-ff-hannover
189 $(call Package/luci/fftemplate)
190 DEPENDS+= \
191 +luci-sgi-haserl +luci-app-splash +luci-app-olsr \
192 +luci-theme-fledermaus \
193 +luci-i18n-german \
194 +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
195 TITLE:=Freifunk Hannover Community Meta-Package
196 URL:=http://www.freifunk-hannover.de/
197 MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
198 endef
199
200 define Package/luci-ff-hannover/install
201 $(call Package/luci/install/template,$(1),applications/community-hannover)
202 $(CP) -a ./ipkg/luci-ff-hannover.postinst $(1)/CONTROL/postinst
203 endef
204
205
206 ### Modules ###
207
208 define Package/luci-mod-admin-core
209 $(call Package/luci/webtemplate)
210 DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english
211 TITLE:=Administration module
212 endef
213
214 define Package/luci-mod-admin-core/install
215 $(call Package/luci/install/template,$(1),modules/admin-core)
216 endef
217
218
219 define Package/luci-mod-freifunk
220 $(call Package/luci/fftemplate)
221 DEPENDS:=+luci-mod-admin-core
222 TITLE:=LuCI Freifunk module
223 endef
224
225 define Package/luci-mod-freifunk/conffiles
226 /etc/config/freifunk
227 endef
228
229 define Package/luci-mod-freifunk/install
230 $(call Package/luci/install/template,$(1),modules/freifunk)
231 endef
232
233
234
235 ### Applications ###
236
237 define Package/luci-app-ffwizard-leipzig
238 $(call Package/luci/fftemplate)
239 DEPENDS+=+luci-app-firewall
240 TITLE:=Freifunk Leipzig configuration wizard
241 endef
242
243 define Package/luci-app-ffwizard-leipzig/install
244 $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
245 endef
246
247
248 define Package/luci-app-firewall
249 $(call Package/luci/webtemplate)
250 DEPENDS+=+luci-mod-admin-core
251 TITLE:=Firewall and Portforwarding application
252 endef
253
254 define Package/luci-app-firewall/conffiles
255 /etc/config/luci_fw
256 endef
257
258 define Package/luci-app-firewall/install
259 $(call Package/luci/install/template,$(1),applications/luci-fw)
260 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-fw/dist/etc/init.d/luci_fw $(1)/etc/init.d
261 endef
262
263
264 define Package/luci-app-olsr
265 $(call Package/luci/webtemplate)
266 DEPENDS+=+luci-mod-admin-core +olsrd-mod-txtinfo
267 TITLE:=OLSR configuration and status module
268 endef
269
270 define Package/luci-app-olsr/install
271 $(call Package/luci/install/template,$(1),applications/luci-olsr)
272 endef
273
274
275 define Package/luci-app-qos
276 $(call Package/luci/webtemplate)
277 DEPENDS+=+luci-mod-admin-core +qos-scripts
278 TITLE:=Quality of Service configuration module
279 endef
280
281 define Package/luci-app-qos/install
282 $(call Package/luci/install/template,$(1),applications/luci-qos)
283 endef
284
285
286 define Package/luci-app-splash
287 $(call Package/luci/fftemplate)
288 DEPENDS+=+luci-sgi-haserl +iptables-mod-nat +iptables-mod-ipopt
289 TITLE:=Freifunk DHCP-Splash application
290 endef
291
292 define Package/luci-app-splash/conffiles
293 /etc/config/luci_splash
294 endef
295
296 define Package/luci-app-splash/install
297 $(call Package/luci/install/template,$(1),applications/luci-splash)
298 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
299 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
300 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely
301 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi $(1)/usr/lib/luci-splash/htdocs/cgi-bin
302 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash
303 endef
304
305
306 define Package/luci-app-statistics
307 $(call Package/luci/webtemplate)
308 DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
309 TITLE:=LuCI Statistics Application
310 endef
311
312 define Package/luci-app-statistics/conffiles
313 /etc/config/luci_statistics
314 endef
315
316 define Package/luci-app-statistics/install
317 $(call Package/luci/install/template,$(1),applications/luci-statistics)
318 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/usr/bin/stat-genconfig $(1)/usr/bin
319 $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/etc/init.d/luci_statistics $(1)/etc/init.d
320 $(CP) -a ./ipkg/luci-statistics.postinst $(1)/CONTROL/postinst
321 endef
322
323
324 ### Server Gateway Interfaces ###
325
326 define Package/luci-sgi-haserl
327 $(call Package/luci/libtemplate)
328 DEPENDS+=+luci-web +haserl-lua
329 TITLE:=SGI for Haserl
330 endef
331
332 define Package/luci-sgi-haserl/install
333 $(call Package/luci/install/template,$(1),libs/sgi-haserl)
334 $(CP) -a ./ipkg/luci-sgi-haserl.postinst $(1)/CONTROL/postinst
335 endef
336
337
338 define Package/luci-sgi-webuci
339 $(call Package/luci/libtemplate)
340 DEPENDS+=+luci-web
341 TITLE:=SGI for Webuci
342 endef
343
344 define Package/luci-sgi-webuci/install
345 $(call Package/luci/install/template,$(1),libs/sgi-webuci)
346 endef
347
348 ### Themes ###
349 define Package/luci-theme-fledermaus
350 $(call Package/luci/fftemplate)
351 DEPENDS:=+luci-web
352 TITLE:=Fledermaus Theme
353 endef
354
355 define Package/luci-theme-fledermaus/install
356 $(call Package/luci/install/template,$(1),themes/fledermaus)
357 endef
358
359 define Package/luci-theme-openwrt
360 $(call Package/luci/thtemplate)
361 TITLE:=OpenWRT.org (default)
362 endef
363
364 define Package/luci-theme-openwrt/install
365 $(call Package/luci/install/template,$(1),themes/openwrt.org)
366 endef
367
368 ### Translations ###
369 define Package/luci-i18n-german
370 $(call Package/luci/i18ntemplate)
371 TITLE:=German
372 endef
373
374 define Package/luci-i18n-german/install
375 $(call Package/luci/install/template,$(1),i18n/german)
376 endef
377
378
379 define Package/luci-i18n-english
380 $(call Package/luci/i18ntemplate)
381 TITLE:=English (incomplete)
382 endef
383
384 define Package/luci-i18n-english/install
385 $(call Package/luci/install/template,$(1),i18n/english)
386 endef
387
388
389
390 ### Compile ###
391 ifneq ($(CONFIG_PACKAGE_luci-core),)
392 PKG_SELECTED_MODULES+=libs/core
393 endif
394 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
395 PKG_SELECTED_MODULES+=libs/cbi
396 endif
397 ifneq ($(CONFIG_PACKAGE_luci-fastindex),)
398 PKG_SELECTED_MODULES+=libs/fastindex
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-haserl),)
444 PKG_SELECTED_MODULES+=libs/sgi-haserl
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-uci))
472 $(eval $(call BuildPackage,luci-web))
473
474 $(eval $(call BuildPackage,luci-ff-halle))
475 $(eval $(call BuildPackage,luci-ff-leipzig))
476 $(eval $(call BuildPackage,luci-ff-hannover))
477
478 $(eval $(call BuildPackage,luci-mod-admin-core))
479 $(eval $(call BuildPackage,luci-mod-freifunk))
480
481 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
482 $(eval $(call BuildPackage,luci-app-firewall))
483 $(eval $(call BuildPackage,luci-app-olsr))
484 $(eval $(call BuildPackage,luci-app-qos))
485 $(eval $(call BuildPackage,luci-app-splash))
486 $(eval $(call BuildPackage,luci-app-statistics))
487
488 $(eval $(call BuildPackage,luci-sgi-haserl))
489 $(eval $(call BuildPackage,luci-sgi-webuci))
490
491 $(eval $(call BuildPackage,luci-theme-fledermaus))
492 $(eval $(call BuildPackage,luci-theme-openwrt))
493
494 $(eval $(call BuildPackage,luci-i18n-german))
495 $(eval $(call BuildPackage,luci-i18n-english))