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