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