aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mbedtls/APKBUILD
blob: bf26d105ae8feea37b890673d4078c49f8decea3 (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.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"