uhttpd: fix crash with enabled relro, memory leak in dirlists and lfs
[openwrt/openwrt.git] / package / network / services / uhttpd / Makefile
1 #
2 # Copyright (C) 2010-2015 Jo-Philipp Wich <jow@openwrt.org>
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_VERSION:=2015-01-25
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=git://nbd.name/uhttpd2.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=7352ec423fb99a7970b0765287503abee05a56cd
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
20 PKG_LICENSE:=ISC
21
22 PKG_BUILD_DEPENDS = ustream-ssl
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/cmake.mk
26
27 define Package/uhttpd/default
28 SECTION:=net
29 CATEGORY:=Network
30 SUBMENU:=Web Servers/Proxies
31 TITLE:=uHTTPd - tiny, single threaded HTTP server
32 endef
33
34 define Package/uhttpd
35 $(Package/uhttpd/default)
36 DEPENDS:=+libubox
37 endef
38
39 define Package/uhttpd/description
40 uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
41 support. It is intended as a drop-in replacement for the Busybox
42 HTTP daemon.
43 endef
44
45 define Package/uhttpd/config
46 config PACKAGE_uhttpd_debug
47 bool "Build with debug messages"
48 default n
49 endef
50
51
52 define Package/uhttpd-mod-tls
53 $(Package/uhttpd/default)
54 TITLE+= (TLS plugin)
55 DEPENDS:=uhttpd \
56 +PACKAGE_uhttpd-mod-tls_polarssl:libustream-polarssl \
57 +PACKAGE_uhttpd-mod-tls_cyassl:libustream-cyassl \
58 +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
59 endef
60
61 define Package/uhttpd-mod-tls/description
62 The TLS plugin adds HTTPS support to uHTTPd.
63 endef
64
65 define Package/uhttpd-mod-tls/config
66 choice
67 depends on PACKAGE_uhttpd-mod-tls
68 prompt "TLS Provider"
69 default PACKAGE_uhttpd-mod-tls_polarssl
70
71 config PACKAGE_uhttpd-mod-tls_polarssl
72 bool "PolarSSL"
73
74 config PACKAGE_uhttpd-mod-tls_cyassl
75 bool "CyaSSL"
76
77 config PACKAGE_uhttpd-mod-tls_openssl
78 bool "OpenSSL"
79 endchoice
80 endef
81
82 define Package/uhttpd-mod-lua
83 $(Package/uhttpd/default)
84 TITLE+= (Lua plugin)
85 DEPENDS:=uhttpd +liblua
86 endef
87
88 define Package/uhttpd-mod-lua/description
89 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
90 endef
91
92
93 define Package/uhttpd-mod-ubus
94 $(Package/uhttpd/default)
95 TITLE+= (ubus plugin)
96 DEPENDS:=uhttpd +libubus +libblobmsg-json
97 endef
98
99 define Package/uhttpd-mod-ubus/description
100 The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
101 session.* namespace and procedures.
102 endef
103
104 define Package/uhttpd/conffiles
105 /etc/config/uhttpd
106 /etc/uhttpd.crt
107 /etc/uhttpd.key
108 endef
109
110 TARGET_LDFLAGS += -lcrypt
111
112 CMAKE_OPTIONS = -DTLS_SUPPORT=on
113
114 define Package/uhttpd/install
115 $(INSTALL_DIR) $(1)/etc/init.d
116 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
117 $(INSTALL_DIR) $(1)/etc/config
118 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
119 $(INSTALL_DIR) $(1)/usr/sbin
120 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
121 endef
122
123 define Package/uhttpd-mod-tls/install
124 true
125 endef
126
127 define Package/uhttpd-mod-lua/install
128 $(INSTALL_DIR) $(1)/usr/lib
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
130 endef
131
132 define Package/uhttpd-mod-ubus/install
133 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
134 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
135 $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
136 endef
137
138
139 $(eval $(call BuildPackage,uhttpd))
140 $(eval $(call BuildPackage,uhttpd-mod-tls))
141 $(eval $(call BuildPackage,uhttpd-mod-lua))
142 $(eval $(call BuildPackage,uhttpd-mod-ubus))