aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-07-22 13:46:03 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-07-22 14:02:01 +0200
commit5844fdc04fa839ce6dca229918343a0ab5b9fa71 (patch)
tree63749d6870c0e6f4ce43a826aab63533086819f6
parent3a0985ebcd46a5330bdb0cce79b8815a7c90dd41 (diff)
downloadaports-5844fdc04fa839ce6dca229918343a0ab5b9fa71.tar.bz2
aports-5844fdc04fa839ce6dca229918343a0ab5b9fa71.tar.xz
community/mbedtls: modernize abuild
-rw-r--r--community/mbedtls/APKBUILD29
1 files changed, 18 insertions, 11 deletions
diff --git a/community/mbedtls/APKBUILD b/community/mbedtls/APKBUILD
index 827c104f32..8492130a8d 100644
--- a/community/mbedtls/APKBUILD
+++ b/community/mbedtls/APKBUILD
@@ -7,7 +7,6 @@ pkgdesc="Light-weight cryptographic and SSL/TLS library"
url="https://tls.mbed.org/"
arch="all"
license="GPL2+ ASL 2.0"
-depends=""
makedepends="cmake perl"
subpackages="$pkgname-static $pkgname-dev $pkgname-utils"
source="$pkgname-$pkgver.tar.gz::https://github.com/ARMmbed/$pkgname/archive/$pkgname-$pkgver.tar.gz
@@ -18,38 +17,46 @@ builddir="$srcdir/$pkgname-$pkgname-$pkgver"
# 2.4.2-r0:
# - CVE-2017-2784
+prepare() {
+ default_prepare
+
+ # Enable flags for non-embedded systems.
+ sed -i \
+ -e 's|//\(#define MBEDTLS_THREADING_C\)|\1|' \
+ -e 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' \
+ "$builddir"/include/mbedtls/config.h
+}
+
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
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DUSE_SHARED_MBEDTLS_LIBRARY=ON
+ make
}
check() {
cd "$builddir"
- make test || return 1
+ make test
}
package() {
cd "$builddir"
- make DESTDIR="$pkgdir" install || return 1
+ make DESTDIR="$pkgdir" install
}
utils() {
pkgdesc="Utilities for mbedtls"
+
mkdir -p "$subpkgdir"/usr/libexec
- mv "$pkgdir"/usr/bin "$subpkgdir"/usr/libexec/mbedtls || return 1
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/libexec/mbedtls
}
static() {
pkgdesc="Static files for mbedtls"
+
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}