aboutsummaryrefslogtreecommitdiffstats
path: root/main/mbedtls
diff options
context:
space:
mode:
authorŁukasz Jendrysik <scadu@yandex.com>2015-03-19 13:00:32 +0100
committerŁukasz Jendrysik <scadu@yandex.com>2015-03-19 13:04:23 +0100
commit3a49adfaacb3217928700ba8737ab74be9a1ab6c (patch)
tree110c67ec313df1f158c2e9aad753c1c132d49c43 /main/mbedtls
parentfba418bcbac68007164daf6f681e67d765885adf (diff)
downloadaports-3a49adfaacb3217928700ba8737ab74be9a1ab6c.tar.bz2
aports-3a49adfaacb3217928700ba8737ab74be9a1ab6c.tar.xz
main/polarssl: rebrand to mbedtls, upgrade to 1.3.10
Diffstat (limited to 'main/mbedtls')
-rw-r--r--main/mbedtls/APKBUILD53
-rw-r--r--main/mbedtls/programs.makefile.patch22
2 files changed, 75 insertions, 0 deletions
diff --git a/main/mbedtls/APKBUILD b/main/mbedtls/APKBUILD
new file mode 100644
index 0000000000..234053c4d8
--- /dev/null
+++ b/main/mbedtls/APKBUILD
@@ -0,0 +1,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"
diff --git a/main/mbedtls/programs.makefile.patch b/main/mbedtls/programs.makefile.patch
new file mode 100644
index 0000000000..421f39cfcb
--- /dev/null
+++ b/main/mbedtls/programs.makefile.patch
@@ -0,0 +1,22 @@
+--- programs/Makefile 2014-07-31 12:20:17.748459143 -0400
++++ programs/Makefile 2014-07-31 12:21:35.388454356 -0400
+@@ -43,7 +43,7 @@
+ test/selftest test/ssl_test \
+ util/pem2der util/strerror \
+ x509/cert_app x509/crl_app \
+- x509/cert_req
++ x509/cert_req x509/cert_write
+
+ ifdef OPENSSL
+ APPS += test/o_p_test
+@@ -241,6 +241,10 @@
+ echo " CC x509/cert_req.c"
+ $(CC) $(CFLAGS) $(OFLAGS) x509/cert_req.c $(LDFLAGS) -o $@
+
++x509/cert_write: x509/cert_write.c ../library/libpolarssl.a
++ echo " CC x509/cert_write.c"
++ $(CC) $(CFLAGS) $(OFLAGS) x509/cert_write.c $(LDFLAGS) -o $@
++
+ clean:
+ ifndef WINDOWS
+ rm -f $(APPS)