aboutsummaryrefslogtreecommitdiffstats
path: root/main/polarssl/APKBUILD
blob: 5789a0d791d6ed031d04fbbe45e4a3f6765ba0ac (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
# 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
        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/polarssl_cert_write
}

md5sums="d1a2b4f21727e888f143414d2e3144e6  polarssl-1.3.8-gpl.tgz
b4c7ae55bd3c32cdcb067fd71faf8577  programs.makefile.patch"
sha256sums="318171db41335cacbb5b0047c94f1faf91442ab70a223b5223436703c9406ff1  polarssl-1.3.8-gpl.tgz
c1341f041cedcb0a321f23851c1d2756fe3c2340e76e2604fdb6af824344f034  programs.makefile.patch"
sha512sums="e1bf2b111510582ebf071b11d9d0663fbd02ac61f6ded9611e2f0eb5ff64b421d72768dd94ec5e52353d3bde06bc62d673211c26debab2cd7b3c86108d2de627  polarssl-1.3.8-gpl.tgz
32570b0f5f1e92ea0ac1c12e79a888289f35b03b4350935c585738c1d3875768b048c9b830b0286ea99be3c96b72cb62c079bc0b4106fab93a39a6590861c251  programs.makefile.patch"