uhttpd: update to latest version, fixes compile error with latest libubox
[openwrt/openwrt.git] / package / network / services / uhttpd / Makefile
1 #
2 # Copyright (C) 2010-2012 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:=2013-04-15
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:=9d83bd3c524c4bbeb8e6583155dd7df9e8a1b5d3
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 +PACKAGE_uhttpd-mod-tls_cyassl:libustream-cyassl +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
55 endef
56
57 define Package/uhttpd-mod-tls/description
58 The TLS plugin adds HTTPS support to uHTTPd.
59 endef
60
61 define Package/uhttpd-mod-tls/config
62 choice
63 depends on PACKAGE_uhttpd-mod-tls
64 prompt "TLS Provider"
65 default PACKAGE_uhttpd-mod-tls_cyassl
66
67 config PACKAGE_uhttpd-mod-tls_cyassl
68 bool "CyaSSL"
69
70 config PACKAGE_uhttpd-mod-tls_openssl
71 bool "OpenSSL"
72 endchoice
73 endef
74
75 define Package/uhttpd-mod-lua
76 $(Package/uhttpd/default)
77 TITLE+= (Lua plugin)
78 DEPENDS:=uhttpd +liblua
79 endef
80
81 define Package/uhttpd-mod-lua/description
82 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
83 endef
84
85
86 define Package/uhttpd-mod-ubus
87 $(Package/uhttpd/default)
88 TITLE+= (ubus plugin)
89 DEPENDS:=uhttpd +libubus +libblobmsg-json
90 endef
91
92 define Package/uhttpd-mod-ubus/description
93 The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
94 session.* namespace and procedures.
95 endef
96
97 define Package/uhttpd/conffiles
98 /etc/config/uhttpd
99 /etc/uhttpd.crt
100 /etc/uhttpd.key
101 endef
102
103 TARGET_LDFLAGS += -lcrypt
104
105 CMAKE_OPTIONS = -DTLS_SUPPORT=on
106
107 define Package/uhttpd/install
108 $(INSTALL_DIR) $(1)/etc/init.d
109 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
110 $(INSTALL_DIR) $(1)/etc/config
111 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
112 $(INSTALL_DIR) $(1)/usr/sbin
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
114 endef
115
116 define Package/uhttpd-mod-tls/install
117 true
118 endef
119
120 define Package/uhttpd-mod-lua/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
123 endef
124
125 define Package/uhttpd-mod-ubus/install
126 $(INSTALL_DIR) $(1)/usr/lib
127 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
128 endef
129
130
131 $(eval $(call BuildPackage,uhttpd))
132 $(eval $(call BuildPackage,uhttpd-mod-tls))
133 $(eval $(call BuildPackage,uhttpd-mod-lua))
134 $(eval $(call BuildPackage,uhttpd-mod-ubus))