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