Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding, and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression. It is open-sourced under the MIT License. You can browse its source code on Github. The specification of the Brotli Compressed Data Format is defined in RFC 7932. This tutorial shows how to compile Brotli compression library from source on Fedora 29 system.
- Fedora 29 system.
- Non-root user with sudo access.
Check the Fedora version:
# Fedora release 29 (Twenty Nine)
Set up the timezone:
sudo timedatectl set-timezone 'Region/City'
Update your operating system packages:
sudo dnf check-update; sudo dnf update -y
Install build tools and packages necessary to build Brotli:
sudo dnf install -y wget gcc make bc sed autoconf automake libtool git tree
Clone Brotli repository:
git clone https://github.com/google/brotli.git
Navigate to Brotli source tree directory:
Create a manual page for Brotli command:
sudo cp ~/brotli/docs/brotli.1 /usr/share/man/man1 && sudo gzip /usr/share/man/man1/brotli.1
Check the man page:
To generate Autotools
configure file run
./bootstrap command first:
After the above command, you should have access to the usual C program build steps:
make install available.
For help, you can run
./configure --help command. Now we are ready to build Brotli with the following instructions.
The basic commands to build and install brotli are:
./configure --prefix=/usr \
sudo make install
After the successful build process, you can check Brotli version:
# brotli 1.0.7
To see help about brotli command, you can run:
That's it. You have successfully compiled Brotli from source code.