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