# Previous versions of this howto have used the /usr/local prefix, the
# default when you build it from source. If you want to uninstall one of
# those, or just clean up files from an old version, skip down to the bottom
# for removal instructions.
# Get the tarball
cd
test -f installed/curl-8.7.1.tar.xz && mv installed/curl-8.7.1.tar.xz .
test ! -f curl-8.7.1.tar.xz &&
wget https://curl.se/download/curl-8.7.1.tar.xz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710\
cd curl-8.7.1.tar.xz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "curl-*" -exec rm -r {} \;
tar xJvf ~/curl-8.7.1.tar.xz
cd curl-8.7.1
test $UID = 0 && chown -R root:root .
# If your OpenSSL is not installed under /usr/local/ssl, pass
# --with-ssl to configure by itself with no path. If configure
# can't find it, use LDFLAGS=-L/usr/local/ssl/lib64 or wherever libssl
# and libcrypto are.
# If you do use Slackware and your /usr/share/man is a symlink
# to /usr/man, then don't worry about the mandir part (if you're
# feeling exceptionally lazy).
# You may need LIBS="-lssl -lcrypto" to get LDAP support added successfully
# Configure the build, 64-bit with OpenSSL prefix /usr/local
# (default in >= 1.1.0)
test $(uname -m) = "x86_64" &&
test -d /usr/local/include/openssl &&
./configure --disable-static --prefix=/usr --libdir=/usr/lib64 \
--mandir=/usr/man --with-ssl --with-libssh2 --enable-ldap --enable-ldaps \
--enable-ares
# Configure the build, 64-bit with OpenSSL prefix /usr/local/ssl
test $(uname -m) = "x86_64" &&
test -d /usr/local/ssl/include &&
LDFLAGS=-L/usr/local/ssl/lib64 ./configure --disable-static \
--prefix=/usr --mandir=/usr/man --libdir=/usr/lib64 \
--with-ssl=/usr/local/ssl --with-libssh2 --enable-ldap \
--enable-ldaps --enable-ares
# Become root to install it
# (use 'su -p' for $USER instead of 'logname' below)
su
# Remove the Slackware package, if there is one
# Read the next few parts too before you do it
test -x /sbin/removepkg && /sbin/removepkg curl
# If you used --disable-static above but have an old static library from an
# old version of curl, remove it
rm -f /usr/lib/libcurl.a /usr/lib64/libcurl.a
# Be aware that in (at least) Slackware >= 12.2, libcurl.so.* files
# are in the aaa_elflibs|aaa_libraries package. Not sure why, maybe
# because of gnupg and gnupg2's gpgkeys_curl/gpg2keys_curl, or maybe just
# for whatever needs them. If you are really low on space, like on an
# embedded system, you may be able to remove the old ones (anything without
# today's date in /usr/lib or /usr/lib64). Otherwise it will not hurt any
# to leave it there, and if anything is specifically linked with an older
# version of libcurl.so.*, then you'll be avoiding trouble by leaving it
# there. See if any thing running is linked with it by using lsof.
#
# If you are upgrading from an older version previously installed from
# source, there may be old shared library files in there for that reason
# too.
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/curl-*.tar.*
mv curl-8.7.1.tar.xz installed/
# If you ever want to uninstall cURL, this should do it:
cd
su
test -d src/curl-* && ( cd src/curl-* ; make uninstall )
for pfx in /usr /usr/local;
do
( cd ${pfx}/bin ; rm -f curl curl-config )
test -d ${pfx}/include/curl && rm -r ${pfx}/include/curl
( cd ${pfx}/share/man/man1 ; rm -f curl.1 curl-config.1 )
test -d ${pfx}/share/curl && rm -r ${pfx}/share/curl
rm -f ${pfx}/lib/libcurl.* ${pfx}/lib/pkgconfig/libcurl.pc \
${pfx}/share/man/man3/curl_*.3
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "curl-*" -exec rm -r {} \;
rm -f ~/installed/curl-*.tar.*