Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #
  2. # Copyright (C) 2010-2015 Jo-Philipp Wich <jow@openwrt.org>
  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_VERSION:=2016-10-05
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL=$(OPENWRT_GIT)/project/uhttpd.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=fe01ef3f52adae9da38ef47926cd50974af5d6b7
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  17. PKG_LICENSE:=ISC
  18. PKG_BUILD_DEPENDS = ustream-ssl
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/uhttpd/default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. SUBMENU:=Web Servers/Proxies
  25. TITLE:=uHTTPd - tiny, single threaded HTTP server
  26. endef
  27. define Package/uhttpd
  28. $(Package/uhttpd/default)
  29. DEPENDS:=+libubox +libblobmsg-json +libjson-script
  30. endef
  31. define Package/uhttpd/description
  32. uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua
  33. support. It is intended as a drop-in replacement for the Busybox
  34. HTTP daemon.
  35. endef
  36. define Package/uhttpd/config
  37. config PACKAGE_uhttpd_debug
  38. bool "Build with debug messages"
  39. default n
  40. endef
  41. define Package/uhttpd-mod-tls
  42. $(Package/uhttpd/default)
  43. TITLE+= (TLS plugin)
  44. DEPENDS:=uhttpd \
  45. +PACKAGE_uhttpd-mod-tls_polarssl:libustream-polarssl \
  46. +PACKAGE_uhttpd-mod-tls_mbedtls:libustream-mbedtls \
  47. +PACKAGE_uhttpd-mod-tls_cyassl:libustream-cyassl \
  48. +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
  49. endef
  50. define Package/uhttpd-mod-tls/description
  51. The TLS plugin adds HTTPS support to uHTTPd.
  52. endef
  53. define Package/uhttpd-mod-tls/config
  54. choice
  55. depends on PACKAGE_uhttpd-mod-tls
  56. prompt "TLS Provider"
  57. default PACKAGE_uhttpd-mod-tls_polarssl
  58. config PACKAGE_uhttpd-mod-tls_mbedtls
  59. bool "mbedTLS"
  60. config PACKAGE_uhttpd-mod-tls_polarssl
  61. bool "PolarSSL"
  62. config PACKAGE_uhttpd-mod-tls_cyassl
  63. bool "CyaSSL"
  64. config PACKAGE_uhttpd-mod-tls_openssl
  65. bool "OpenSSL"
  66. endchoice
  67. endef
  68. define Package/uhttpd-mod-lua
  69. $(Package/uhttpd/default)
  70. TITLE+= (Lua plugin)
  71. DEPENDS:=uhttpd +liblua
  72. endef
  73. define Package/uhttpd-mod-lua/description
  74. The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
  75. endef
  76. define Package/uhttpd-mod-ubus
  77. $(Package/uhttpd/default)
  78. TITLE+= (ubus plugin)
  79. DEPENDS:=uhttpd +libubus +libblobmsg-json
  80. endef
  81. define Package/uhttpd-mod-ubus/description
  82. The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
  83. session.* namespace and procedures.
  84. endef
  85. define Package/uhttpd/conffiles
  86. /etc/config/uhttpd
  87. /etc/uhttpd.crt
  88. /etc/uhttpd.key
  89. endef
  90. ifneq ($(CONFIG_USE_GLIBC),)
  91. TARGET_CFLAGS += -D_DEFAULT_SOURCE
  92. endif
  93. TARGET_LDFLAGS += -lcrypt
  94. CMAKE_OPTIONS = -DTLS_SUPPORT=on
  95. define Package/uhttpd/install
  96. $(INSTALL_DIR) $(1)/etc/init.d
  97. $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
  98. $(INSTALL_DIR) $(1)/etc/config
  99. $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
  100. $(INSTALL_DIR) $(1)/usr/sbin
  101. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
  102. endef
  103. define Package/uhttpd-mod-tls/install
  104. true
  105. endef
  106. define Package/uhttpd-mod-lua/install
  107. $(INSTALL_DIR) $(1)/usr/lib
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
  109. endef
  110. define Package/uhttpd-mod-ubus/install
  111. $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
  113. $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
  114. endef
  115. $(eval $(call BuildPackage,uhttpd))
  116. $(eval $(call BuildPackage,uhttpd-mod-tls))
  117. $(eval $(call BuildPackage,uhttpd-mod-lua))
  118. $(eval $(call BuildPackage,uhttpd-mod-ubus))