Makefile 3.7 KB

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