* Separated CBI from LuCI Web
[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
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Build/Configure
26 endef
27
28 define Build/Compile
29         $(MAKE) -C$(PKG_BUILD_DIR) build LUA_TARGET=$(LUA_TARGET)
30 endef
31
32
33 define Package/luci/template
34   SECTION:=admin
35   CATEGORY:=Administration
36   TITLE:=LuCI - Lua Configuration Interface
37   URL:=http://luci.freifunk-halle.net/
38   MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
39 endef
40
41 define Package/luci/install/template
42         $(CP) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
43 endef
44
45
46 define Package/luci
47   $(call Package/luci/template)
48   MENU:=1
49   DEPENDS:=+lua +luaposix
50 endef
51
52 define Package/luci/install             
53         $(call Package/luci/install/template,$(1),core)
54 endef
55
56
57 ### Web Packages ###
58 define Package/luci-web
59   $(call Package/luci/template)
60   DEPENDS:=luci +luci-addons
61   TITLE:=LuCI - Webframework
62 endef
63
64 define Package/luci-web/conffiles
65 /etc/config/luci
66 endef
67
68 define Package/luci-web/install
69         $(call Package/luci/install/template,$(1),web)
70         $(call Package/luci/install/template,$(1),themes/fledermaus)
71 endef
72
73
74
75 ### Community Packages ###
76
77 define Package/luci-ff-halle
78   $(call Package/luci/template)
79   DEPENDS:=luci \
80    +luci-sgi-haserl +luci-mod-freifunk +luci-app-splash \
81    +luci-app-ffwizard-leipzig \
82    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
83    +kmod-tun +ip
84   TITLE:=Freifunk Halle Community Meta-Package
85 endef
86
87 define Package/luci-ff-halle/install
88 endef
89
90
91 define Package/luci-ff-leipzig
92   $(call Package/luci/template)
93   DEPENDS:=luci \
94    +luci-sgi-haserl +luci-mod-freifunk +luci-app-splash \
95    +luci-app-ffwizard-leipzig \
96    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
97    +kmod-tun +ip
98   TITLE:=Freifunk Leipzig Community Meta-Package
99 endef
100
101 define Package/luci-ff-leipzig/install
102         $(call Package/luci/install/template,$(1),applications/community-leipzig)
103         $(CP) -a ./ipkg/luci-ff-leipzig.postinst $(1)/CONTROL/postinst
104 endef
105
106
107 define Package/luci-ff-hannover
108   $(call Package/luci/template)
109   DEPENDS:=luci \
110    +luci-sgi-haserl +luci-mod-freifunk +luci-app-splash \
111    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice
112   TITLE:=Freifunk Hannover Community Meta-Package
113   URL:=http://www.freifunk-hannover.de/
114   MAINTAINER:=Mickey Knox <mickey-at-netfreaks-dot-org>
115 endef
116
117 define Package/luci-ff-hannover/install
118         $(call Package/luci/install/template,$(1),applications/community-hannover)
119         $(CP) -a ./ipkg/luci-ff-hannover.postinst $(1)/CONTROL/postinst
120 endef
121
122
123 ### Modules ###
124
125 define Package/luci-mod-admin-core
126   $(call Package/luci/template)
127   DEPENDS:=luci +luci-web +luci-app-cbi
128   TITLE:=Core administrative pages
129 endef
130
131 define Package/luci-mod-admin-core/install
132         $(call Package/luci/install/template,$(1),modules/admin-core)
133 endef
134
135
136 define Package/luci-mod-freifunk
137   $(call Package/luci/template)
138   DEPENDS:=luci +luci-mod-admin-core +luci-app-firewall
139   TITLE:=Freifunk public and administrative pages
140 endef
141
142 define Package/luci-mod-freifunk/conffiles
143 /etc/config/freifunk
144 endef
145
146 define Package/luci-mod-freifunk/install
147         $(call Package/luci/install/template,$(1),modules/freifunk)
148 endef
149
150
151
152 ### Applications ###
153
154 define Package/luci-app-cbi
155   $(call Package/luci/template)
156   DEPENDS:=luci +luci-web
157   TITLE:=Configuration Binding Interface
158 endef
159
160 define Package/luci-app-cbi/install
161         $(call Package/luci/install/template,$(1),applications/cbi)
162 endef
163
164
165 define Package/luci-app-ffwizard-leipzig
166   $(call Package/luci/template)
167   DEPENDS:=luci +luci-mod-freifunk
168   TITLE:=Freifunk Leipzig configuration wizard
169 endef
170
171 define Package/luci-app-ffwizard-leipzig/install
172         $(call Package/luci/install/template,$(1),applications/luci-ffwizard-leipzig)
173 endef
174
175
176 define Package/luci-app-firewall
177   $(call Package/luci/template)
178   DEPENDS:=luci +luci-mod-admin-core
179   TITLE:=Firewall and Portforwarding application
180 endef
181
182 define Package/luci-app-firewall/conffiles
183 /etc/config/luci_fw
184 endef
185
186 define Package/luci-app-firewall/install
187         $(call Package/luci/install/template,$(1),applications/luci-fw)
188         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-fw/dist/etc/init.d/luci_fw $(1)/etc/init.d
189 endef
190
191
192 define Package/luci-app-splash
193   $(call Package/luci/template)
194   DEPENDS:=luci +luci-mod-freifunk +luci-sgi-haserl +iptables-mod-nat +iptables-mod-ipopt
195   TITLE:=Freifunk DHCP-Splash application
196 endef
197
198 define Package/luci-app-splash/conffiles
199 /etc/config/luci_splash
200 endef
201
202 define Package/luci-app-splash/install
203         $(call Package/luci/install/template,$(1),applications/luci-splash)
204         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
205         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
206         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely
207         $(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
208         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash
209 endef
210
211
212 define Package/luci-app-statistics
213   $(call Package/luci/template)
214   DEPENDS:=luci +luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1
215   TITLE:=LuCI Statistics Application (incomplete)
216 endef
217
218 define Package/luci-app-statistics/conffiles
219 /etc/config/luci_statistics
220 endef
221
222 define Package/luci-app-statistics/install
223         $(call Package/luci/install/template,$(1),applications/luci-statistics)
224         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/usr/bin/stat-genconfig $(1)/usr/bin
225         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-statistics/dist/etc/init.d/luci_statistics $(1)/etc/init.d
226 endef
227
228
229 ### Server Gateway Interfaces ###
230
231 define Package/luci-sgi-haserl
232   $(call Package/luci/template)
233   DEPENDS:=luci +luci-web +haserl-lua
234   TITLE:=SGI for Haserl
235 endef
236
237 define Package/luci-sgi-haserl/install
238         $(call Package/luci/install/template,$(1),applications/sgi-haserl)
239         $(CP) -a ./ipkg/luci-sgi-haserl.postinst $(1)/CONTROL/postinst
240 endef
241
242
243 define Package/luci-sgi-webuci
244   $(call Package/luci/template)
245   DEPENDS:=luci +luci-web
246   TITLE:=SGI for Webuci
247 endef
248
249 define Package/luci-sgi-webuci/install
250         $(call Package/luci/install/template,$(1),applications/sgi-webuci)
251 endef
252
253
254
255
256 $(eval $(call BuildPackage,luci))
257 $(eval $(call BuildPackage,luci-web))
258
259 $(eval $(call BuildPackage,luci-ff-halle))
260 $(eval $(call BuildPackage,luci-ff-leipzig))
261 $(eval $(call BuildPackage,luci-ff-hannover))
262
263 $(eval $(call BuildPackage,luci-mod-admin-core))
264 $(eval $(call BuildPackage,luci-mod-freifunk))
265
266 $(eval $(call BuildPackage,luci-app-cbi))
267 $(eval $(call BuildPackage,luci-app-ffwizard-leipzig))
268 $(eval $(call BuildPackage,luci-app-firewall))
269 $(eval $(call BuildPackage,luci-app-splash))
270 $(eval $(call BuildPackage,luci-app-statistics))
271
272 $(eval $(call BuildPackage,luci-sgi-haserl))
273 $(eval $(call BuildPackage,luci-sgi-webuci))