uhttpd: Enable integrated Lua by default
[openwrt/openwrt.git] / package / network / services / uhttpd / Makefile
index 6f9fac95fe8f8007f9f4f0e5f83cba375c8ea2c5..3d483b692dea784010d83a33a69c9e49b9c76f17 100644 (file)
@@ -8,7 +8,7 @@
 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
@@ -46,41 +46,10 @@ define Package/uhttpd/config
   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
@@ -129,10 +98,6 @@ define Package/uhttpd/install
        $(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/
@@ -144,8 +109,17 @@ define Package/uhttpd-mod-ubus/install
        $(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))