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