Skip to content

Instantly share code, notes, and snippets.

@kiyor
Last active October 19, 2016 18:49
Show Gist options
  • Save kiyor/70c295ae6cf06f345c5acae17419846f to your computer and use it in GitHub Desktop.
Save kiyor/70c295ae6cf06f345c5acae17419846f to your computer and use it in GitHub Desktop.
#!/bin/bash
############################################
# File Name : buildcurl.sh
# Purpose :
# Creation Date : 04-07-2016
# Last Modified : Thu Apr 7 16:38:10 2016
# Created By : Kiyor
############################################
openssl_ver=1.0.2j
libidn_ver=1.32
zlib_ver=1.2.8
curl_ver=7.50.0
version=2
if [[ -f /usr/local/rvm/bin/rvm ]]; then
if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
exit 1
fi
rvm use 1.8.7 2>/dev/null
fi
current_dir=`pwd`
build_dir=`mktemp -d -t build-curl.XXXXX`
install_dir=${build_dir}/PKG
mkdir -p $install_dir
cd ${build_dir} || exit 2
git clone https://github.com/curl/curl.git
wget -N https://www.openssl.org/source/openssl-${openssl_ver}.tar.gz
wget -N http://ftp.gnu.org/gnu/libidn/libidn-${libidn_ver}.tar.gz
wget -N http://zlib.net/zlib-${zlib_ver}.tar.gz
tar xzf openssl-${openssl_ver}.tar.gz
tar xzf libidn-${libidn_ver}.tar.gz
tar xzf zlib-${zlib_ver}.tar.gz
cd curl
./buildconf
./configure --with-ssl=../openssl-${openssl_ver} --with-zlib=../zlib-${zlib_ver} --with-libidn=../libidn-${libidn_ver}
make && DESTDIR=${install_dir} make install
cd $pwd
fpm -C ${install_dir} -s dir -t rpm -n ccna-curl -v ${curl_ver} --iteration $version .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment