Last active
May 31, 2020 08:49
-
-
Save erikbye/d2f24b79f4f986917f83a816826e1f5a to your computer and use it in GitHub Desktop.
Compile git with openssl instead of gnutls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for debian based distros | |
function installDep() | |
{ | |
sudo apt-get install -y build-essential fakeroot dpkg-dev | |
sudo apt-get -y build-dep git | |
sudo apt-get install -y libcurl4-openssl-dev | |
} | |
function compileGit() | |
{ | |
mkdir -p git-openssl | |
cd git-openssl | |
apt-get source git | |
cd git-* | |
sed -i -e 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/g' ./debian/control | |
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules | |
sudo dpkg-buildpackage -rfakeroot -b | |
find .. -type f -name "git_*ubuntu*.deb" -exec sudo dpkg -i \{\} \; | |
cd ../../ | |
} | |
function cleanUp() | |
{ | |
mkdir -p ../gitopenssl_deb | |
pushd git-openssl | |
# copy the package for future use | |
find .. -type f -name "git_*ubuntu*.deb" -exec cp {} ../../gitopenssl_deb \; | |
popd | |
sudo rm -rf git-openssl | |
} | |
installDep | |
compileGit | |
sudo apt-mark hold git | |
cleanUp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment