Makefile 3.1 KB

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