treewide: clean up and unify PKG_VERSION for git based downloads
[openwrt/staging/blogic.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=$(LEDE_GIT)/project/uhttpd.git
15 PKG_SOURCE_DATE:=2016-10-25
16 PKG_SOURCE_VERSION:=1628fa4b34aa143187353f81e8001b9a15286bda
17 PKG_MIRROR_HASH:=2ac4ba8dc0b349d72174aac9ff693a73a214295a9890fe3d2a8eedcad54d06e3
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=ISC
20
21 PKG_BUILD_DEPENDS = ustream-ssl
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25 include $(INCLUDE_DIR)/version.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 +libblobmsg-json +libjson-script
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_mbedtls:libustream-mbedtls \
58 +PACKAGE_uhttpd-mod-tls_cyassl:libustream-cyassl \
59 +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
60 endef
61
62 define Package/uhttpd-mod-tls/description
63 The TLS plugin adds HTTPS support to uHTTPd.
64 endef
65
66 define Package/uhttpd-mod-tls/config
67 choice
68 depends on PACKAGE_uhttpd-mod-tls
69 prompt "TLS Provider"
70 default PACKAGE_uhttpd-mod-tls_polarssl
71
72 config PACKAGE_uhttpd-mod-tls_mbedtls
73 bool "mbedTLS"
74
75 config PACKAGE_uhttpd-mod-tls_polarssl
76 bool "PolarSSL"
77
78 config PACKAGE_uhttpd-mod-tls_cyassl
79 bool "CyaSSL"
80
81 config PACKAGE_uhttpd-mod-tls_openssl
82 bool "OpenSSL"
83 endchoice
84 endef
85
86 define Package/uhttpd-mod-lua
87 $(Package/uhttpd/default)
88 TITLE+= (Lua plugin)
89 DEPENDS:=uhttpd +liblua
90 endef
91
92 define Package/uhttpd-mod-lua/description
93 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
94 endef
95
96
97 define Package/uhttpd-mod-ubus
98 $(Package/uhttpd/default)
99 TITLE+= (ubus plugin)
100 DEPENDS:=uhttpd +libubus +libblobmsg-json
101 endef
102
103 define Package/uhttpd-mod-ubus/description
104 The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
105 session.* namespace and procedures.
106 endef
107
108 define Package/uhttpd/conffiles
109 /etc/config/uhttpd
110 /etc/uhttpd.crt
111 /etc/uhttpd.key
112 endef
113
114 ifneq ($(CONFIG_USE_GLIBC),)
115 TARGET_CFLAGS += -D_DEFAULT_SOURCE
116 endif
117
118 TARGET_LDFLAGS += -lcrypt
119
120 CMAKE_OPTIONS = -DTLS_SUPPORT=on
121
122 define Package/uhttpd/install
123 $(INSTALL_DIR) $(1)/etc/init.d
124 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
125 $(INSTALL_DIR) $(1)/etc/config
126 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
127 $(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
130 endef
131
132 define Package/uhttpd-mod-tls/install
133 true
134 endef
135
136 define Package/uhttpd-mod-lua/install
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
139 endef
140
141 define Package/uhttpd-mod-ubus/install
142 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
143 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
144 $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
145 endef
146
147
148 $(eval $(call BuildPackage,uhttpd))
149 $(eval $(call BuildPackage,uhttpd-mod-tls))
150 $(eval $(call BuildPackage,uhttpd-mod-lua))
151 $(eval $(call BuildPackage,uhttpd-mod-ubus))