2010-03-25 15:46:16 +00:00
|
|
|
#
|
2016-06-07 09:42:32 +00:00
|
|
|
# Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
|
2010-03-25 15:46:16 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=uhttpd
|
2017-09-12 18:29:09 +00:00
|
|
|
PKG_RELEASE:=1
|
2012-10-15 12:31:33 +00:00
|
|
|
|
|
|
|
PKG_SOURCE_PROTO:=git
|
2016-06-06 19:16:47 +00:00
|
|
|
PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git
|
2017-09-12 18:29:09 +00:00
|
|
|
PKG_SOURCE_DATE:=2017-08-19
|
|
|
|
PKG_SOURCE_VERSION:=3fd58e9b6da7d9e1a4710dbeefc2d289baea09fb
|
|
|
|
PKG_MIRROR_HASH:=69bba3b04c5e1975b99dee4fc47672ebf5ab282f115249a46be0fe0b961eb34b
|
2016-06-07 06:58:31 +00:00
|
|
|
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
2014-11-02 12:20:54 +00:00
|
|
|
PKG_LICENSE:=ISC
|
2010-03-25 15:46:16 +00:00
|
|
|
|
2013-01-22 15:05:04 +00:00
|
|
|
PKG_BUILD_DEPENDS = ustream-ssl
|
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2012-10-15 12:31:33 +00:00
|
|
|
include $(INCLUDE_DIR)/cmake.mk
|
2016-05-21 10:42:44 +00:00
|
|
|
include $(INCLUDE_DIR)/version.mk
|
2012-10-15 12:31:33 +00:00
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
define Package/uhttpd/default
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2011-03-12 04:47:02 +00:00
|
|
|
SUBMENU:=Web Servers/Proxies
|
2010-03-25 15:46:16 +00:00
|
|
|
TITLE:=uHTTPd - tiny, single threaded HTTP server
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/uhttpd
|
|
|
|
$(Package/uhttpd/default)
|
2015-11-08 20:39:09 +00:00
|
|
|
DEPENDS:=+libubox +libblobmsg-json +libjson-script
|
2010-03-25 15:46:16 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/uhttpd/description
|
|
|
|
uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
|
|
|
|
support. It is intended as a drop-in replacement for the Busybox
|
|
|
|
HTTP daemon.
|
|
|
|
endef
|
|
|
|
|
2012-05-28 00:52:24 +00:00
|
|
|
define Package/uhttpd/config
|
|
|
|
config PACKAGE_uhttpd_debug
|
|
|
|
bool "Build with debug messages"
|
|
|
|
default n
|
2017-03-26 13:17:06 +00:00
|
|
|
config uhttpd_lua
|
|
|
|
depends on PACKAGE_uhttpd-mod-lua
|
|
|
|
bool "Enable Integrated Lua interpreter"
|
|
|
|
default y
|
2012-05-28 00:52:24 +00:00
|
|
|
endef
|
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
define Package/uhttpd-mod-lua
|
|
|
|
$(Package/uhttpd/default)
|
|
|
|
TITLE+= (Lua plugin)
|
|
|
|
DEPENDS:=uhttpd +liblua
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/uhttpd-mod-lua/description
|
|
|
|
The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
2012-05-28 00:52:24 +00:00
|
|
|
define Package/uhttpd-mod-ubus
|
|
|
|
$(Package/uhttpd/default)
|
|
|
|
TITLE+= (ubus plugin)
|
|
|
|
DEPENDS:=uhttpd +libubus +libblobmsg-json
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/uhttpd-mod-ubus/description
|
|
|
|
The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
|
|
|
|
session.* namespace and procedures.
|
|
|
|
endef
|
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
define Package/uhttpd/conffiles
|
|
|
|
/etc/config/uhttpd
|
2010-10-05 19:34:22 +00:00
|
|
|
/etc/uhttpd.crt
|
|
|
|
/etc/uhttpd.key
|
2010-03-25 15:46:16 +00:00
|
|
|
endef
|
|
|
|
|
2015-03-16 12:32:22 +00:00
|
|
|
ifneq ($(CONFIG_USE_GLIBC),)
|
|
|
|
TARGET_CFLAGS += -D_DEFAULT_SOURCE
|
|
|
|
endif
|
|
|
|
|
2013-01-19 18:47:09 +00:00
|
|
|
TARGET_LDFLAGS += -lcrypt
|
|
|
|
|
2013-01-22 15:05:04 +00:00
|
|
|
CMAKE_OPTIONS = -DTLS_SUPPORT=on
|
2013-01-19 18:47:09 +00:00
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
define Package/uhttpd/install
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
|
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
|
2016-05-21 10:42:44 +00:00
|
|
|
$(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
|
2010-03-25 15:46:16 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/uhttpd-mod-lua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
2012-05-28 00:52:24 +00:00
|
|
|
define Package/uhttpd-mod-ubus/install
|
2013-11-11 12:18:58 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
|
2012-05-28 00:52:24 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
|
2013-11-11 12:18:58 +00:00
|
|
|
$(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
|
2012-05-28 00:52:24 +00:00
|
|
|
endef
|
|
|
|
|
2017-03-26 13:17:06 +00:00
|
|
|
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
|
|
|
|
|
2010-03-25 15:46:16 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildPackage,uhttpd))
|
|
|
|
$(eval $(call BuildPackage,uhttpd-mod-lua))
|
2012-05-28 00:52:24 +00:00
|
|
|
$(eval $(call BuildPackage,uhttpd-mod-ubus))
|