1
0

Makefile 2.6 KB

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