| 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:=19 |
| 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 | endef |
| 23 | |
| 24 | define Package/uhttpd |
| 25 | $(Package/uhttpd/default) |
| 26 | MENU:=1 |
| 27 | endef |
| 28 | |
| 29 | define Package/uhttpd/description |
| 30 | uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua |
| 31 | support. It is intended as a drop-in replacement for the Busybox |
| 32 | HTTP daemon. |
| 33 | endef |
| 34 | |
| 35 | |
| 36 | define Package/uhttpd-mod-tls |
| 37 | $(Package/uhttpd/default) |
| 38 | TITLE+= (TLS plugin) |
| 39 | DEPENDS:=uhttpd +libcyassl |
| 40 | endef |
| 41 | |
| 42 | define Package/uhttpd-mod-tls/description |
| 43 | The TLS plugin adds HTTPS support to uHTTPd. |
| 44 | endef |
| 45 | |
| 46 | |
| 47 | define Package/uhttpd-mod-lua |
| 48 | $(Package/uhttpd/default) |
| 49 | TITLE+= (Lua plugin) |
| 50 | DEPENDS:=uhttpd +liblua |
| 51 | endef |
| 52 | |
| 53 | define Package/uhttpd-mod-lua/description |
| 54 | The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd. |
| 55 | endef |
| 56 | |
| 57 | |
| 58 | # hack to use CyASSL headers |
| 59 | TARGET_CFLAGS += -I$(firstword $(wildcard $(BUILD_DIR)/cyassl-*/include)) |
| 60 | TARGET_LDFLAGS += -lm |
| 61 | MAKE_VARS += FPIC="$(FPIC)" |
| 62 | |
| 63 | define Build/Prepare |
| 64 | mkdir -p $(PKG_BUILD_DIR) |
| 65 | $(CP) ./src/* $(PKG_BUILD_DIR)/ |
| 66 | endef |
| 67 | |
| 68 | define Package/uhttpd/conffiles |
| 69 | /etc/config/uhttpd |
| 70 | /etc/uhttpd.crt |
| 71 | /etc/uhttpd.key |
| 72 | endef |
| 73 | |
| 74 | define Package/uhttpd/install |
| 75 | $(INSTALL_DIR) $(1)/etc/init.d |
| 76 | $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd |
| 77 | $(INSTALL_DIR) $(1)/etc/config |
| 78 | $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd |
| 79 | $(INSTALL_DIR) $(1)/usr/sbin |
| 80 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd |
| 81 | endef |
| 82 | |
| 83 | define Package/uhttpd-mod-tls/install |
| 84 | $(INSTALL_DIR) $(1)/usr/lib |
| 85 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_tls.so $(1)/usr/lib/ |
| 86 | endef |
| 87 | |
| 88 | define Package/uhttpd-mod-lua/install |
| 89 | $(INSTALL_DIR) $(1)/usr/lib |
| 90 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/ |
| 91 | endef |
| 92 | |
| 93 | |
| 94 | $(eval $(call BuildPackage,uhttpd)) |
| 95 | $(eval $(call BuildPackage,uhttpd-mod-tls)) |
| 96 | $(eval $(call BuildPackage,uhttpd-mod-lua)) |
| 97 | |