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