source: trunk/package/uhttpd/Makefile @ 28761

Last change on this file since 28761 was 28761, checked in by jow, 5 years ago

[package] uhttpd: rework CyaSSL and OpenSSL integration; move protected recv() and send() operations below the ssl layer - fixes hangs when accessing via https

File size: 3.2 KB
Line 
1#
2# Copyright (C) 2010-2011 Jo-Philipp Wich <xm@subsignal.org>
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=uhttpd
11PKG_RELEASE:=27
12
13PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
14PKG_CONFIG_DEPENDS := \
15        CONFIG_PACKAGE_uhttpd-mod-lua \
16        CONFIG_PACKAGE_uhttpd-mod-tls \
17        CONFIG_PACKAGE_uhttpd-mod-tls_cyassl \
18        CONFIG_PACKAGE_uhttpd-mod-tls_openssl
19
20include $(INCLUDE_DIR)/package.mk
21
22define Package/uhttpd/default
23  SECTION:=net
24  CATEGORY:=Network
25  SUBMENU:=Web Servers/Proxies
26  TITLE:=uHTTPd - tiny, single threaded HTTP server
27  MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
28endef
29
30define Package/uhttpd
31  $(Package/uhttpd/default)
32  MENU:=1
33endef
34
35define Package/uhttpd/description
36 uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
37 support. It is intended as a drop-in replacement for the Busybox
38 HTTP daemon.
39endef
40
41
42define Package/uhttpd-mod-tls
43  $(Package/uhttpd/default)
44  TITLE+= (TLS plugin)
45  DEPENDS:=uhttpd +PACKAGE_uhttpd-mod-tls_cyassl:libcyassl +PACKAGE_uhttpd-mod-tls_openssl:libopenssl
46endef
47
48define Package/uhttpd-mod-tls/description
49 The TLS plugin adds HTTPS support to uHTTPd.
50endef
51
52define Package/uhttpd-mod-tls/config
53        choice
54                depends on PACKAGE_uhttpd-mod-tls
55                prompt "TLS Provider"
56                default PACKAGE_uhttpd-mod-tls_cyassl
57
58                config PACKAGE_uhttpd-mod-tls_cyassl
59                        bool "CyaSSL"
60
61                config PACKAGE_uhttpd-mod-tls_openssl
62                        bool "OpenSSL"
63        endchoice
64endef
65
66UHTTPD_TLS:=
67TLS_CFLAGS:=
68TLS_LDFLAGS:=
69
70ifneq ($(CONFIG_PACKAGE_uhttpd-mod-tls_cyassl),)
71  UHTTPD_TLS:=cyassl
72  TLS_CFLAGS:=-I$(STAGING_DIR)/usr/include/cyassl -DTLS_IS_CYASSL
73endif
74
75ifneq ($(CONFIG_PACKAGE_uhttpd-mod-tls_openssl),)
76  UHTTPD_TLS:=openssl
77  TLS_CFLAGS:=-DTLS_IS_OPENSSL
78endif
79
80
81define Package/uhttpd-mod-lua
82  $(Package/uhttpd/default)
83  TITLE+= (Lua plugin)
84  DEPENDS:=uhttpd +liblua
85endef
86
87define Package/uhttpd-mod-lua/description
88 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
89endef
90
91
92TARGET_CFLAGS += $(TLS_CFLAGS)
93MAKE_VARS += \
94        FPIC="$(FPIC)" \
95        LUA_SUPPORT="$(if $(CONFIG_PACKAGE_uhttpd-mod-lua),1)" \
96        TLS_SUPPORT="$(if $(CONFIG_PACKAGE_uhttpd-mod-tls),1)" \
97        UHTTPD_TLS="$(UHTTPD_TLS)"
98
99define Build/Prepare
100        mkdir -p $(PKG_BUILD_DIR)
101        $(CP) ./src/* $(PKG_BUILD_DIR)/
102endef
103
104define Package/uhttpd/conffiles
105/etc/config/uhttpd
106/etc/uhttpd.crt
107/etc/uhttpd.key
108endef
109
110define Package/uhttpd/install
111        $(INSTALL_DIR) $(1)/etc/init.d
112        $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
113        $(INSTALL_DIR) $(1)/etc/config
114        $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
115        $(INSTALL_DIR) $(1)/usr/sbin
116        $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
117endef
118
119define Package/uhttpd-mod-tls/install
120        $(INSTALL_DIR) $(1)/usr/lib
121        $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_tls.so $(1)/usr/lib/
122endef
123
124define Package/uhttpd-mod-lua/install
125        $(INSTALL_DIR) $(1)/usr/lib
126        $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
127endef
128
129
130$(eval $(call BuildPackage,uhttpd))
131$(eval $(call BuildPackage,uhttpd-mod-tls))
132$(eval $(call BuildPackage,uhttpd-mod-lua))
Note: See TracBrowser for help on using the repository browser.