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