Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #
  2. # Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
  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:=4
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/uhttpd.git
  12. PKG_SOURCE_DATE:=2020-10-01
  13. PKG_SOURCE_VERSION:=3abcc89103799aaa79870fffcd58ec4370815024
  14. PKG_MIRROR_HASH:=755863ef113648c7f4863b5ac93593e7a8c46f1937217641d0ec4bde34e45883
  15. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  16. PKG_LICENSE:=ISC
  17. PKG_BUILD_DEPENDS = ustream-ssl
  18. PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua
  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 +libjson-c
  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 uhttpd_lua
  39. depends on PACKAGE_uhttpd-mod-lua
  40. bool "Enable Integrated Lua interpreter"
  41. default y
  42. endef
  43. define Package/uhttpd-mod-lua
  44. $(Package/uhttpd/default)
  45. TITLE+= (Lua plugin)
  46. DEPENDS:=uhttpd +liblua
  47. endef
  48. define Package/uhttpd-mod-lua/description
  49. The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd.
  50. endef
  51. define Package/uhttpd-mod-ubus
  52. $(Package/uhttpd/default)
  53. TITLE+= (ubus plugin)
  54. DEPENDS:=uhttpd +libubus +libblobmsg-json
  55. endef
  56. define Package/uhttpd-mod-ubus/description
  57. The ubus plugin adds a HTTP/JSON RPC proxy for ubus and publishes the
  58. session.* namespace and procedures.
  59. endef
  60. define Package/uhttpd/conffiles
  61. /etc/config/uhttpd
  62. /etc/uhttpd.crt
  63. /etc/uhttpd.key
  64. endef
  65. ifneq ($(CONFIG_USE_GLIBC),)
  66. TARGET_CFLAGS += -D_DEFAULT_SOURCE
  67. endif
  68. TARGET_LDFLAGS += -lcrypt
  69. CMAKE_OPTIONS = -DTLS_SUPPORT=on
  70. define Package/uhttpd/install
  71. $(INSTALL_DIR) $(1)/etc/init.d
  72. $(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
  73. $(INSTALL_DIR) $(1)/etc/config
  74. $(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
  75. $(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
  76. $(INSTALL_DIR) $(1)/usr/sbin
  77. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
  78. endef
  79. define Package/uhttpd-mod-lua/install
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_lua.so $(1)/usr/lib/
  82. endef
  83. define Package/uhttpd-mod-ubus/install
  84. $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/uci-defaults
  85. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd_ubus.so $(1)/usr/lib/
  86. $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus
  87. endef
  88. $(eval $(call BuildPackage,uhttpd))
  89. $(eval $(call BuildPackage,uhttpd-mod-lua))
  90. $(eval $(call BuildPackage,uhttpd-mod-ubus))