blob: cdffbf27559503a8fa1a42465e3933f95ed410f0 (
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
58
59
60
|
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mbedtls
pkgver=2.2.1
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"
# 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="b6909d94600fc5f644e9bca52e96fb27 mbedtls-2.2.1-gpl.tgz"
sha256sums="bb1bffa3ac5ab143be2aae3d45a7a92b36112888ef465024d83724865fe62974 mbedtls-2.2.1-gpl.tgz"
sha512sums="03c32b46369d35e61acfeac83f417d09307d2f1e4358f9ea6af275d9a9a2319ca7a244733b5950a48d59f6305e4adcad6a66e589b42ee7417d1d4362c2595a4f mbedtls-2.2.1-gpl.tgz"
|