d227c5dab0f371473a45e6f9c14d62c526c82240
[openwrt/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_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
15 PKG_SOURCE_DATE:=2020-02-12
16 PKG_SOURCE_VERSION:=2ee323c01079248baa9465969df9e25b5fb68cdf
17 PKG_MIRROR_HASH:=ebec09286cf5f977cac893931a5a4f27ba891db88d5e44a9b0de9446ae431527
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=ISC
20
21 PKG_BUILD_DEPENDS = ustream-ssl
22 PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua
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 +libjson-c
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 uhttpd_lua
48 depends on PACKAGE_uhttpd-mod-lua
49 bool "Enable Integrated Lua interpreter"
50 default y
51 endef
52
53 define Package/uhttpd-mod-lua
54 $(Package/uhttpd/default)
55 TITLE+= (Lua plugin)
56 DEPENDS:=uhttpd +liblua
57 endef
58
59 define Package/uhttpd-mod-lua/description
60 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
61 endef
62
63
64 define Package/uhttpd-mod-ubus
65 $(Package/uhttpd/default)
66 TITLE+= (ubus plugin)
67 DEPENDS:=uhttpd +libubus +libblobmsg-json
68 endef
69
70 define Package/uhttpd-mod-ubus/description
71 The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
72 session.* namespace and procedures.
73 endef
74
75 define Package/uhttpd/conffiles
76 /etc/config/uhttpd
77 /etc/uhttpd.crt
78 /etc/uhttpd.key
79 endef
80
81 ifneq ($(CONFIG_USE_GLIBC),)
82 TARGET_CFLAGS += -D_DEFAULT_SOURCE
83 endif
84
85 TARGET_LDFLAGS += -lcrypt
86
87 CMAKE_OPTIONS = -DTLS_SUPPORT=on
88
89 define Package/uhttpd/install
90 $(INSTALL_DIR) $(1)/etc/init.d
91 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
92 $(INSTALL_DIR) $(1)/etc/config
93 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
94 $(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
95 $(INSTALL_DIR) $(1)/usr/sbin
96 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
97 endef
98
99 define Package/uhttpd-mod-lua/install
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
102 endef
103
104 define Package/uhttpd-mod-ubus/install
105 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
106 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
107 $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
108 endef
109
110
111 $(eval $(call BuildPackage,uhttpd))
112 $(eval $(call BuildPackage,uhttpd-mod-lua))
113 $(eval $(call BuildPackage,uhttpd-mod-ubus))