From f3184d202190a5e6e1bcc7b6e2bddf29130be735 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 2 Jan 2016 19:53:18 -0600 Subject: refactor travis custom openssl code to work with other versions --- .travis/install.sh | 36 ++++++++++++++++-------------------- .travis/run.sh | 12 ++++++++---- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index 0e5cdb48..f04c2ff3 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -62,26 +62,22 @@ else pyenv global pypy-4.0.1 fi if [[ "${OPENSSL}" == "0.9.8" ]]; then - # download, compile, and install if it's not already present via travis cache - # This is 0.9.8l rather than zh because we have some branches for handling - # < 0.9.8m that won't be exercised with a newer OpenSSL. (RHEL5 is 0.9.8e with - # patches, but while that's in jenkins we don't get coverage data from it) - if [[ ! -f "$HOME/ossl-098l/bin/openssl" ]]; then - curl -O https://www.openssl.org/source/openssl-0.9.8l.tar.gz - tar zxf openssl-0.9.8l.tar.gz - cd openssl-0.9.8l - echo "OPENSSL_0.9.8L_CUSTOM { - global: - *; - };" > openssl.ld - ./config no-asm no-ssl2 -Wl,--version-script=openssl.ld -Wl,-Bsymbolic-functions -fPIC shared --prefix=$HOME/ossl-098l - make depend - make install - fi - export PATH="$HOME/ossl-098l/bin:$PATH" - export CFLAGS="-I$HOME/ossl-098l/include" - export LDFLAGS="-L$HOME/ossl-098l/lib" - export LD_LIBRARY_PATH="$HOME/ossl-098l/lib" + # We use 0.9.8l rather than zh because we have some branches for handling + # < 0.9.8m that won't be exercised with a newer OpenSSL. (RHEL5 is 0.9.8e with + # patches, but while that's in jenkins we don't get coverage data from it). + OPENSSL_VERSION_NUMBER="0.9.8l" + OPENSSL_DIR="ossl-098l" + fi + # download, compile, and install if it's not already present via travis cache + if [ ! -z "$OPENSSL_DIR" ]; then + if [[ ! -f "$HOME/$OPENSSL_DIR/bin/openssl" ]]; then + curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION_NUMBER.tar.gz + tar zxf openssl-$OPENSSL_VERSION_NUMBER.tar.gz + cd openssl-$OPENSSL_VERSION_NUMBER + ./config shared no-asm no-ssl2 -fPIC --prefix=$HOME/$OPENSSL_DIR + make depend + make install + fi fi pip install virtualenv fi diff --git a/.travis/run.sh b/.travis/run.sh index 23b9e89e..c8707a4f 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -24,10 +24,14 @@ else eval "$(pyenv init -)" fi if [[ "${OPENSSL}" == "0.9.8" ]]; then - export PATH="$HOME/ossl-098l/bin:$PATH" - export CFLAGS="-I$HOME/ossl-098l/include" - export LDFLAGS="-L$HOME/ossl-098l/lib" - export LD_LIBRARY_PATH="$HOME/ossl-098l/lib" + OPENSSL_DIR="ossl-098l" + fi + + if [ ! -z "$OPENSSL_DIR" ]; then + export PATH="$HOME/$OPENSSL_DIR/bin:$PATH" + export CFLAGS="-I$HOME/$OPENSSL_DIR/include" + # rpath on linux will cause it to use an absolute path so we don't need to do LD_LIBRARY_PATH + export LDFLAGS="-L$HOME/$OPENSSL_DIR/lib -Wl,-rpath=$HOME/$OPENSSL_DIR/lib" fi fi source ~/.venv/bin/activate -- cgit v1.2.3 From 1e953ee8b4068dc25025082ab0f5bb13380727b1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 3 Jan 2016 11:00:53 -0600 Subject: use -n instead of ! -z --- .travis/install.sh | 2 +- .travis/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index f04c2ff3..a4f99be4 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -69,7 +69,7 @@ else OPENSSL_DIR="ossl-098l" fi # download, compile, and install if it's not already present via travis cache - if [ ! -z "$OPENSSL_DIR" ]; then + if [ -n "$OPENSSL_DIR" ]; then if [[ ! -f "$HOME/$OPENSSL_DIR/bin/openssl" ]]; then curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION_NUMBER.tar.gz tar zxf openssl-$OPENSSL_VERSION_NUMBER.tar.gz diff --git a/.travis/run.sh b/.travis/run.sh index c8707a4f..9731e20a 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -27,7 +27,7 @@ else OPENSSL_DIR="ossl-098l" fi - if [ ! -z "$OPENSSL_DIR" ]; then + if [ -n "$OPENSSL_DIR" ]; then export PATH="$HOME/$OPENSSL_DIR/bin:$PATH" export CFLAGS="-I$HOME/$OPENSSL_DIR/include" # rpath on linux will cause it to use an absolute path so we don't need to do LD_LIBRARY_PATH -- cgit v1.2.3