# Contributor: Ɓukasz Jendrysik # Maintainer: Natanael Copa pkgname=mbedtls pkgver=2.3.0 pkgrel=0 pkgdesc="Light-weight cryptographic and SSL/TLS library" url="https://tls.mbed.org/" arch="all" license="GPL2+ ASL 2.0" depends="" depends_dev="" makedepends="$depends_dev cmake perl" install="" subpackages="$pkgname-static $pkgname-dev $pkgname-utils" source="https://tls.mbed.org/download/$pkgname-$pkgver-gpl.tgz" builddir="$srcdir"/$pkgname-$pkgver build() { cd "$builddir" # this work-around is the same one used in Arch Linux's package # see https://github.com/ARMmbed/mbedtls/issues/522 sed -i 's||"platform.h"|' include/mbedtls/ssl.h # enable flags for non-embedded systems sed -i -e 's|//\(#define MBEDTLS_THREADING_C\)|\1|' -e 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/config.h cmake . \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE="Release" \ -DUSE_SHARED_MBEDTLS_LIBRARY=1 \ || return 1 make || return 1 make test || return 1 } package() { cd "$builddir" make DESTDIR="$pkgdir" install || return 1 } utils() { pkgdesc="Utilities for mbedtls" mkdir -p "$subpkgdir"/usr/libexec mv "$pkgdir"/usr/bin "$subpkgdir"/usr/libexec/mbedtls || return 1 } static() { pkgdesc="Static files for mbedtls" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/ } md5sums="3f396d21b9c86c0a11ac9ba0b6e6f999 mbedtls-2.3.0-gpl.tgz" sha256sums="21237014f779bde70b2d71399cc1ea53365eb7f10cdd74a13ee6329a1910cb49 mbedtls-2.3.0-gpl.tgz" sha512sums="f86ec87735b919e23ad7eb960a290013e7dfc2a5953d662ecee4eca7b990384c095aea74a313eaa0e1febb74e0c015879f4d680d51bc5eae811ab9e5063ba38a mbedtls-2.3.0-gpl.tgz"