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
-endef
-
-
-define Package/uhttpd-mod-tls
- $(Package/uhttpd/default)
- TITLE+= (TLS plugin)
- DEPENDS:=uhttpd \
- +PACKAGE_uhttpd-mod-tls_polarssl:libustream-polarssl \
- +PACKAGE_uhttpd-mod-tls_mbedtls:libustream-mbedtls \
- +PACKAGE_uhttpd-mod-tls_cyassl:libustream-cyassl \
- +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
-endef
-
-define Package/uhttpd-mod-tls/description
- The TLS plugin adds HTTPS support to uHTTPd.
-endef
-
-define Package/uhttpd-mod-tls/config
- choice
- depends on PACKAGE_uhttpd-mod-tls
- prompt "TLS Provider"
- default PACKAGE_uhttpd-mod-tls_polarssl
-
- config PACKAGE_uhttpd-mod-tls_mbedtls
- bool "mbedTLS"
-
- config PACKAGE_uhttpd-mod-tls_polarssl
- bool "PolarSSL"
-
- config PACKAGE_uhttpd-mod-tls_cyassl
- bool "CyaSSL"
-
- config PACKAGE_uhttpd-mod-tls_openssl
- bool "OpenSSL"
- endchoice
+ config uhttpd_lua
+ depends on PACKAGE_uhttpd-mod-lua
+ bool "Enable Integrated Lua interpreter"
+ default y
endef
define Package/uhttpd-mod-lua
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
endef
-define Package/uhttpd-mod-tls/install
- true
-endef
-
define Package/uhttpd-mod-lua/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
$(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-tls))
$(eval $(call BuildPackage,uhttpd-mod-lua))
$(eval $(call BuildPackage,uhttpd-mod-ubus))