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}/"
|
2018-05-03 00:12:01 +03:00
|
|
|
./config shared --prefix="${OPENSSL_INSTALL_DIR}" --openssldir="${OPENSSL_INSTALL_DIR}" -DPURIFY
|
2018-04-10 00:16:38 +03:00
|
|
|
make all 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
|