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.

62 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.0.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:=07cc357a94e29c5a04eea46331352c869beed01d7fd6cc23972e878a5c4b023c
  14. PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
  15. PKG_LICENSE:=MIT
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_BUILD_PARALLEL:=1
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/libuhttpd/Default
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. SUBMENU:=Networking
  25. TITLE:=A lightweight HTTP server library based on libev
  26. URL:=https://github.com/zhaojh329/libuhttpd
  27. DEPENDS:=+libev $(2)
  28. VARIANT:=$(1)
  29. PROVIDES:=libuhttpd
  30. endef
  31. Package/libuhttpd-openssl=$(call Package/libuhttpd/Default,openssl,+PACKAGE_libuhttpd-openssl:libopenssl)
  32. Package/libuhttpd-wolfssl=$(call Package/libuhttpd/Default,wolfssl,+PACKAGE_libuhttpd-wolfssl:libwolfssl)
  33. Package/libuhttpd-mbedtls=$(call Package/libuhttpd/Default,mbedtls,+PACKAGE_libuhttpd-mbedtls:libmbedtls)
  34. Package/libuhttpd-nossl=$(call Package/libuhttpd/Default,nossl)
  35. ifeq ($(BUILD_VARIANT),openssl)
  36. CMAKE_OPTIONS += -DUHTTPD_USE_OPENSSL=ON
  37. else ifeq ($(BUILD_VARIANT),wolfssl)
  38. CMAKE_OPTIONS += -DUHTTPD_USE_WOLFSSL=ON
  39. else ifeq ($(BUILD_VARIANT),mbedtls)
  40. CMAKE_OPTIONS += -DUHTTPD_USE_MBEDTLS=ON
  41. else
  42. CMAKE_OPTIONS += -DUHTTPD_SSL_SUPPORT=OFF
  43. endif
  44. define Package/libuhttpd-$(BUILD_VARIANT)/install
  45. $(INSTALL_DIR) $(1)/usr/lib
  46. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuhttpd.so* $(1)/usr/lib/
  47. endef
  48. $(eval $(call BuildPackage,libuhttpd-openssl))
  49. $(eval $(call BuildPackage,libuhttpd-mbedtls))
  50. $(eval $(call BuildPackage,libuhttpd-wolfssl))
  51. $(eval $(call BuildPackage,libuhttpd-nossl))