2018-05-03 00:12:01 +03:00
|
|
|
#!/bin/bash
|
2018-04-10 00:16:38 +03:00
|
|
|
set -eux
|
|
|
|
|
|
|
|
download_openssl () {
|
2018-05-03 00:12:01 +03:00
|
|
|
if [[ ! -f "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ]]; then
|
2018-04-10 00:16:38 +03:00
|
|
|
wget -P download-cache/ \
|
|
|
|
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
build_openssl () {
|
2018-05-03 00:12:01 +03:00
|
|
|
if [[ "$(cat ${OPENSSL_INSTALL_DIR}/.openssl-version)" != "${OPENSSL_VERSION}" ]]; then
|
2018-04-10 00:16:38 +03:00
|
|
|
tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
|
|
|
|
cd "openssl-${OPENSSL_VERSION}/"
|
2019-07-21 18:29:29 +03:00
|
|
|
./config shared no-deprecated --prefix="${OPENSSL_INSTALL_DIR}" --openssldir="${OPENSSL_INSTALL_DIR}" -DPURIFY
|
2018-11-10 10:32:21 +03:00
|
|
|
make -j $(nproc || sysctl -n hw.ncpu || echo 4) all
|
|
|
|
make install_sw
|
2018-05-03 00:12:01 +03:00
|
|
|
echo "${OPENSSL_VERSION}" > "${OPENSSL_INSTALL_DIR}/.openssl-version"
|
2018-04-10 00:16:38 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
download_openssl
|
|
|
|
build_openssl
|