2018-11-26 20:46:39 +01:00
|
|
|
VERSION="1.1.1a"
|
2018-01-22 13:03:48 +01:00
|
|
|
SRCDIR="openssl-${VERSION}"
|
|
|
|
TARBALL="${SRCDIR}.tar.gz"
|
|
|
|
URL="https://www.openssl.org/source"
|
2018-11-26 20:46:39 +01:00
|
|
|
SHA256SUM="fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41"
|
2019-02-27 14:22:03 +01:00
|
|
|
DEPENDS="zlib-dev crt-dev"
|
|
|
|
SUBPKG="openssl openssl-dev"
|
2018-01-22 13:03:48 +01:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2018-10-19 18:47:47 +02:00
|
|
|
local OPENSSL_TARGET=""
|
2018-10-20 19:27:23 +02:00
|
|
|
local cflags="-O2 -Os"
|
2018-10-19 13:02:06 +02:00
|
|
|
local ldflags=""
|
|
|
|
|
2019-01-14 09:05:41 +01:00
|
|
|
if [ "x$TC_HARDENING" = "xyes" ]; then
|
2018-10-20 19:27:23 +02:00
|
|
|
cflags="$cflags -fstack-protector-all"
|
|
|
|
ldflags="$ldflags -z noexecstack -z relro -z now"
|
2018-10-19 13:02:06 +02:00
|
|
|
fi
|
2018-10-14 18:47:20 +02:00
|
|
|
|
2018-10-19 18:47:47 +02:00
|
|
|
case "$TARGET" in
|
|
|
|
i*86-*)
|
|
|
|
OPENSSL_TARGET="linux-generic32 386"
|
|
|
|
;;
|
|
|
|
x86_64-*)
|
|
|
|
OPENSSL_TARGET="linux-x86_64"
|
|
|
|
;;
|
|
|
|
arm-*)
|
|
|
|
OPENSSL_TARGET="linux-generic32"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "don't know how to map $TARGET to OpenSSL arch"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-02-16 23:22:04 +01:00
|
|
|
$1/Configure --prefix=/ --cross-compile-prefix="${TARGET}-" \
|
|
|
|
--openssldir=/etc/ssl --libdir=/lib \
|
2018-10-14 18:47:20 +02:00
|
|
|
CFLAGS="-DOPENSSL_NO_HEARTBEATS $cflags" \
|
|
|
|
LDFLAGS="$ldflags" \
|
2018-02-16 23:22:04 +01:00
|
|
|
threads shared zlib-dynamic no-async $OPENSSL_TARGET
|
2018-01-22 13:03:48 +01:00
|
|
|
|
|
|
|
make -j 1
|
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
|
|
|
local SOURCE="$1"
|
2018-02-16 23:22:04 +01:00
|
|
|
local DEPLOY="$2"
|
2018-01-22 13:03:48 +01:00
|
|
|
|
|
|
|
make DESTDIR="$DEPLOY" install
|
2019-02-03 17:13:28 +01:00
|
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$DEPLOY"
|
2018-01-22 13:03:48 +01:00
|
|
|
}
|
2018-05-06 17:23:31 +02:00
|
|
|
|
|
|
|
check_update() {
|
|
|
|
local version=$(echo $VERSION | sed 's/\([[:lower:]]\)/.\1/g')
|
|
|
|
|
|
|
|
curl --silent -L "$URL" | grep -o ">openssl-[0-9a-z.]*tar.gz<" | \
|
|
|
|
sed 's/>openssl-//g' | sed 's/.tar.gz<//g' | \
|
|
|
|
sed 's/\([[:lower:]]\)/.\1/g' | \
|
|
|
|
verson_find_greatest "$version"
|
2018-10-14 18:47:20 +02:00
|
|
|
}
|