2ce1b8fef64ef89829e05a9f2c2f8b6e16edb45f
[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.4+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_DEPENDS:=lua-luci
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20
21 # LUA_TARGET:=compile LUAC=$(BUILD_DIR_HOST)/lua-luci/luac
22 LUA_TARGET:=source
23
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Build/Configure
28 endef
29
30 define Build/Compile
31         $(MAKE) -C$(PKG_BUILD_DIR) build LUA_TARGET=$(LUA_TARGET)
32 endef
33
34
35 define Package/ffluci/template
36   SECTION:=admin
37   CATEGORY:=Administration
38   TITLE:=FFLuCI - Freifunk Lua Configuration Interface
39   URL:=http://luci.freifunk-halle.net/
40   MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
41 endef
42
43 define Package/ffluci/install/template
44         $(CP) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
45 endef
46
47
48 define Package/ffluci
49   $(call Package/ffluci/template)
50   MENU:=1
51   DEPENDS:=+lua-luci +luaposix +luci-addons
52 endef
53
54 define Package/ffluci/conffiles
55 /etc/config/luci
56 endef
57
58 define Package/ffluci/install           
59         $(call Package/ffluci/install/template,$(1),core)
60         $(call Package/ffluci/install/template,$(1),themes/fledermaus)
61 endef
62
63
64 ### Community Packages ###
65
66 define Package/ffluci-ff-halle
67   $(call Package/ffluci/template)
68   DEPENDS:=ffluci \
69    +ffluci-sgi-haserl +ffluci-mod-freifunk +ffluci-app-splash \
70    +olsrd +olsrd-mod-dyn-gw +olsrd-mod-txtinfo +olsrd-mod-nameservice \
71    +kmod-tun +ip
72   TITLE:=Freifunk Halle Community Meta-Package
73 endef
74
75 define Package/ffluci-ff-halle/install
76 endef
77
78
79 define Package/ffluci-ff-leipzig
80   $(call Package/ffluci/template)
81   DEPENDS:=ffluci \
82    +ffluci-sgi-haserl +ffluci-mod-freifunk +ffluci-app-splash \
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/ffluci-ff-leipzig/install
89         $(call Package/ffluci/install/template,$(1),applications/community-leipzig)
90         $(CP) -a ./ipkg/ffluci-ff-leipzig.postinst $(1)/CONTROL/postinst
91 endef
92
93
94
95 ### Modules ###
96
97 define Package/ffluci-mod-admin-core
98   $(call Package/ffluci/template)
99   DEPENDS:=ffluci
100   TITLE:=Core administrative pages
101 endef
102
103 define Package/ffluci-mod-admin-core/install
104         $(call Package/ffluci/install/template,$(1),modules/admin-core)
105 endef
106
107
108 define Package/ffluci-mod-freifunk
109   $(call Package/ffluci/template)
110   DEPENDS:=ffluci +ffluci-mod-admin-core +ffluci-app-firewall
111   TITLE:=Freifunk public and administrative pages
112 endef
113
114 define Package/ffluci-mod-freifunk/conffiles
115 /etc/config/freifunk
116 endef
117
118 define Package/ffluci-mod-freifunk/install
119         $(call Package/ffluci/install/template,$(1),modules/freifunk)
120 endef
121
122
123
124 ### Applications ###
125
126 define Package/ffluci-app-firewall
127   $(call Package/ffluci/template)
128   DEPENDS:=ffluci +ffluci-mod-admin-core
129   TITLE:=Firewall and Portforwarding application
130 endef
131
132 define Package/ffluci-app-firewall/conffiles
133 /etc/config/luci_fw
134 endef
135
136 define Package/ffluci-app-firewall/install
137         $(call Package/ffluci/install/template,$(1),applications/luci-fw)
138         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-fw/dist/etc/init.d/luci_fw $(1)/etc/init.d
139 endef
140
141
142 define Package/ffluci-app-splash
143   $(call Package/ffluci/template)
144   DEPENDS:=ffluci +ffluci-mod-freifunk +ffluci-sgi-haserl +iptables-mod-nat +iptables-mod-ipopt
145   TITLE:=Freifunk DHCP-Splash application
146 endef
147
148 define Package/ffluci-app-splash/conffiles
149 /etc/config/luci_splash
150 endef
151
152 define Package/ffluci-app-splash/install
153         $(call Package/ffluci/install/template,$(1),applications/luci-splash)
154         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
155         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
156         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely
157         $(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
158         $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash
159 endef
160
161
162
163 ### Server Gateway Interfaces ###
164
165 define Package/ffluci-sgi-haserl
166   $(call Package/ffluci/template)
167   DEPENDS:=ffluci +haserl-lua
168   TITLE:=SGI for Haserl
169 endef
170
171 define Package/ffluci-sgi-haserl/install
172         $(call Package/ffluci/install/template,$(1),applications/sgi-haserl)
173         $(CP) -a ./ipkg/ffluci-sgi-haserl.postinst $(1)/CONTROL/postinst
174 endef
175
176
177 define Package/ffluci-sgi-webuci
178   $(call Package/ffluci/template)
179   DEPENDS:=ffluci
180   TITLE:=SGI for Webuci
181 endef
182
183 define Package/ffluci-sgi-webuci/install
184         $(call Package/ffluci/install/template,$(1),applications/sgi-webuci)
185 endef
186
187
188
189
190 $(eval $(call BuildPackage,ffluci))
191
192 $(eval $(call BuildPackage,ffluci-ff-halle))
193 $(eval $(call BuildPackage,ffluci-ff-leipzig))
194
195 $(eval $(call BuildPackage,ffluci-mod-admin-core))
196 $(eval $(call BuildPackage,ffluci-mod-freifunk))
197
198 $(eval $(call BuildPackage,ffluci-app-firewall))
199 $(eval $(call BuildPackage,ffluci-app-splash))
200
201 $(eval $(call BuildPackage,ffluci-sgi-haserl))
202 $(eval $(call BuildPackage,ffluci-sgi-webuci))