# Contributor: Ɓukasz Jendrysik # Maintainer: Natanael Copa pkgname=mbedtls pkgver=2.2.0 pkgrel=0 pkgdesc="Light-weight cryptographic and SSL/TLS library" url="https://tls.mbed.org/" arch="all" license="GPLv2+ with exceptions" depends="" depends_dev="" makedepends="$depends_dev cmake perl" install="" subpackages="$pkgname-static $pkgname-dev $pkgname-utils" source="https://tls.mbed.org/download/mbedtls-$pkgver-gpl.tgz" _builddir="$srcdir"/mbedtls-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" cmake . \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE="Release" \ -DUSE_SHARED_MBEDTLS_LIBRARY=1 \ || return 1 make || 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="69165befb762895234c7600cd5cdb789 mbedtls-2.2.0-gpl.tgz" sha256sums="451c1b864b5d07df9830f67af600ea6d53629df4484d38e86b2edc7a7526077c mbedtls-2.2.0-gpl.tgz" sha512sums="1522305abae952ac07a9f5d2f8ef9530ab86e1ce5867e5b5d18e15150bf8b0db2834cbd1bea98448ddcc0136bba325675efc66117d775bd52b848a97a04ce258 mbedtls-2.2.0-gpl.tgz"