aboutsummaryrefslogtreecommitdiffstats
path: root/main/mbedtls/APKBUILD
blob: 234053c4d8136173c4478672c2599bbc6ffd8411 (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
# Maintainer: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>

pkgname=mbedtls
pkgver=1.3.10
pkgrel=0
pkgdesc='Portable cryptographic and SSL/TLS library'
arch=all
url='https://www.tls.mbed.org/'
license='GPL2'
subpackages="$pkgname-dev $pkgname-utils"
source="https://tls.mbed.org/download/$pkgname-$pkgver-gpl.tgz
        programs.makefile.patch"

prepare() {
  cd "$srcdir"/$pkgname-$pkgver
  sed -i 's|//\(#define POLARSSL_THREADING_C\)|\1|' include/polarssl/config.h
  sed -i 's|//\(#define POLARSSL_THREADING_PTHREAD\)|\1|' include/polarssl/config.h

  # cert_write
  patch -p1 -d programs -i "$srcdir"/programs.makefile.patch
}

build() {
  cd "$srcdir"/$pkgname-$pkgver
  LDFLAGS="$LDFLAGS -I../include " make SHARED=1 no_test || return 1
}

check() {
  cd "$srcdir"/$pkgname-$pkgver
  make SHARED=1 check || return 1
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  make DESTDIR="$pkgdir/usr" install || return 1
}

utils() {
  pkgdesc='PolarSSL command line utilities'
  install -d "$subpkgdir"/usr
  mv "$pkgdir"/usr/bin "$subpkgdir"/usr/

  install -Dm755 "$srcdir"/$pkgname-$pkgver/programs/x509/cert_write \
    "$subpkgdir"/usr/bin/mbedtls_cert_write
}

md5sums="19ebbc96feceb430ad958dfe89cb633f  mbedtls-1.3.10-gpl.tgz
b4c7ae55bd3c32cdcb067fd71faf8577  programs.makefile.patch"
sha256sums="746fd88e0c6623691fc56c4eed52e40a57b2da0ac80f6dd8995094aa6adb407e  mbedtls-1.3.10-gpl.tgz
c1341f041cedcb0a321f23851c1d2756fe3c2340e76e2604fdb6af824344f034  programs.makefile.patch"
sha512sums="9c29b308ddfa37705e1a00130f59fe6a7b7b155a3e125aa2e277fc9b4f32b8d73eb771db4800d3bb33f7633c38f653f4004a3aa748f77849a44bd39d1f55c776  mbedtls-1.3.10-gpl.tgz
32570b0f5f1e92ea0ac1c12e79a888289f35b03b4350935c585738c1d3875768b048c9b830b0286ea99be3c96b72cb62c079bc0b4106fab93a39a6590861c251  programs.makefile.patch"