aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mbedtls/APKBUILD
blob: a24df568431dbdf251a294f07bc3fd24bf282130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mbedtls
pkgver=2.1.2
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-2.1.2
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="38b7baae95d6b0826605a1edfffeebe4  mbedtls-2.1.2-gpl.tgz"
sha256sums="0dcca471d1f76352af5e26d64880ef6a30963ad6474a78c0d8e7fbb6dd691fa4  mbedtls-2.1.2-gpl.tgz"
sha512sums="b5869896dd66a4c0493f84dd01b9eb1f134ee4ab6fc559b260400d733f3c8a02a8b9fe50cdad6367c95a0a34995ca4d09270087e659552fcf264995d34d0b261  mbedtls-2.1.2-gpl.tgz"