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