rbenv-ruby-build/script/update-cruby
Benoit Daloze b945b7ae84 Install openssl whenever the system version does not match
* Make supported openssl versions explicit per definition.
2022-07-10 14:04:58 +02:00

23 lines
754 B
Bash
Executable file

#!/usr/bin/env bash
set -e
set -o pipefail
if [ $# -ne 2 ]; then
echo "usage: $0 VERSION RELEASE_DIRECTORY"
exit 1
fi
version="$1"
release_directory="$2"
file="share/ruby-build/${version}"
basename="ruby-${version}.tar.gz"
major_minor_version=$(echo ${version} | cut -d '.' -f 1,2)
url="https://cache.ruby-lang.org/pub/ruby/${major_minor_version}/${basename}"
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
cat > "$file" <<EOS
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" openssl --if needs_openssl_102_300
install_package "ruby-${version}" "${url}#${sha256}" ldflags_dirs enable_shared standard verify_openssl
EOS