lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (2710B)


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