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.

70 lines
2.2 KiB

  1. # Copyright (C) 2019 Eneas Ulir de Queiroz <cotequeiroz@gmail.com>
  2. #
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=afalg_engine
  8. PKG_VERSION:=1.0.1
  9. PKG_RELEASE:=1
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://github.com/cotequeiroz/afalg_engine/archive/v$(PKG_VERSION)
  12. PKG_HASH:=ef3ee1ba3cb4e9145f9a0dea5bc6d3fe6cb7b5b9e68053d474829e84dc1c4988
  13. PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_CONFIG_DEPENDS:= CONFIG_AFALG_ZERO_COPY
  17. include $(INCLUDE_DIR)/package.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. $(eval $(shell grep "^ENGINES_DIR" "$(TOPDIR)/package/libs/openssl/Makefile"))
  20. ifeq ($(ENGINES_DIR),)
  21. ENGINES_DIR:=engines-1.1
  22. endif
  23. define Package/libopenssl-afalg_sync
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. SUBMENU:=SSL
  27. MDEPENDS:=libopenssl
  28. TITLE:=AF_ALG engine using sync crypto API
  29. URL:=https://github.com/cotequeiroz/afalg_engine
  30. DEPENDS:=libopenssl @OPENSSL_ENGINE @!OPENSSL_ENGINE_BUILTIN_AFALG \
  31. +libopenssl-conf +kmod-crypto-user
  32. CONFLICTS:=libopenssl-afalg
  33. endef
  34. define Package/libopenssl-afalg_sync/description
  35. This is an alternate AF_ALG engine for openssl, based on the devcrypto
  36. engine, but using the AF_ALG interface instead of /dev/crypto
  37. It is different than the AF_ALG engine that ships with OpenSSL:
  38. - it uses sync calls, instead of async
  39. - it suports more algorithms
  40. endef
  41. define Package/libopenssl-afalg_sync/config
  42. config AFALG_ZERO_COPY
  43. depends on PACKAGE_libopenssl-afalg_sync
  44. bool "Use Zero-Copy Mode"
  45. help
  46. Uses a Zero-Copy interface. Even though it is supposed to improve
  47. performance, actual measurements indicate otherwise.
  48. endef
  49. CMAKE_OPTIONS += \
  50. -DOPENSSL_ENGINES_DIR=/usr/lib/$(ENGINES_DIR) \
  51. -DUSE_ZERO_COPY=$(if $(AFALG_ZERO_COPY),ON,OFF)
  52. define Package/libopenssl-afalg_sync/install
  53. $(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR)
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(ENGINES_DIR)/afalg.so \
  55. $(1)/usr/lib/$(ENGINES_DIR)/
  56. endef
  57. $(eval $(call BuildPackage,libopenssl-afalg_sync))