Skip to content

Instantly share code, notes, and snippets.

@vbatts
Created July 11, 2012 14:58
Show Gist options
  • Save vbatts/3090949 to your computer and use it in GitHub Desktop.
Save vbatts/3090949 to your computer and use it in GitHub Desktop.

Revisions

  1. vbatts created this gist Jul 11, 2012.
    39 changes: 39 additions & 0 deletions ruby-openssl-build.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/sh

    t_dir="$HOME/tmp"

    mkdir -p ${t_dir}
    pushd ${t_dir}

    for url in \
    ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.9.3-p194.tar.bz2 \
    http://openssl.org/source/openssl-1.0.1c.tar.gz
    do
    if [ ! -f $(basename "${url}") ] ;then
    wget "${url}"
    fi
    done

    tar zxf openssl-1.0.1c.tar.gz
    tar jxf ruby-1.9.3-p194.tar.bz2

    cd ${t_dir}/openssl-1.0.1c
    ./config \
    no-shared \
    --prefix=${t_dir}/static && \
    make depend && \
    make && \
    make install

    cd ${t_dir}/ruby-1.9.3-p194
    CFLAGS=" -I${t_dir}/static/include -L${t_dir}/static/include " \
    LDFLAGS=" -L${t_dir}/static/include " \
    ./configure \
    --prefix=${t_dir}/static \
    --disable-install-doc && \
    make && \
    make install

    ${t_dir}/static/bin/ruby -r openssl -e 'puts OpenSSL::OPENSSL_VERSION'

    popd