PKGBUILDs/core/openssl-cryptodev/PKGBUILD

88 lines
2.5 KiB
Bash
Raw Normal View History

# $Id$
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2017-04-28 02:07:57 +00:00
# - set ARM architecture targets
# Oleg Rakhmanov <oleg@archlinuxarm.org>
# - cryptodev enabled version
buildarch=6
pkgname=openssl-cryptodev
_pkgname=openssl
2018-04-07 00:07:36 +00:00
_ver=1.1.0h
# use a pacman compatible version scheme
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
2012-04-19 14:31:02 +00:00
#pkgver=$_ver
2018-04-07 00:07:36 +00:00
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')
backup=('etc/ssl/openssl.cnf')
2017-04-28 02:07:57 +00:00
conflicts=('openssl')
provides=("openssl=${pkgver}")
_cryptodevver=1.9
2015-01-25 20:04:52 +00:00
2012-04-19 18:35:55 +00:00
source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz"
'ca-dir.patch'
2017-04-28 02:07:57 +00:00
"https://github.com/cryptodev-linux/cryptodev-linux/archive/cryptodev-linux-${_cryptodevver}.tar.gz")
2018-04-07 00:07:36 +00:00
md5sums=('5271477e4d93f4ea032b665ef095ff24'
2017-04-28 02:07:57 +00:00
'02b53865fb70faef763e262b4971aa4b'
'e5aacd2293cea9c94f71ca2e0b4dea57')
2013-10-23 14:09:06 +00:00
prepare() {
2017-09-21 01:56:49 +00:00
cd "$srcdir/$_pkgname-$_ver"
2013-12-16 10:28:41 +00:00
2017-04-28 02:07:57 +00:00
# set ca dir to /etc/ssl by default
2017-09-21 01:56:49 +00:00
patch -p0 -i "$srcdir/ca-dir.patch"
2013-12-16 10:28:41 +00:00
2017-04-28 02:07:57 +00:00
# Copy the header file
cp -u ${srcdir}/cryptodev-linux-cryptodev-linux-${_cryptodevver}/crypto/cryptodev.h ${srcdir}/openssl-${_ver}/crypto/
2013-10-23 14:09:06 +00:00
}
build() {
2017-09-21 01:56:49 +00:00
cd "$srcdir/$_pkgname-$_ver"
if [ "${CARCH}" == 'x86_64' ]; then
openssltarget='linux-x86_64'
2017-04-28 02:07:57 +00:00
optflags='enable-ec_nistp_64_gcc_128'
elif [ "${CARCH}" == 'i686' ]; then
openssltarget='linux-elf'
2017-04-28 02:07:57 +00:00
optflags=''
elif [ "${CARCH}" == 'arm' -o "${CARCH}" == 'armv6h' -o "${CARCH}" == 'armv7h' ]; then
openssltarget='linux-armv4'
2017-04-28 02:07:57 +00:00
optflags=''
elif [ "${CARCH}" == 'aarch64' ]; then
openssltarget='linux-aarch64'
optflags='no-afalgeng'
fi
# mark stack as non-executable: http://bugs.archlinux.org/task/12434
2017-04-28 02:07:57 +00:00
./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib \
-DHAVE_CRYPTODEV -DHASH_MAX_LEN=64 \
2017-04-28 02:07:57 +00:00
shared no-ssl3-method ${optflags} \
"${openssltarget}" \
2014-07-05 07:26:46 +00:00
"-Wa,--noexecstack ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}"
make depend
make
}
check() {
2017-09-21 01:56:49 +00:00
cd "$srcdir/$_pkgname-$_ver"
# the test fails due to missing write permissions in /etc/ssl
# revert this patch for make test
2017-09-21 01:56:49 +00:00
patch -p0 -R -i "$srcdir/ca-dir.patch"
2014-07-05 07:26:46 +00:00
make test
2017-09-21 01:56:49 +00:00
patch -p0 -i "$srcdir/ca-dir.patch"
}
package() {
2017-09-21 01:56:49 +00:00
cd "$srcdir/$_pkgname-$_ver"
2017-04-28 02:07:57 +00:00
make DESTDIR=$pkgdir MANDIR=/usr/share/man MANSUFFIX=ssl install_sw install_ssldirs install_man_docs
install -D -m644 LICENSE $pkgdir/usr/share/licenses/$_pkgname/LICENSE
}