diff options
author | Julian Ospald <hasufell@gentoo.org> | 2015-08-15 00:17:21 +0200 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2015-08-15 00:17:21 +0200 |
commit | 76bfad464c6c12a293099a923b31641e19fc3fb2 (patch) | |
tree | 011194432af919d9303f41083d0eb596702f5b60 /net-libs | |
parent | www-apps/hiawatha-monitor: rm old 0.7-0.8 (diff) | |
download | gentoo-76bfad464c6c12a293099a923b31641e19fc3fb2.tar.gz gentoo-76bfad464c6c12a293099a923b31641e19fc3fb2.tar.bz2 gentoo-76bfad464c6c12a293099a923b31641e19fc3fb2.zip |
net-libs/mbedtls: initial import
Gentoo-Bug: 549662
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/mbedtls/Manifest | 1 | ||||
-rw-r--r-- | net-libs/mbedtls/mbedtls-2.0.0.ebuild | 91 | ||||
-rw-r--r-- | net-libs/mbedtls/metadata.xml | 19 |
3 files changed, 111 insertions, 0 deletions
diff --git a/net-libs/mbedtls/Manifest b/net-libs/mbedtls/Manifest new file mode 100644 index 000000000000..959c256958fa --- /dev/null +++ b/net-libs/mbedtls/Manifest @@ -0,0 +1 @@ +DIST mbedtls-2.0.0.tar.gz 1737179 SHA256 2af7f064580d7b7845c0a430b8111bd2ccc06d79d94589680f811c4c1091a1a1 SHA512 fd9f7e684a67f249512651727a84e5f327975ce05100d865fef8d5078e813eb2fb8d036d47fc2b15c7712e4900719e58718a6fd2a6592836c273f3b38f06eb0f WHIRLPOOL b73dc273ee18f035d25532e537cfdb21223613514f125cfa8e392d838da8f1c1a250915ab51d63b02d52d37a7e68ca21afc97c27388c60d455654238e3a7abc0 diff --git a/net-libs/mbedtls/mbedtls-2.0.0.ebuild b/net-libs/mbedtls/mbedtls-2.0.0.ebuild new file mode 100644 index 000000000000..3aafc185d127 --- /dev/null +++ b/net-libs/mbedtls/mbedtls-2.0.0.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit multilib cmake-utils multilib-minimal + +DESCRIPTION="Cryptographic library for embedded systems" +HOMEPAGE="https://tls.mbed.org/" +SRC_URI="https://github.com/ARMmbed/mbedtls/archive/mbedtls-${PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0/10" # slot for libmbedtls.so +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="cpu_flags_x86_sse2 doc havege programs test threads zlib" + +RDEPEND=" + programs? ( dev-libs/openssl:0 ) + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen media-gfx/graphviz ) + test? ( dev-lang/perl )" + +S=${WORKDIR}/${PN}-${P} + +enable_mbedtls_option() { + local myopt="$@" + # check that config.h syntax is the same at version bump + sed -i \ + -e "s://#define ${myopt}:#define ${myopt}:" \ + include/mbedtls/config.h || die +} + +src_prepare() { + use cpu_flags_x86_sse2 && enable_mbedtls_option MBEDTLS_HAVE_SSE2 + use zlib && enable_mbedtls_option MBEDTLS_ZLIB_SUPPORT + use havege && enable_mbedtls_option MBEDTLS_HAVEGE_C + use threads && enable_mbedtls_option MBEDTLS_THREADING_C + use threads && enable_mbedtls_option MBEDTLS_THREADING_PTHREAD +} + +multilib_src_configure() { + local mycmakeargs=( + $(multilib_is_native_abi && cmake-utils_use_enable programs PROGRAMS \ + || echo -DENABLE_PROGRAMS=OFF) + $(cmake-utils_use_enable zlib ZLIB_SUPPORT) + -DUSE_STATIC_MBEDTLS_LIBRARY=OFF + $(cmake-utils_use_enable test TESTING) + -DUSE_SHARED_MBEDTLS_LIBRARY=ON + -DINSTALL_MBEDTLS_HEADERS=ON + -DLIB_INSTALL_DIR="/usr/$(get_libdir)" + ) + + cmake-utils_src_configure +} + +multilib_src_compile() { + cmake-utils_src_compile + use doc && multilib_is_native_abi && emake apidoc +} + +multilib_src_test() { + LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BUILD_DIR}/library" \ + cmake-utils_src_test +} + +multilib_src_install() { + cmake-utils_src_install +} + +multilib_src_install_all() { + einstalldocs + + use doc && dohtml -r apidoc + + if use programs ; then + # avoid file collisions with sys-apps/coreutils + local p e + for p in "${ED%/}"/usr/bin/* ; do + if [[ -x "${p}" && ! -d "${p}" ]] ; then + mv "${p}" "${ED%/}"/usr/bin/mbedtls_${p##*/} || die + fi + done + for e in aes hash pkey ssl test ; do + docinto "${e}" + dodoc programs/"${e}"/*.c + dodoc programs/"${e}"/*.txt + done + fi +} diff --git a/net-libs/mbedtls/metadata.xml b/net-libs/mbedtls/metadata.xml new file mode 100644 index 000000000000..b2d078a68ae4 --- /dev/null +++ b/net-libs/mbedtls/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>hasufell@gentoo.org</email> + <name>Julian Ospald</name> + </maintainer> + <longdescription lang="en"> + The aim of the mbed TLS project is to provide a quality, open-source + cryptographic library written in C and targeted at embedded systems. + </longdescription> + <use> + <flag name="havege">Enable the HAVEGE random generator. + Warning: the HAVEGE random generator is not suitable for + virtualized environments + </flag> + <flag name='programs'>Build PolarSSL programs</flag> + </use> +</pkgmetadata> |