[arch-commits] Commit in mbedtls/trunk (PKGBUILD)

Levente Polyak anthraxx at archlinux.org
Mon Jul 27 19:42:26 UTC 2020


    Date: Monday, July 27, 2020 @ 19:42:26
  Author: anthraxx
Revision: 665516

upgpkg: mbedtls 2.16.7-1: switch to new source dist on github

Modified:
  mbedtls/trunk/PKGBUILD

----------+
 PKGBUILD |   43 +++++++++++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-27 19:37:13 UTC (rev 665515)
+++ PKGBUILD	2020-07-27 19:42:26 UTC (rev 665516)
@@ -3,7 +3,7 @@
 # Contributor: carstene1ns <arch carsten-teibes.de>
 
 pkgname=mbedtls
-pkgver=2.16.6
+pkgver=2.16.7
 pkgrel=1
 pkgdesc="Portable cryptographic and SSL/TLS library, aka polarssl"
 arch=('x86_64')
@@ -11,35 +11,50 @@
 license=('Apache')
 depends=('glibc' 'sh')
 checkdepends=('python')
+makedepends=('cmake')
 provides=('polarssl' 'libmbedcrypto.so' 'libmbedtls.so' 'libmbedx509.so')
 replaces=('polarssl')
 conflicts=('polarssl')
 options=('staticlibs')
-source=("https://tls.mbed.org/download/mbedtls-$pkgver-apache.tgz")
-sha1sums=('3cb5b681597a5bd798d31038c129c0dc911d8a2c')
-b2sums=('a72be1d7515ac28c54158aa00c6b3f39e3d35e7a92422e545715934945faa8e0cbc6bde3b5208cc4293066e14e7e14a6dbf629b8585860b0b5e3466328e473ed')
+source=(https://github.com/ARMmbed/mbedtls/archive/${pkgname}-${pkgver}.tar.gz)
+sha256sums=('4786b7d1676f5e4d248f3a7f2d28446876d64962634f060ff21b92c690cfbe86')
+b2sums=('cb53ac0c8896ce0dcc2b54edf4964267bf27057fead00f82f15de0ead786efcb4ba7e554e1c06ccb8a0f9fdedd512d94dce74a7a6e093c0a488ef257ded1458a')
 
 prepare() {
-  cd "$pkgname-$pkgver"
+  cd "$pkgname-$pkgname-$pkgver"
   # enable flags for non-embedded systems
   sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' include/mbedtls/config.h
   sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/config.h
-
-  # FS#49914 (2.3.0-2)
-  sed -i 's|<time.h>|"platform.h"|' include/mbedtls/ssl.h
 }
 
 build() {
-  cd "$pkgname-$pkgver"
-  LDFLAGS+=" -I../include " make SHARED=1 no_test
+  cd "$pkgname-$pkgname-$pkgver"
+  cmake \
+    -B build \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_VERBOSE_MAKEFILE=ON \
+    -DUSE_SHARED_MBEDTLS_LIBRARY=ON \
+	-DCMAKE_INSTALL_RPATH=
+  make -C build
 }
 
 check() {
-  cd "$pkgname-$pkgver"
-  make SHARED=1 PYTHON=python check
+  cd "$pkgname-$pkgname-$pkgver"
+  make -C build test
 }
 
 package() {
-  cd "$pkgname-$pkgver"
-  make DESTDIR="$pkgdir/usr" install
+  cd "$pkgname-$pkgname-$pkgver"
+  make -C build DESTDIR="$pkgdir" install
+
+  # rename generic utils
+  local _prog _baseprog
+  for _prog in "$pkgdir"/usr/bin/*; do
+	_baseprog=$(basename "$_prog")
+    mv -v "$_prog" "${_prog//$_baseprog/mbedtls_$_baseprog}"
+  done
+
+  # fixup static lib permissions
+  chmod 644 "$pkgdir"/usr/lib/*.a
 }



More information about the arch-commits mailing list