* Core translation part 1
[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
29 define Build/Compile 
30         for i in $(PKG_SELECTED_MODULES); do $(MAKE) -C$(PKG_BUILD_DIR)/$$$$i build LUA_TARGET=$(LUA_TARGET); done
31 endef
32
33 ### Templates ###
34
35 define Package/luci/libtemplate
36   SECTION:=admin
37   CATEGORY:=Administration
38   TITLE:=LuCI - Lua Configuration Interface
39   URL:=http://luci.freifunk-halle.net/
40   MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
41   SUBMENU:=LuCI - Libraries
42   DEPENDS:=+luci-core
43 endef
44
45 define Package/luci/fftemplate
46   $(call Package/luci/libtemplate)
47   SUBMENU:=LuCI - Freifunk Support
48   DEPENDS:=+luci-mod-freifunk
49 endef
50
51 define Package/luci/thtemplate
52   $(call Package/luci/libtemplate)
53   SUBMENU:=LuCI - Themes
54   DEPENDS:=+luci-web
55 endef
56
57 define Package/luci/webtemplate
58   $(call Package/luci/libtemplate)
59   SUBMENU:=LuCI - Webinterface Components
60 endef
61
62
63 define Package/luci/install/template
64         $(CP) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
65 endef
66
67
68
69 ### Core package ###
70
71 define Package/luci-core
72   $(call Package/luci/libtemplate)
73   DEPENDS:=+lua +luaposix
74   TITLE:=LuCI core libraries
75 endef
76
77 define Package/luci-core/install                
78         $(call Package/luci/install/template,$(1),libs/core)
79 endef
80
81 define Package/luci-core/config
82        choice
83                prompt "Build Target"
84                default PACKAGE_luci-core_compile
85
86        config PACKAGE_luci-core_compile
87                bool "Production"
88
89        config PACKAGE_luci-core_source
90                bool "Debug"
91
92        endchoice
93 endef
94
95 ifneq ($(CONFIG_PACKAGE_luci-core_compile),)
96         LUA_TARGET:=compile
97 endif
98
99
100 ### Libraries ###
101 define Package/luci-cbi
102   $(call Package/luci/libtemplate)
103   DEPENDS+=+luci-web
104   TITLE:=Configuration Binding Interface
105 endef
106
107 define Package/luci-cbi/install
108         $(call Package/luci/install/template,$(1),libs/cbi)
109 endef
110
111
112 define Package/luci-web
113   $(call Package/luci/libtemplate)
114   DEPENDS+=+luci-addons
115   TITLE:=MVC Webframework
116 endef
117
118 define Package/luci-web/conffiles
119 /etc/config/luci
120 endef
121
122 define Package/luci-web/install
123         $(call Package/luci/install/template,$(1),libs/web)
124 endef
125
126
127
128 ### Community Packages ###
129
130 define Package/luci-ff-halle
131   $(call Package/luci/fftemplate)
132   DEPENDS+= \
133    +luci-sgi-haserl +luci-app-splash \
134    +luci-app-ffwizard-leipzig \
135    +luci-theme-fledermaus \
136    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
137    +kmod-tun +ip
138   TITLE:=Freifunk Halle Community Meta-Package
139 endef
140
141 define Package/luci-ff-halle/install
142         $(call Package/luci/install/template,$(1),applications/community-halle)
143         $(CP) -a ./ipkg/luci-ff-halle.postinst $(1)/CONTROL/postinst
144 endef
145
146
147 define Package/luci-ff-leipzig
148   $(call Package/luci/fftemplate)
149   DEPENDS+= \
150    +luci-sgi-haserl +luci-app-splash \
151    +luci-app-ffwizard-leipzig \
152    +luci-theme-fledermaus \
153    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
154    +kmod-tun +ip
155   TITLE:=Freifunk Leipzig Community Meta-Package
156 endef
157
158 define Package/luci-ff-leipzig/install
159         $(call Package/luci/install/template,$(1),applications/community-leipzig)
160         $(CP) -a ./ipkg/luci-ff-leipzig.postinst $(1)/CONTROL/postinst
161 endef
162
163
164 define Package/luci-ff-hannover
165   $(call Package/luci/fftemplate)
166   DEPENDS+= \
167    +luci-sgi-haserl +luci-app-splash \
168    +luci-theme-fledermaus \
169    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
170   TITLE:=Freifunk Hannover Community Meta-Package
171   URL:=http://www.freifunk-hannover.de/
172   MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
173 endef
174
175 define Package/luci-ff-hannover/install
176         $(call Package/luci/install/template,$(1),applications/community-hannover)
177         $(CP) -a ./ipkg/luci-ff-hannover.postinst $(1)/CONTROL/postinst
178 endef
179
180
181 ### Modules ###
182
183 define Package/luci-mod-admin-core
184   $(call Package/luci/webtemplate)
185   DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt
186   TITLE:=Administration module
187 endef
188
189 define Package/luci-mod-admin-core/install
190         $(call Package/luci/install/template,$(1),modules/admin-core)
191 endef
192
193
194 define Package/luci-mod-freifunk
195   $(call Package/luci/fftemplate)
196   DEPENDS:=+luci-mod-admin-core
197   TITLE:=LuCI Freifunk module
198 endef
199
200 define Package/luci-mod-freifunk/conffiles
201 /etc/config/freifunk
202 endef
203
204 define Package/luci-mod-freifunk/install
205         $(call Package/luci/install/template,$(1),modules/freifunk)
206 endef
207
208
209
210 ### Applications ###
211
212 define Package/luci-app-ffwizard-leipzig
213   $(call Package/luci/fftemplate)
214   DEPENDS+=+luci-app-firewall
215   TITLE:=Freifunk Leipzig configuration wizard
216 endef
217
218 define Package/luci-app-ffwizard-leipzig/install
219         $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
220 endef
221
222
223 define Package/luci-app-firewall
224   $(call Package/luci/webtemplate)
225   DEPENDS+=+luci-mod-admin-core
226   TITLE:=Firewall and Portforwarding application
227 endef
228
229 define Package/luci-app-firewall/conffiles
230 /etc/config/luci_fw
231 endef
232
233 define Package/luci-app-firewall/install
234         $(call Package/luci/install/template,$(1),applications/luci-fw)
235         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-fw/dist/etc/init.d/luci_fw $(1)/etc/init.d
236 endef
237
238
239 define Package/luci-app-splash
240   $(call Package/luci/fftemplate)
241   DEPENDS+=+luci-sgi-haserl +iptables-mod-nat +iptables-mod-ipopt
242   TITLE:=Freifunk DHCP-Splash application
243 endef
244
245 define Package/luci-app-splash/conffiles
246 /etc/config/luci_splash
247 endef
248
249 define Package/luci-app-splash/install
250         $(call Package/luci/install/template,$(1),applications/luci-splash)
251         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
252         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
253         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely
254         $(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
255         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash
256 endef
257
258
259 define Package/luci-app-statistics
260   $(call Package/luci/webtemplate)
261   DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
262   TITLE:=LuCI Statistics Application (incomplete)
263 endef
264
265 define Package/luci-app-statistics/conffiles
266 /etc/config/luci_statistics
267 endef
268
269 define Package/luci-app-statistics/install
270         $(call Package/luci/install/template,$(1),applications/luci-statistics)
271         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/usr/bin/stat-genconfig $(1)/usr/bin
272         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/etc/init.d/luci_statistics $(1)/etc/init.d
273 endef
274
275
276 ### Server Gateway Interfaces ###
277
278 define Package/luci-sgi-haserl
279   $(call Package/luci/libtemplate)
280   DEPENDS+=+luci-web +haserl-lua
281   TITLE:=SGI for Haserl
282 endef
283
284 define Package/luci-sgi-haserl/install
285         $(call Package/luci/install/template,$(1),libs/sgi-haserl)
286         $(CP) -a ./ipkg/luci-sgi-haserl.postinst $(1)/CONTROL/postinst
287 endef
288
289
290 define Package/luci-sgi-webuci
291   $(call Package/luci/libtemplate)
292   DEPENDS+=+luci-web
293   TITLE:=SGI for Webuci
294 endef
295
296 define Package/luci-sgi-webuci/install
297         $(call Package/luci/install/template,$(1),libs/sgi-webuci)
298 endef
299
300 ### Templates ###
301 define Package/luci-theme-fledermaus
302   $(call Package/luci/thtemplate)
303   TITLE:=Fledermaus (Freifunk theme)
304 endef
305
306 define Package/luci-theme-fledermaus/install
307         $(call Package/luci/install/template,$(1),themes/fledermaus)
308 endef
309
310 define Package/luci-theme-openwrt
311   $(call Package/luci/thtemplate)
312   TITLE:=OpenWRT.org (default)
313 endef
314
315 define Package/luci-theme-openwrt/install
316         $(call Package/luci/install/template,$(1),themes/openwrt.org)
317 endef
318
319
320 ### Compile ###
321 ifneq ($(CONFIG_PACKAGE_luci-core),)
322         PKG_SELECTED_MODULES+=libs/core
323 endif
324 ifneq ($(CONFIG_PACKAGE_luci-cbi),)
325         PKG_SELECTED_MODULES+=libs/cbi
326 endif
327 ifneq ($(CONFIG_PACKAGE_luci-web),)
328         PKG_SELECTED_MODULES+=libs/web
329 endif
330
331 ifneq ($(CONFIG_PACKAGE_luci-ff-halle),)
332         PKG_SELECTED_MODULES+=applications/community-halle
333 endif
334 ifneq ($(CONFIG_PACKAGE_luci-ff-leipzig),)
335         PKG_SELECTED_MODULES+=applications/community-leipzig
336 endif
337 ifneq ($(CONFIG_PACKAGE_luci-ff-hannover),)
338         PKG_SELECTED_MODULES+=applications/community-hannover
339 endif
340
341 ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),)
342         PKG_SELECTED_MODULES+=modules/admin-core
343 endif
344 ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),)
345         PKG_SELECTED_MODULES+=modules/freifunk
346 endif
347
348 ifneq ($(CONFIG_PACKAGE_luci-app-ffwizard-leipzig),)
349         PKG_SELECTED_MODULES+=applications/luci-ffwizard-leipzig
350 endif
351 ifneq ($(CONFIG_PACKAGE_luci-app-firewall),)
352         PKG_SELECTED_MODULES+=applications/luci-fw
353 endif
354 ifneq ($(CONFIG_PACKAGE_luci-app-splash),)
355         PKG_SELECTED_MODULES+=applications/luci-splash
356 endif
357 ifneq ($(CONFIG_PACKAGE_luci-app-statistics),)
358         PKG_SELECTED_MODULES+=applications/luci-statistics
359 endif
360
361 ifneq ($(CONFIG_PACKAGE_luci-sgi-haserl),)
362         PKG_SELECTED_MODULES+=libs/sgi-haserl
363 endif
364 ifneq ($(CONFIG_PACKAGE_luci-sgi-webuci),)
365         PKG_SELECTED_MODULES+=libs/sgi-webuci
366 endif
367
368 ifneq ($(CONFIG_PACKAGE_luci-theme-fledermaus),)
369         PKG_SELECTED_MODULES+=themes/fledermaus
370 endif
371 ifneq ($(CONFIG_PACKAGE_luci-theme-openwrt),)
372         PKG_SELECTED_MODULES+=themes/openwrt.org
373 endif
374
375
376 $(eval $(call BuildPackage,luci-core))
377 $(eval $(call BuildPackage,luci-cbi))
378 $(eval $(call BuildPackage,luci-web))
379
380 $(eval $(call BuildPackage,luci-ff-halle))
381 $(eval $(call BuildPackage,luci-ff-leipzig))
382 $(eval $(call BuildPackage,luci-ff-hannover))
383
384 $(eval $(call BuildPackage,luci-mod-admin-core))
385 $(eval $(call BuildPackage,luci-mod-freifunk))
386
387 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
388 $(eval $(call BuildPackage,luci-app-firewall))
389 $(eval $(call BuildPackage,luci-app-splash))
390 $(eval $(call BuildPackage,luci-app-statistics))
391
392 $(eval $(call BuildPackage,luci-sgi-haserl))
393 $(eval $(call BuildPackage,luci-sgi-webuci))
394
395 $(eval $(call BuildPackage,luci-theme-fledermaus))
396 $(eval $(call BuildPackage,luci-theme-openwrt))