Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env bash
# =============================================================================
# FileName:
# Desc: Build PyCurl with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./
# Author: KuoE0 <>
# HomePage:
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================
echo -e $work_path
echo -e "\x1b[33msudo apt-get -y install build-essential fakeroot dpkg-dev\x1b[0m"
sudo apt-get -y install build-essential fakeroot dpkg-dev
mkdir $work_path
cd $work_path
echo -e "\x1b[33msudo apt-get source python-pycurl\x1b[0m"
sudo apt-get source python-pycurl
echo -e "\x1b[33msudo apt-get -y build-dep python-pycurl\x1b[0m"
sudo apt-get -y build-dep python-pycurl
echo -e "\x1b[33msudo apt-get -y install libcurl4-openssl-dev\x1b[0m"
sudo apt-get -y install libcurl4-openssl-dev
find . -name "*.dsc" | xargs sudo dpkg-source -x
dir=`find $work_path -maxdepth 1 -mindepth 1 -type d`
cd $dir
echo -e "\x1b[33mreplace gnutls with openssl\x1b[0m"
sudo sed --in-place 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/g' debian/control
echo -e "\x1b[33msudo dpkg-buildpackage -rfakeroot -b\x1b[0m"
sudo dpkg-buildpackage -rfakeroot -b
find $work_path -name "*.deb" -exec sudo dpkg -i {} \;
cd /tmp
# prevent to upgrade from APT
dpkg --get-selections | grep pycurl > $work_path/PYCURL
sed -e 's/install/hold/' $work_path/PYCURL | sudo dpkg --set-selections
sudo rm -r $work_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.