Skip to content

Instantly share code, notes, and snippets.

@jacksoncage
Created September 8, 2016 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacksoncage/3b6f7dd2325644ac0fbfe005781ecc23 to your computer and use it in GitHub Desktop.
Save jacksoncage/3b6f7dd2325644ac0fbfe005781ecc23 to your computer and use it in GitHub Desktop.
#!/bin/bash
ORG_DIR=`pwd`
SRC_DIR="/usr/local/src/"
cd $SRC_DIR
echo "####### START: apt-get deps ########"
apt-get -qq update
apt-get install -yqq --force-yes g++ make binutils autoconf automake autotools-dev libtool pkg-config \
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
libjemalloc-dev cython python3-dev python-setuptools libtool openssl git locate \
python3-setuptools wget python-software-properties language-pack-en-base bzip2
echo "####### FINISHED: apt-get deps ########"
echo ""
echo "####### START: openssl/libssl ########"
cd $SRC_DIR
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
add-apt-repository -y ppa:ondrej/php
apt-get -qq update
apt-get install -yqq --force-yes openssl libssl1.0.2
echo "####### FINISHED: libssl ########"
echo ""
echo "####### START: spdylay ########"
cd $SRC_DIR
if [ ! -d "/usr/local/src/spdylay" ]; then
git clone https://github.com/tatsuhiro-t/spdylay.git /usr/local/src/spdylay
cd /usr/local/src/spdylay
autoreconf -i
automake
autoconf
./configure
make
make install
updatedb
locate libspdylay.so.7
ln -fs /usr/local/lib/libspdylay.so.7 /lib/x86_64-linux-gnu/libspdylay.so.7
ln -fs /usr/local/lib/libspdylay.so.7.2.0 /lib/x86_64-linux-gnu/libspdylay.so.7.2.0
ldconfig
fi
echo "####### FINISHED: spdylay ########"
echo ""
echo "####### START: nghttp2 ########"
cd $SRC_DIR
if [ ! -d "/usr/local/src/nghttp2" ]; then
git clone https://github.com/tatsuhiro-t/nghttp2.git /usr/local/src/nghttp2
cd /usr/local/src/nghttp2
autoreconf -i
automake
autoconf
./configure PYTHON=/usr/bin/python3 --with-debug
make
make install
updatedb
locate libnghttp2.so.14
ln -fs /usr/local/lib/libnghttp2.so.14 /lib/x86_64-linux-gnu/libnghttp2.so.14
ln -fs /usr/local/lib/libnghttp2.so.14.0.2 /lib/x86_64-linux-gnu/libnghttp2.so.14.0.2
ldconfig
fi
echo "####### FINISHED: nghttp2 ########"
echo ""
echo "####### START: curl ########"
cd $SRC_DIR
if [ ! -d "/usr/local/src/curl-7.50.1" ]; then
updatedb
ldconfig
cd $SRC_DIR
wget https://curl.haxx.se/download/curl-7.50.1.tar.bz2
tar -xjf /usr/local/src/curl-7.50.1.tar.bz2
cd /usr/local/src/curl-7.50.1
./configure --with-nghttp2=/usr/local --with-ssl
make
make install
updatedb
ln -fs /usr/local/lib/libcurl.so.4 /lib/x86_64-linux-gnu/libcurl.so.4
ldconfig
fi
echo "####### FINISHED: curl ########"
echo ""
echo "####### START: php-curl ########"
cd $SRC_DIR
apt-get install -yqq php5-curl
echo "####### FINISHED: php-curl ########"
echo ""
echo "####### START: run test ########"
cd $ORG_DIR
echo "/usr/local/bin/curl --version:"
LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/curl --version
echo "curl --version:"
curl --version
echo "Test request against Akami"
curl -vI --http2 https://http2.akamai.com/demo/tile-0.png
echo "Test request to Apple:"
curl -vi -d 'Hello' --http2 https://api.development.push.apple.com/3/device/test
echo "####### FINISHED: run test ########"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment