# $Id$ # Maintainer: Pierre Schmitz # ALARM: Kevin Mihelich # - use linux-armv4 target for our architectures # - cryptodev-enabled version # # moonman # - replace eng_cryptodev in openssl with the one provided with cryptodev # - get cryptodev.h from cryptodev tarball instead of the kernel headers # - patch eng_cryptodev to bring it up to date with upstream buildarch=6 pkgname=openssl-cryptodev _pkgname=openssl _ver=1.0.1f # use a pacman compatible version scheme pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}} #pkgver=$_ver pkgrel=1 pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security' arch=('arm' 'armv7h') url='https://www.openssl.org' license=('custom:BSD') depends=('perl') optdepends=('ca-certificates') options=('!makeflags') backup=('etc/ssl/openssl.cnf') conflicts=('openssl') provides=("openssl=${pkgver}") _cryptover=1.6 source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz" 'no-rpath.patch' 'ca-dir.patch' 'openssl-1.0.1f-perl-5.18.patch' "http://download.gna.org/cryptodev-linux/cryptodev-linux-${_cryptover}.tar.gz" 'https://github.com/openssl/openssl/commit/ea5003bd1eecc79e2b3e9fad302d5c4ab326e2ad.patch') md5sums=('f26b09c028a0541cab33da697d522b25' 'dc78d3d06baffc16217519242ce92478' '3bf51be3a1bbd262be46dc619f92aa90' 'ea2a61c8bd43788d81d98f1ac36c98ac' 'eade38998313c25fd7934719cdf8a2ea' '0c3cc233353c1666a1de16aeafecc595') prepare() { cd $srcdir/${_pkgname}-$_ver # remove rpath: http://bugs.archlinux.org/task/14367 patch -p0 -i $srcdir/no-rpath.patch # set ca dir to /etc/ssl by default patch -p0 -i $srcdir/ca-dir.patch patch -p1 -i $srcdir/openssl-1.0.1f-perl-5.18.patch #Replace eng_cryptodev.c with cryptodev version cp -u ${srcdir}/cryptodev-linux-${_cryptover}/extras/eng_cryptodev.c ${srcdir}/openssl-${_ver}/crypto/engine/ #Patch the newly replaced eng_cryptodev to bring it up to date patch -p1 -i $srcdir/ea5003bd1eecc79e2b3e9fad302d5c4ab326e2ad.patch #Copy the header file cp -u ${srcdir}/cryptodev-linux-${_cryptover}/crypto/cryptodev.h ${srcdir}/openssl-${_ver}/crypto/ } build() { cd $srcdir/${_pkgname}-$_ver if [ "${CARCH}" == 'x86_64' ]; then openssltarget='linux-x86_64' elif [ "${CARCH}" == 'i686' ]; then openssltarget='linux-elf' elif [ "${CARCH}" == 'arm' -o "${CARCH}" == 'armv7h' ]; then openssltarget='linux-armv4' fi # mark stack as non-executable: http://bugs.archlinux.org/task/12434 ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib \ -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DHASH_MAX_LEN=64 \ shared threads zlib \ "${openssltarget}" \ -Wa,--noexecstack "${CFLAGS}" make depend make } check() { cd $srcdir/$_pkgname-$_ver # the test fails due to missing write permissions in /etc/ssl # revert this patch for make test patch -p0 -R -i $srcdir/ca-dir.patch # make test patch -p0 -i $srcdir/ca-dir.patch } package() { depends=('cryptodev_friendly') cd $srcdir/$_pkgname-$_ver make INSTALL_PREFIX=$pkgdir MANDIR=/usr/share/man MANSUFFIX=ssl install install -D -m644 LICENSE $pkgdir/usr/share/licenses/$_pkgname/LICENSE }