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