cURL-8.18.0

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 4. Networking

- Prev

  libpsl-0.21.5

- Next

  Wget-1.25.0

- Up
- Home

# cURL-8.18.0

## Introduction to cURL

The cURL package contains a utility and a library used for transferring files with URL syntax to any of the following protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTSP, SMB, SMBS, SMTP, SMPTS, TELNET, and TFTP. Its ability to both download and upload files can be incorporated into other programs to support functions like streaming media.

- Download: https://curl.se/download/curl-8.18.0.tar.xz

### cURL Dependencies

Recommended
libpsl-0.21.5

### Note

While you can build the package without libpsl, the upstream developers highly recommend building support for libpsl. It prevents sites from using super cookies which pose security risks.

Optional
libidn2-2.3.8

## Installation of cURL

Install cURL by running the following commands:

    mkdir build &&
    cd    build &&

    ../configure --prefix=/usr                 \
                 --disable-static              \
                 --with-openssl                \
                 --with-ca-path=/etc/ssl/certs &&

    make

Now, as the `root` user:

    make install &&

    rm -rf docs/examples/.deps &&

    find docs \( -name Makefile\* -o  \
                 -name \*.1       -o  \
                 -name \*.3       -o  \
                 -name CMakeLists.txt \) -delete &&

    cp -v -R docs -T /usr/share/doc/curl-8.18.0

To run some simple verification tests on the newly installed curl, issue the following commands: curl --trace-ascii debugdump.txt https://www.example.com/ and curl --trace-ascii d.txt --trace-time https://example.com/. Inspect the locally created trace files `debugdump.txt` and `d.txt`, which contains version information, downloaded files information, etc. One file has the time for each action logged.

## lib32 Installation of cURL

Install lib32-cURL by running the following commands:

    rm -rf * &&
    CC="gcc -m32" CXX="g++ -m32"           \
    PKGCONFIG=i686-pc-linux-gnu-pkg-config \
    ../configure --prefix=/usr             \
                 --libdir=/usr/lib32       \
                 --host=i686-pc-linux-gnu  \
                 --disable-static          \
                 --with-openssl            \
                 --without-brotli          \
                 --with-ca-path=/etc/ssl/certs &&

    make

Now, as the `root` user:

    make DESTDIR=$PWD/DESTDIR install     &&
    cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
    rm -rf DESTDIR                        &&
    ldconfig

## Command Explanations

### Note

Run ../configure --help for a full list of options.

mkdir build && cd build: This is not necessary for just the normal installation, but cleaning the directory leads to the documentation in the source being wiped and this package tries to rebuild it for the lib32 installation, so building in a build directory allows for deleting just the build artifacts.

`--disable-static`: This switch prevents installation of static versions of the libraries.

`--with-ca-path=/etc/ssl/certs`: This switch sets the location of the BLFS Certificate Authority store.

`--with-openssl`: This parameter chooses OpenSSL as SSL/TLS implementation. This option is not needed if `--with-gnutls` is selected instead.

`--with-gssapi`: This parameter adds Kerberos 5 support to `libcurl`.

`--with-gnutls`: Use this switch to build with GnuTLS support instead of OpenSSL for SSL/TLS. This requires GnuTLS-3.8.12 to be installed already.

`--with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt`: Use this switch instead of `--with-ca-path` if building with GnuTLS support instead of OpenSSL for SSL/TLS.

`--with-libssh2`: This parameter adds SSH support to cURL. This is disabled by default.

`--enable-ares`: This parameter adds support for DNS resolution through the c-ares library.

find docs ... -exec rm {} \;: This command removes `Makefiles` and man files from the documentation directory that would otherwise be installed by the commands that follow.

## Contents

Installed Programs: curl, curl-config, and wcurl
Installed Library: libcurl
Installed Directories: /usr/include/curl and /usr/share/doc/curl-8.18.0

### Short Descriptions

curl | is a command line tool for transferring files with URL syntax
curl-config | prints information about the last compile, like libraries linked to and prefix setting
wcurl | is a wrapper around cURL that emulates wget behavior
`libcurl` | provides the API functions required by curl and other programs

- Prev

  libpsl-0.21.5

- Next

  Wget-1.25.0

- Up
- Home