2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
|
|
|
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
|
|
|
|
|
|
|
PKG_NAME="openssl"
|
2023-06-21 23:41:19 +00:00
|
|
|
PKG_VERSION="3.0.9"
|
2023-02-25 00:39:48 +00:00
|
|
|
PKG_LICENSE="Apache-2.0"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SITE="https://www.openssl.org"
|
2023-01-10 22:11:33 +00:00
|
|
|
PKG_URL="https://www.openssl.org/source/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain"
|
|
|
|
PKG_LONGDESC="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security"
|
|
|
|
PKG_TOOLCHAIN="configure"
|
2023-02-25 00:39:48 +00:00
|
|
|
PKG_BUILD_FLAGS="+local-cc"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_CONFIGURE_OPTS_SHARED="--libdir=lib \
|
|
|
|
shared \
|
|
|
|
threads \
|
|
|
|
no-ec2m \
|
|
|
|
no-md2 \
|
|
|
|
no-rc5 \
|
|
|
|
no-rfc3779 \
|
|
|
|
no-sctp \
|
|
|
|
no-ssl-trace \
|
|
|
|
no-ssl3 \
|
|
|
|
no-unit-test \
|
|
|
|
no-weak-ssl-ciphers \
|
|
|
|
no-zlib \
|
|
|
|
no-zlib-dynamic \
|
|
|
|
no-static-engine"
|
|
|
|
|
2023-01-10 22:11:33 +00:00
|
|
|
PKG_CONFIGURE_OPTS_HOST="--prefix=${TOOLCHAIN} \
|
|
|
|
--openssldir=${TOOLCHAIN}/etc/ssl"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \
|
|
|
|
--openssldir=/etc/ssl"
|
|
|
|
|
|
|
|
post_unpack() {
|
2023-01-10 22:11:33 +00:00
|
|
|
find ${PKG_BUILD}/apps -type f | xargs -n 1 -t sed 's|./demoCA|/etc/ssl|' -i
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pre_configure_host() {
|
2023-01-10 22:11:33 +00:00
|
|
|
mkdir -p ${PKG_BUILD}/.${HOST_NAME}
|
|
|
|
cp -a ${PKG_BUILD}/* ${PKG_BUILD}/.${HOST_NAME}/
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
configure_host() {
|
2023-01-10 22:11:33 +00:00
|
|
|
cd ${PKG_BUILD}/.${HOST_NAME}
|
2023-02-24 13:53:43 +00:00
|
|
|
./Configure ${PKG_CONFIGURE_OPTS_HOST} ${PKG_CONFIGURE_OPTS_SHARED} linux-${MACHINE_HARDWARE_NAME} ${CFLAGS} ${LDFLAGS}
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_host() {
|
|
|
|
make install_sw
|
|
|
|
}
|
|
|
|
|
|
|
|
pre_configure_target() {
|
2023-01-10 22:11:33 +00:00
|
|
|
mkdir -p ${PKG_BUILD}/.${TARGET_NAME}
|
|
|
|
cp -a ${PKG_BUILD}/* ${PKG_BUILD}/.${TARGET_NAME}/
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-01-10 22:11:33 +00:00
|
|
|
case ${TARGET_ARCH} in
|
2023-03-04 13:29:37 +00:00
|
|
|
i686)
|
|
|
|
OPENSSL_TARGET=linux-x86
|
|
|
|
;;
|
2022-02-05 14:23:32 +00:00
|
|
|
x86_64)
|
|
|
|
OPENSSL_TARGET=linux-x86_64
|
|
|
|
PLATFORM_FLAGS=enable-ec_nistp_64_gcc_128
|
|
|
|
;;
|
|
|
|
arm)
|
|
|
|
OPENSSL_TARGET=linux-armv4
|
|
|
|
;;
|
|
|
|
aarch64)
|
|
|
|
OPENSSL_TARGET=linux-aarch64
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
configure_target() {
|
2023-01-10 22:11:33 +00:00
|
|
|
cd ${PKG_BUILD}/.${TARGET_NAME}
|
2023-02-24 13:53:43 +00:00
|
|
|
./Configure ${PKG_CONFIGURE_OPTS_TARGET} ${PKG_CONFIGURE_OPTS_SHARED} ${PLATFORM_FLAGS} ${OPENSSL_TARGET} ${CFLAGS} ${LDFLAGS}
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target() {
|
2023-01-10 22:11:33 +00:00
|
|
|
make DESTDIR=${INSTALL} install_sw
|
|
|
|
make DESTDIR=${SYSROOT_PREFIX} install_sw
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_makeinstall_target() {
|
2023-01-10 22:11:33 +00:00
|
|
|
rm -rf ${INSTALL}/etc/ssl/misc
|
|
|
|
rm -rf ${INSTALL}/usr/bin/c_rehash
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-01-10 22:11:33 +00:00
|
|
|
debug_strip ${INSTALL}/usr/bin/openssl
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# cert from https://curl.haxx.se/docs/caextract.html
|
2023-01-10 22:11:33 +00:00
|
|
|
mkdir -p ${INSTALL}/etc/ssl
|
|
|
|
cp ${PKG_DIR}/cert/cacert.pem ${INSTALL}/etc/ssl/cacert.pem.system
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# give user the chance to include their own CA
|
2023-01-10 22:11:33 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp ${PKG_DIR}/scripts/openssl-config ${INSTALL}/usr/bin
|
|
|
|
ln -sf /run/libreelec/cacert.pem ${INSTALL}/etc/ssl/cacert.pem
|
|
|
|
ln -sf /run/libreelec/cacert.pem ${INSTALL}/etc/ssl/cert.pem
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# backwards comatibility
|
2023-01-10 22:11:33 +00:00
|
|
|
mkdir -p ${INSTALL}/etc/pki/tls
|
|
|
|
ln -sf /run/libreelec/cacert.pem ${INSTALL}/etc/pki/tls/cacert.pem
|
|
|
|
mkdir -p ${INSTALL}/etc/pki/tls/certs
|
|
|
|
ln -sf /run/libreelec/cacert.pem ${INSTALL}/etc/pki/tls/certs/ca-bundle.crt
|
2023-02-25 00:39:48 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/lib/ssl
|
|
|
|
ln -sf /run/libreelec/cacert.pem ${INSTALL}/usr/lib/ssl/cert.pem
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
|
|
|
enable_service openssl-config.service
|
|
|
|
}
|