summaryrefslogtreecommitdiffstats
path: root/main/polarssl/APKBUILD
blob: c7a517a0a2d0fb06357165d70503221f921301bc (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
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>

pkgname=polarssl
pkgver=1.3.8
pkgrel=1
pkgdesc='Portable cryptographic and SSL/TLS library'
arch=all
url='https://www.polarssl.org/'
license='GPL2'
subpackages="$pkgname-dev $pkgname-utils"
source="https://polarssl.org/code/releases/polarssl-$pkgver-gpl.tgz"

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
}

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

  # bundled makefile omit this tool completely without good reason
  cd programs/x509
  cc -Wall -Wextra -W -Wdeclaration-after-statement cert_write.c \
    -o cert_write -rdynamic ../../library/libpolarssl.a
}

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/polarssl_cert_write
}

md5sums="d1a2b4f21727e888f143414d2e3144e6  polarssl-1.3.8-gpl.tgz"
sha256sums="318171db41335cacbb5b0047c94f1faf91442ab70a223b5223436703c9406ff1  polarssl-1.3.8-gpl.tgz"
sha512sums="e1bf2b111510582ebf071b11d9d0663fbd02ac61f6ded9611e2f0eb5ff64b421d72768dd94ec5e52353d3bde06bc62d673211c26debab2cd7b3c86108d2de627  polarssl-1.3.8-gpl.tgz"