Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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:=2015-11-08
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=git://nbd.name/uhttpd2.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@openwrt.org>
  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_cyassl:libustream-cyassl \
  47. +PACKAGE_uhttpd-mod-tls_openssl:libustream-openssl
  48. endef
  49. define Package/uhttpd-mod-tls/description
  50. The TLS plugin adds HTTPS support to uHTTPd.
  51. endef
  52. define Package/uhttpd-mod-tls/config
  53. choice
  54. depends on PACKAGE_uhttpd-mod-tls
  55. prompt "TLS Provider"
  56. default PACKAGE_uhttpd-mod-tls_polarssl
  57. config PACKAGE_uhttpd-mod-tls_polarssl
  58. bool "PolarSSL"
  59. config PACKAGE_uhttpd-mod-tls_cyassl
  60. bool "CyaSSL"
  61. config PACKAGE_uhttpd-mod-tls_openssl
  62. bool "OpenSSL"
  63. endchoice
  64. endef
  65. define Package/uhttpd-mod-lua
  66. $(Package/uhttpd/default)
  67. TITLE+= (Lua plugin)
  68. DEPENDS:=uhttpd +liblua
  69. endef
  70. define Package/uhttpd-mod-lua/description
  71. The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
  72. endef
  73. define Package/uhttpd-mod-ubus
  74. $(Package/uhttpd/default)
  75. TITLE+= (ubus plugin)
  76. DEPENDS:=uhttpd +libubus +libblobmsg-json
  77. endef
  78. define Package/uhttpd-mod-ubus/description
  79. The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
  80. session.* namespace and procedures.
  81. endef
  82. define Package/uhttpd/conffiles
  83. /etc/config/uhttpd
  84. /etc/uhttpd.crt
  85. /etc/uhttpd.key
  86. endef
  87. ifneq ($(CONFIG_USE_GLIBC),)
  88. TARGET_CFLAGS += -D_DEFAULT_SOURCE
  89. endif
  90. TARGET_LDFLAGS += -lcrypt
  91. CMAKE_OPTIONS = -DTLS_SUPPORT=on
  92. define Package/uhttpd/install
  93. $(INSTALL_DIR) $(1)/etc/init.d
  94. $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
  95. $(INSTALL_DIR) $(1)/etc/config
  96. $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
  97. $(INSTALL_DIR) $(1)/usr/sbin
  98. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
  99. endef
  100. define Package/uhttpd-mod-tls/install
  101. true
  102. endef
  103. define Package/uhttpd-mod-lua/install
  104. $(INSTALL_DIR) $(1)/usr/lib
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
  106. endef
  107. define Package/uhttpd-mod-ubus/install
  108. $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
  110. $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
  111. endef
  112. $(eval $(call BuildPackage,uhttpd))
  113. $(eval $(call BuildPackage,uhttpd-mod-tls))
  114. $(eval $(call BuildPackage,uhttpd-mod-lua))
  115. $(eval $(call BuildPackage,uhttpd-mod-ubus))