Skip to content

Instantly share code, notes, and snippets.

@dollabi11z
Last active July 28, 2019 04:29
Show Gist options
  • Save dollabi11z/a9f9a2516ef948714b98806c2664be73 to your computer and use it in GitHub Desktop.
Save dollabi11z/a9f9a2516ef948714b98806c2664be73 to your computer and use it in GitHub Desktop.
dollabillz Curl install
////////////////////////////////////////////////
n1="curl" n2="curl" n3="$n1/$n2" n4="$n1-$n2"
export LC_ALL=C unset {http,https,ftp,all,no}_proxy unset {HTTP,HTTPS,FTP,ALL,NO}_PROXY
gitv1=$(curl -s https://api.github.com/repos/$n3/releases/latest | jq '.name' | tr -d '"' | tr -d 'v')
gitv2=$(curl -s https://api.github.com/repos/$n3/releases/latest | jq '.assets[2] | .browser_download_url' | tr -d '"')
#tar1="`tar -tzf $n1*.tar.gz | head -1 | cut -f1 -d"/"| grep -Po '\d+\.\d+\.\d+'`--$(date +%Y.%m.%d-%H.%M)"
cd ~
TMPDIR="/root/......dollazjunkk/$n1.$gitv1" && mkdir -p "$TMPDIR" && rm -rf "$TMPDIR"/* && cd "$TMPDIR"
# URL from json
## wget "$gitv2" && tar xvf "$n1"*tar.gz && v=$(find -name "$n2*.tar.gz" -printf '%P\n' | head -n1 | sed 's/\.tar\.gz//g') && cd "$v"
# Tarball from json
wget "https://github.com/$n3/tarball/master" -O "$n1-$n2.$gitv1.tar.gz" && tar zxvf "$n1-$n2.$gitv1.tar.gz" && cd $n4-*
wget "https://curl.haxx.se/ca/cacert.pem" -O "/etc/ssl/certs/cacert.pem"
./buildconf
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local \
--disable-static \
--enable-ares \
--with-libssh2 \
--with-gssapi \
--enable-threaded-resolver \
--with-ca-path=/etc/ssl/certs &&
make -j$(expr $(nproc) \+ 10)
make -j$(expr $(nproc) \+ 20) test
make -j$(expr $(nproc) \+ 10) install &&
rm -rf docs/examples/.deps &&
find docs \( -name Makefile\* -o -name \*.1 -o -name \*.3 \) -exec rm {} \; &&
install -v -d -m755 /usr/local/share/doc/$n2-$gitv1 &&
cp -v -R docs/* /usr/local/share/doc/$n2-$gitv1
---------------------------------------------------------------
## Fix NO /usr/lib/libcurl.so.4: no version information available (required by megatools)
ldd /usr/bin/cmake
#locate libcurl.so.4
#ls -l /usr/local/lib/libcurl.so.4
#ls -l /usr/lib/x86_64-linux-gnu/libcurl.so.4
# Result /usr/lib/libcurl.so.4 -> libcurl.so.4.5.0
#/usr/lib/libcurl.so.4
rm /usr/lib/libcurl.so.4
rm /usr/local/lib/libcurl.so.4
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0 /usr/local/lib/libcurl.so.4
ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0 /usr/lib/libcurl.so.4
#ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0 /usr/local/lib/libcurl.so.4
ls -l /usr/lib/libcurl.so.4
---------------------------------------------------------------
make -j$(expr $(nproc) \+ 10) clean
updatedb
hash -r
ldconfig
# curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
# mv cacert.pem /etc/ssl/certs/ca-certificates.crt
curl -V
////////////////////////////////////////////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment