include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git
config PACKAGE_uhttpd_debug
bool "Build with debug messages"
default n
+ config uhttpd_lua
+ depends on PACKAGE_uhttpd-mod-lua
+ bool "Enable Integrated Lua interpreter"
+ default y
endef
-
define Package/uhttpd-mod-lua
$(Package/uhttpd/default)
TITLE+= (Lua plugin)
$(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
endef
+define Package/uhttpd-mod-lua/postinst
+ $(if $(CONFIG_uhttpd_lua),
+ #!/bin/sh
+ if [ -f $${IPKG_INSTROOT}/www/index.html ]
+ then
+ sed -e 's:/cgi-bin::g' -i $${IPKG_INSTROOT}/www/index.html
+ fi
+ ,)
+endef
+
$(eval $(call BuildPackage,uhttpd))
$(eval $(call BuildPackage,uhttpd-mod-lua))
# Lua url prefix and handler script.
# Lua support is disabled if no prefix given.
-# option lua_prefix /luci
-# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua
+ option lua_prefix /luci
+ option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua
# Specify the ubus-rpc prefix and socket path.
# option ubus_prefix /ubus