ppp: backport security fixes
[openwrt/staging/mkresin.git] / package / network / services / uhttpd / Makefile
1 #
2 # Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=uhttpd
11 PKG_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
15 PKG_SOURCE_DATE:=2020-02-12
16 PKG_SOURCE_VERSION:=2ee323c01079248baa9465969df9e25b5fb68cdf
17 PKG_MIRROR_HASH:=ebec09286cf5f977cac893931a5a4f27ba891db88d5e44a9b0de9446ae431527
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=ISC
20
21 PKG_ASLR_PIE_REGULAR:=1
22 PKG_BUILD_DEPENDS = ustream-ssl
23 PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27 include $(INCLUDE_DIR)/version.mk
28
29 define Package/uhttpd/default
30 SECTION:=net
31 CATEGORY:=Network
32 SUBMENU:=Web Servers/Proxies
33 TITLE:=uHTTPd - tiny, single threaded HTTP server
34 endef
35
36 define Package/uhttpd
37 $(Package/uhttpd/default)
38 DEPENDS:=+libubox +libblobmsg-json +libjson-script +libjson-c
39 endef
40
41 define Package/uhttpd/description
42 uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
43 support. It is intended as a drop-in replacement for the Busybox
44 HTTP daemon.
45 endef
46
47 define Package/uhttpd/config
48 config uhttpd_lua
49 depends on PACKAGE_uhttpd-mod-lua
50 bool "Enable Integrated Lua interpreter"
51 default y
52 endef
53
54 define Package/uhttpd-mod-lua
55 $(Package/uhttpd/default)
56 TITLE+= (Lua plugin)
57 DEPENDS:=uhttpd +liblua
58 endef
59
60 define Package/uhttpd-mod-lua/description
61 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
62 endef
63
64
65 define Package/uhttpd-mod-ubus
66 $(Package/uhttpd/default)
67 TITLE+= (ubus plugin)
68 DEPENDS:=uhttpd +libubus +libblobmsg-json
69 endef
70
71 define Package/uhttpd-mod-ubus/description
72 The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
73 session.* namespace and procedures.
74 endef
75
76 define Package/uhttpd/conffiles
77 /etc/config/uhttpd
78 /etc/uhttpd.crt
79 /etc/uhttpd.key
80 endef
81
82 ifneq ($(CONFIG_USE_GLIBC),)
83 TARGET_CFLAGS += -D_DEFAULT_SOURCE
84 endif
85
86 TARGET_LDFLAGS += -lcrypt
87
88 CMAKE_OPTIONS = -DTLS_SUPPORT=on
89
90 define Package/uhttpd/install
91 $(INSTALL_DIR) $(1)/etc/init.d
92 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
93 $(INSTALL_DIR) $(1)/etc/config
94 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
95 $(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
96 $(INSTALL_DIR) $(1)/usr/sbin
97 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
98 endef
99
100 define Package/uhttpd-mod-lua/install
101 $(INSTALL_DIR) $(1)/usr/lib
102 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
103 endef
104
105 define Package/uhttpd-mod-ubus/install
106 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
107 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
108 $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
109 endef
110
111
112 $(eval $(call BuildPackage,uhttpd))
113 $(eval $(call BuildPackage,uhttpd-mod-lua))
114 $(eval $(call BuildPackage,uhttpd-mod-ubus))