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.

71 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2009-2014 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:=libsodium
  9. PKG_VERSION:=0.7.0
  10. PKG_RELEASE:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases
  14. PKG_MD5SUM:=b9029bf810c4b5a8acc3afec1286a36a
  15. PKG_CAT:=zcat
  16. PKG_FIXUP:=libtool autoreconf
  17. PKG_USE_MIPS16:=0
  18. PKG_INSTALL:=1
  19. PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  20. PKG_LICENSE:=ISC
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/libsodium
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=P(ortable|ackageable) NaCl-based crypto library
  26. URL:=https://github.com/jedisct1/libsodium
  27. MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  28. endef
  29. define Package/libsodium/description
  30. NaCl (pronounced "salt") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc.
  31. NaCl's goal is to provide all of the core operations needed to build higher-level cryptographic tools.
  32. Sodium is a portable, cross-compilable, installable, packageable fork of NaCl (based on the latest released upstream version nacl-20110221), with a compatible API.
  33. The design choices, particularly in regard to the Curve25519 Diffie-Hellman function, emphasize security (whereas NIST curves emphasize "performance" at the cost of security), and "magic constants" in NaCl/Sodium have clear rationales.
  34. The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards.
  35. And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards.
  36. endef
  37. define Package/libsodium/config
  38. menu "Configuration"
  39. config LIBSODIUM_MINIMAL
  40. bool "Create a smaller library"
  41. default n
  42. endmenu
  43. endef
  44. CONFIGURE_ARGS+= \
  45. --disable-ssp \
  46. $(if $(CONFIG_LIBSODIUM_MINIMAL),--enable-minimal=yes,--enable-minimal=no)
  47. define Build/InstallDev
  48. $(INSTALL_DIR) $(1)/usr/include/sodium
  49. $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium.h $(1)/usr/include
  50. $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium/*.h $(1)/usr/include/sodium
  51. $(INSTALL_DIR) $(1)/usr/lib
  52. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.{a,so*} $(1)/usr/lib
  53. endef
  54. define Package/libsodium/install
  55. $(INSTALL_DIR) $(1)/usr/lib
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.so.* $(1)/usr/lib/
  57. endef
  58. $(eval $(call BuildPackage,libsodium))