835e5b527729d11a6a60fab32993ef3f8e1eb9ed
[openwrt/svn-archive/archive.git] / package / uhttpd / Makefile
1 #
2 # Copyright (C) 2010 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=uhttpd
11 PKG_RELEASE:=18
12
13 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
14 PKG_BUILD_DEPENDS := libcyassl liblua
15
16 include $(INCLUDE_DIR)/package.mk
17
18 define Package/uhttpd/default
19 SECTION:=net
20 CATEGORY:=Network
21 TITLE:=uHTTPd - tiny, single threaded HTTP server
22 MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
23 endef
24
25 define Package/uhttpd
26 $(Package/uhttpd/default)
27 MENU:=1
28 endef
29
30 define Package/uhttpd/description
31 uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
32 support. It is intended as a drop-in replacement for the Busybox
33 HTTP daemon.
34 endef
35
36
37 define Package/uhttpd-mod-tls
38 $(Package/uhttpd/default)
39 TITLE+= (TLS plugin)
40 DEPENDS:=uhttpd +libcyassl
41 endef
42
43 define Package/uhttpd-mod-tls/description
44 The TLS plugin adds HTTPS support to uHTTPd.
45 endef
46
47
48 define Package/uhttpd-mod-lua
49 $(Package/uhttpd/default)
50 TITLE+= (Lua plugin)
51 DEPENDS:=uhttpd +liblua
52 endef
53
54 define Package/uhttpd-mod-lua/description
55 The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
56 endef
57
58
59 # hack to use CyASSL headers
60 TARGET_CFLAGS += -I$(firstword $(wildcard $(BUILD_DIR)/cyassl-*/include))
61 TARGET_LDFLAGS += -lm
62 MAKE_VARS += FPIC="$(FPIC)"
63
64 define Build/Prepare
65 mkdir -p $(PKG_BUILD_DIR)
66 $(CP) ./src/* $(PKG_BUILD_DIR)/
67 endef
68
69 define Package/uhttpd/conffiles
70 /etc/config/uhttpd
71 endef
72
73 define Package/uhttpd/install
74 $(INSTALL_DIR) $(1)/etc/init.d
75 $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
76 $(INSTALL_DIR) $(1)/etc/config
77 $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
80 endef
81
82 define Package/uhttpd-mod-tls/install
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_tls.so $(1)/usr/lib/
85 endef
86
87 define Package/uhttpd-mod-lua/install
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
90 endef
91
92
93 $(eval $(call BuildPackage,uhttpd))
94 $(eval $(call BuildPackage,uhttpd-mod-tls))
95 $(eval $(call BuildPackage,uhttpd-mod-lua))