You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2018 Jianhui Zhao
  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:=libuhttpd
  9. PKG_VERSION:=3.10.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL=https://github.com/zhaojh329/libuhttpd/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=6e7a9ad61e3d0ab5bd4d20b274b850542dff8057a8fcf6c36ce59eb34818f61f
  14. PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
  15. PKG_LICENSE:=MIT
  16. PKG_LICENSE_FILES:=LICENSE
  17. CMAKE_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../devel/ninja/ninja-cmake.mk
  20. define Package/libuhttpd/Default
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. SUBMENU:=Networking
  24. TITLE:=A lightweight HTTP server library based on libev
  25. URL:=https://github.com/zhaojh329/libuhttpd
  26. DEPENDS:=+libev $(2)
  27. VARIANT:=$(1)
  28. PROVIDES:=libuhttpd
  29. endef
  30. Package/libuhttpd-openssl=$(call Package/libuhttpd/Default,openssl,+PACKAGE_libuhttpd-openssl:libopenssl)
  31. Package/libuhttpd-wolfssl=$(call Package/libuhttpd/Default,wolfssl,+PACKAGE_libuhttpd-wolfssl:libwolfssl)
  32. Package/libuhttpd-mbedtls=$(call Package/libuhttpd/Default,mbedtls,+PACKAGE_libuhttpd-mbedtls:libmbedtls +PACKAGE_libuhttpd-mbedtls:zlib)
  33. Package/libuhttpd-nossl=$(call Package/libuhttpd/Default,nossl)
  34. ifeq ($(BUILD_VARIANT),openssl)
  35. CMAKE_OPTIONS += -DUHTTPD_USE_OPENSSL=ON
  36. else ifeq ($(BUILD_VARIANT),wolfssl)
  37. CMAKE_OPTIONS += -DUHTTPD_USE_WOLFSSL=ON
  38. else ifeq ($(BUILD_VARIANT),mbedtls)
  39. CMAKE_OPTIONS += -DUHTTPD_USE_MBEDTLS=ON
  40. else
  41. CMAKE_OPTIONS += -DUHTTPD_SSL_SUPPORT=OFF
  42. endif
  43. define Package/libuhttpd-$(BUILD_VARIANT)/install
  44. $(INSTALL_DIR) $(1)/usr/lib
  45. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuhttpd.so* $(1)/usr/lib/
  46. endef
  47. $(eval $(call BuildPackage,libuhttpd-openssl))
  48. $(eval $(call BuildPackage,libuhttpd-mbedtls))
  49. $(eval $(call BuildPackage,libuhttpd-wolfssl))
  50. $(eval $(call BuildPackage,libuhttpd-nossl))