1 include $(TOPDIR)/rules.mk
10 PKG_VERSION:=$(shell $(LUCI_TOPDIR)/build/mkrevision.sh 2>/dev/null || echo unknown)
12 PKG_BUILD_DEPENDS:=$(if $(STAGING_DIR_ROOT),lua/host)
13 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
14 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20 LUCI_SELECTED_MODULES:=
22 ifeq ($(BOARD),brcm-2.4)
23 MAKE_FLAGS += CRAP="1"
28 define Package/luci/install/template
29 $(CP) -a $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
30 $(CP) -a $(PKG_BUILD_DIR)/$(2)/ipkg/* $(1)/CONTROL/ 2>/dev/null || true
35 define Package/luci-base
38 TITLE:=LuCI - Lua Configuration Interface
39 URL:=http://luci.subsignal.org/
40 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
42 DEPENDS:=+lua +libuci-lua +libubus-lua
43 TITLE:=LuCI core libraries
46 define Package/luci-base/install
47 $(call Package/luci/install/template,$(1),modules/base)
48 $(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
55 define Package/luci-base/config
58 default PACKAGE_luci-base_source
60 config PACKAGE_luci-base_compile
63 config PACKAGE_luci-base_stripped
66 config PACKAGE_luci-base_srcdiet
67 bool "Compressed Source"
69 config PACKAGE_luci-base_source
75 define Package/luci-base/conffiles
79 ifneq ($(CONFIG_PACKAGE_luci-base_compile),)
83 ifneq ($(CONFIG_PACKAGE_luci-base_stripped),)
87 ifneq ($(CONFIG_PACKAGE_luci-base_srcdiet),)
91 ifneq ($(CONFIG_PACKAGE_luci-base),)
92 LUCI_SELECTED_MODULES+=modules/base
95 LUCI_BUILD_PACKAGES += luci-base
100 define Package/luci-lib-$(1)
103 TITLE:=LuCI - Lua Configuration Interface
104 URL:=http://luci.subsignal.org/
105 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
106 SUBMENU:=8. Libraries
107 TITLE:=$(if $(2),$(2),LuCI $(1) library)
108 $(if $(3),DEPENDS:=+luci-base $(3))
111 define Package/luci-lib-$(1)/install
112 $(call Package/luci/install/template,$$(1),libs/$(1))
113 $(call Package/luci-lib-$(1)/extra-install)
116 ifneq ($(CONFIG_PACKAGE_luci-lib-$(1)),)
117 LUCI_SELECTED_MODULES+=libs/$(1)
120 LUCI_BUILD_PACKAGES += luci-lib-$(1)
123 define Package/luci-lib-nixio/config
125 prompt "TLS Provider"
126 default PACKAGE_luci-lib-nixio_notls
128 config PACKAGE_luci-lib-nixio_notls
131 config PACKAGE_luci-lib-nixio_axtls
132 bool "Builtin (axTLS)"
134 config PACKAGE_luci-lib-nixio_cyassl
136 select PACKAGE_libcyassl
138 config PACKAGE_luci-lib-nixio_openssl
140 select PACKAGE_libopenssl
147 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_axtls),)
151 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_openssl),)
155 ifneq ($(CONFIG_PACKAGE_luci-lib-nixio_cyassl),)
157 LUCI_CFLAGS+=-I$(STAGING_DIR)/usr/include/cyassl
161 $(eval $(call library,httpclient,HTTP(S) client library,+luci-base +luci-lib-nixio))
162 $(eval $(call library,json,LuCI JSON library))
163 $(eval $(call library,nixio,NIXIO POSIX library,+PACKAGE_luci-lib-nixio_openssl:libopenssl +PACKAGE_luci-lib-nixio_cyassl:libcyassl))
164 $(eval $(call library,px5g,RSA/X.509 Key Generator (required for LuCId SSL support),+luci-lib-nixio))
165 $(eval $(call library,luaneightbl,neightbl - Lua lib for IPv6 neighbors,+luci-base))
170 define Package/luci-proto-$(1)
173 TITLE:=LuCI - Lua Configuration Interface
174 URL:=http://luci.subsignal.org/
175 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
176 SUBMENU:=6. Protocols
177 TITLE:=$(if $(2),$(2),LuCI $(1) protocol support)
181 define Package/luci-proto-$(1)/install
182 $(call Package/luci/install/template,$$(1),protocols/$(1))
185 ifneq ($(CONFIG_PACKAGE_luci-proto-$(1)),)
186 LUCI_SELECTED_MODULES+=protocols/$(1)
189 LUCI_BUILD_PACKAGES += luci-proto-$(1)
192 $(eval $(call protocol,ppp,Support for PPP/PPPoE/PPPoA/PPtP))
193 $(eval $(call protocol,ipv6,Support for DHCPv6/6in4/6to4/6rd/DS-Lite))
194 $(eval $(call protocol,3g,Support for 3G,+PACKAGE_luci-proto-3g:comgt))
195 $(eval $(call protocol,relay,Support for relayd pseudo bridges,+PACKAGE_luci-proto-relay:relayd))
200 define Package/luci-mod-$(1)
203 TITLE:=LuCI - Lua Configuration Interface
204 URL:=http://luci.subsignal.org/
205 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
207 TITLE:=$(if $(2),$(2),LuCI $(1) module)
208 $(if $(3),DEPENDS+=$(3))
211 define Package/luci-mod-$(1)/install
212 $(call Package/luci/install/template,$$(1),modules/$(1))
213 $(call Package/luci-mod-$(1)/extra-install)
216 ifneq ($(CONFIG_PACKAGE_luci-mod-$(1)),)
217 LUCI_SELECTED_MODULES+=modules/$(1)
220 LUCI_BUILD_PACKAGES += luci-mod-$(1)
224 $(eval $(call module,admin-mini,LuCI Essentials - stripped down and user-friendly,+luci-base @BROKEN))
225 $(eval $(call module,admin-full,LuCI Administration - full-featured for full control,+luci-base))
226 $(eval $(call module,failsafe,LuCI Fail-Safe - Fail-Safe sysupgrade module,+luci-base))
227 $(eval $(call module,rpc,LuCI RPC - JSON-RPC API,+luci-lib-json))
232 define Package/luci-app-$(1)
235 TITLE:=LuCI - Lua Configuration Interface
236 URL:=http://luci.subsignal.org/
237 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
238 SUBMENU:=3. Applications
239 TITLE:=$(if $(2),$(2),LuCI $(1) application)
243 define Package/luci-app-$(1)/install
244 $(call Package/luci/install/template,$$(1),applications/luci-$(1))
247 ifneq ($(CONFIG_PACKAGE_luci-app-$(1)),)
248 LUCI_SELECTED_MODULES+=applications/luci-$(1)
251 LUCI_BUILD_PACKAGES += luci-app-$(1)
255 $(eval $(call application,firewall,Firewall and Portforwarding application,\
256 +PACKAGE_luci-app-firewall:firewall))
258 $(eval $(call application,qos,Quality of Service configuration module,\
259 +PACKAGE_luci-app-qos:qos-scripts))
261 $(eval $(call application,commands,LuCI Shell Command Module))
266 define Package/luci-theme-$(1)
269 TITLE:=LuCI - Lua Configuration Interface
270 URL:=http://luci.subsignal.org/
272 TITLE:=$(if $(2),$(2),LuCI $(1) theme)
273 MAINTAINER:=$(if $(3),$(3),LuCI Development Team <luci@lists.subsignal.org>)
276 define Package/luci-theme-$(1)/install
277 $(call Package/luci/install/template,$$(1),themes/$(1))
280 ifneq ($(CONFIG_PACKAGE_luci-theme-$(1)),)
281 LUCI_SELECTED_MODULES+=themes/$(1)
284 LUCI_BUILD_PACKAGES += luci-theme-$(1)
287 $(eval $(call theme,openwrt,OpenWrt.org))
288 $(eval $(call theme,bootstrap,Bootstrap Theme (default)))
293 define Package/luci-i18n-$(1)
296 TITLE:=LuCI - Lua Configuration Interface
297 URL:=http://luci.subsignal.org/
298 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
299 SUBMENU:=5. Translations
300 TITLE:=$(if $(2),$(2),$(1))
303 define Package/luci-i18n-$(1)/install
304 $(call Package/luci/install/template,$$(1),i18n/$(1))
307 ifneq ($(CONFIG_PACKAGE_luci-i18n-$(1)),)
308 LUCI_SELECTED_MODULES+=i18n/$(1)
311 LUCI_BUILD_PACKAGES += luci-i18n-$(1)
314 $(eval $(call translation,german,German))
315 $(eval $(call translation,english,English))
316 $(eval $(call translation,french,French (by Florian Fainelli)))
317 $(eval $(call translation,italian,Italian (by Matteo Croce)))
318 $(eval $(call translation,russian,Russian (by Skryabin Dmitry)))
319 $(eval $(call translation,portuguese-brazilian,Portuguese (Brazilian) (by Carlos Cesario)))
320 $(eval $(call translation,chinese,Chinese (by Chinese Translators)))
321 $(eval $(call translation,japanese,Japanese (by Tsukasa Hamano)))
322 $(eval $(call translation,greek,Greek (by Vasilis Tsiligiannis)))
323 $(eval $(call translation,catalan,Catalan (by Eduard Duran)))
324 $(eval $(call translation,portuguese,Portuguese (by Jose Monteiro)))
325 $(eval $(call translation,spanish,Spanish (by Guillermo Javier Nardoni)))
326 $(eval $(call translation,vietnamese,Vietnamese (by Hong Phuc Dang)))
327 $(eval $(call translation,malay,Malay (by Teow Wai Chet)))
328 $(eval $(call translation,norwegian,Norwegian (by Lars Hardy)))
329 $(eval $(call translation,hebrew,Hebrew))
330 $(eval $(call translation,romanian,Romanian))
331 $(eval $(call translation,ukrainian,Ukrainian))
332 $(eval $(call translation,hungarian,Hungarian))
333 $(eval $(call translation,polish,Polish))
338 define Package/luci$(if $(1),-$(1))
341 TITLE:=LuCI - Lua Configuration Interface
342 URL:=http://luci.subsignal.org/
343 MAINTAINER:=LuCI Development Team <luci@lists.subsignal.org>
344 SUBMENU:=1. Collections
345 TITLE:=$(if $(2),$(2),LuCI $(if $(1),$(1),general) collection)
346 $(if $(3),DEPENDS:=$(3))
349 define Package/luci$(if $(1),-$(1))/install
353 LUCI_BUILD_PACKAGES += luci$(if $(1),-$(1))
356 $(eval $(call collection,,\
357 Standard OpenWrt set including full admin with ppp support and the \
358 default OpenWrt theme,\
359 +uhttpd +uhttpd-mod-ubus +luci-mod-admin-full +luci-theme-bootstrap \
360 +luci-app-firewall +luci-proto-ppp +libiwinfo-lua))
362 $(eval $(call collection,ssl,\
363 Standard OpenWrt set with HTTPS support,\
364 +luci +libustream-polarssl +px5g))
366 $(eval $(call collection,light,\
367 Minimum package set using only admin mini and the standard theme,\
368 +uhttpd +luci-mod-admin-mini +luci-theme-openwrt @BROKEN))
372 PKG_CONFIG_DEPENDS=$(patsubst %,CONFIG_PACKAGE_%,$(LUCI_BUILD_PACKAGES))
374 include $(INCLUDE_DIR)/package.mk
377 @if [ ! -x $(LUCI_TOPDIR)/build/mkrevision.sh ]; then \
378 echo "*** Repository layout changed!" >&2; \
379 echo "*** Please change the LuCI url in feeds.conf to http://svn.luci.subsignal.org/luci/trunk and reinstall the feed with" >&2; \
380 echo "*** ./scripts/feeds update luci; ./scripts/feeds install -a -p luci" >&2; \
383 mkdir -p $(PKG_BUILD_DIR)
384 $(TAR) c -C $(LUCI_TOPDIR) . \
385 --exclude=.pc --exclude=.svn --exclude=.git \
386 --exclude='*.o' --exclude='*.so' \
388 tar x -C $(PKG_BUILD_DIR)/
389 $(call Build/Prepare/Default)
392 define Build/Configure
396 MODULES="$(LUCI_SELECTED_MODULES)" \
397 LUA_TARGET="$(LUA_TARGET)" \
398 LUA_SHLIBS="-llua -lm -ldl -lcrypt" \
399 CFLAGS="$(TARGET_CFLAGS) $(LUCI_CFLAGS) -I$(STAGING_DIR)/usr/include" \
400 LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
401 NIXIO_TLS="$(NIXIO_TLS)" OS="Linux"
404 $(foreach b,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(b))))