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