# Maintainer: Natanael Copa pkgver=1.1.0h _osslver=${pkgver%.*} pkgname=openssl$_osslver pkgrel=2 pkgdesc="Toolkit for SSL v2/v3 and TLS v1" url="https://www.openssl.org" arch="all" license="OpenSSL" depends_dev="zlib-dev" makedepends_build="perl" makedepends_host="zlib-dev linux-headers" makedepends="$makedepends_host $makedepends_build" subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc openssl$_osslver-libcrypto:_libcrypto openssl$_osslver-libssl:_libssl" source="http://www.openssl.org/source/openssl-$pkgver.tar.gz CVE-2018-0732.patch " builddir="$srcdir/openssl-$pkgver" build() { local _target _optflags cd "$builddir" # openssl will prepend crosscompile always core CC et al CC=${CC#${CROSS_COMPILE}} CXX=${CXX#${CROSS_COMPILE}} CPP=${CPP#${CROSS_COMPILE}} # determine target OS for openssl case "$CARCH" in aarch64*) _target="linux-aarch64" ;; arm*) _target="linux-armv4" ;; ppc64le) _target="linux-ppc64le" ;; x86) _target="linux-elf" ;; x86_64) _target="linux-x86_64"; _optflags="enable-ec_nistp_64_gcc_128" ;; s390x) _target="linux64-s390x";; *) msg "Unable to determine architecture from (CARCH=$CARCH)" ; return 1 ;; esac # Configure assumes --options are for it, so can't use # gcc's --sysroot fake this by overriding CC [ -n "$CBUILDROOT" ] && CC="$CC --sysroot=${CBUILDROOT}" perl ./Configure $_target --prefix=/usr \ --libdir=lib \ --openssldir=/etc/ssl \ shared zlib $_optflags \ -DOPENSSL_NO_ASYNC \ $CPPFLAGS $CFLAGS $LDFLAGS -Wa,--noexecstack make } check() { cd "$builddir" make -j1 test } package() { cd "$builddir" make DESTDIR="$pkgdir" MANDIR=/usr/share/man MANSUFFIX=ssl install # remove the script c_rehash rm "$pkgdir"/usr/bin/c_rehash } _libcrypto() { pkgdesc="Crypto library from openssl" mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib for i in "$pkgdir"/usr/lib/libcrypto*; do mv $i "$subpkgdir"/lib/ ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/} done mv "$pkgdir"/usr/lib/engines-$_osslver "$subpkgdir"/usr/lib/ } _libssl() { pkgdesc="SSL shared libraries" mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib for i in "$pkgdir"/usr/lib/libssl*; do mv $i "$subpkgdir"/lib/ ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/} done } sha512sums="fb7750fcd98e6126eb5b92e7ed63d811a5cfa3391d98572003d925f6c7b477690df86a9aa1fa6bf6bf33d02c6c7aee6cff50a38faa8911409f310645898fda39 openssl-1.1.0h.tar.gz ff91298629f157496a012da00ba7325923f5d087bfa54b60e205bf2dfb06374e958912e0df39dbdf39773555455c1a3afa3dcde1ddfec6e85cf89b0b62cc0eb4 CVE-2018-0732.patch"