diff options
| author | David Weinstein <[email protected]> | 2016-08-17 00:48:56 -0400 |
|---|---|---|
| committer | David Weinstein <[email protected]> | 2016-08-17 00:48:56 -0400 |
| commit | e60c257019f49d783b430551a8748886471f9aa8 (patch) | |
| tree | cd1b43c22b5e123cf9f2d704742ffd1ae0646f73 /openssl/test | |
| parent | Merge branch 'release' (diff) | |
| download | rust-openssl-e60c257019f49d783b430551a8748886471f9aa8.tar.xz rust-openssl-e60c257019f49d783b430551a8748886471f9aa8.zip | |
Improve build script
- try and fallback to a mirror when openssl.org is down
- check the sha1 of the downloaded tarball
Diffstat (limited to 'openssl/test')
| -rwxr-xr-x | openssl/test/build.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/openssl/test/build.sh b/openssl/test/build.sh index 982cc5cb..775479dd 100755 --- a/openssl/test/build.sh +++ b/openssl/test/build.sh @@ -1,6 +1,11 @@ #!/bin/bash set -e +MAX_REDIRECTS=5 +OPENSSL=openssl-1.0.2h.tar.gz +OUT=/tmp/$OPENSSL +SHA1="577585f5f5d299c44dd3c993d3c0ac7a219e4949" + if [ "$TRAVIS_OS_NAME" == "osx" ]; then exit 0 fi @@ -13,9 +18,15 @@ else OS_COMPILER=linux-x86_64 fi -mkdir /tmp/openssl +mkdir -p /tmp/openssl cd /tmp/openssl -curl https://openssl.org/source/openssl-1.0.2h.tar.gz | tar --strip-components=1 -xzf - + +curl -o $OUT -L --max-redirs $MAX_REDIRECTS https://openssl.org/source/$OPENSSL \ + || curl -o $OUT -L --max-redirs ${MAX_REDIRECTS} http://mirrors.ibiblio.org/openssl/source/$OPENSSL + +echo "$SHA1 $OUT" | sha1sum -c - || exit 1 + +tar --strip-components=1 -xzf $OUT ./Configure --prefix=$HOME/openssl shared --cross-compile-prefix=$CROSS $OS_COMPILER make make install |