# Build qBittorrent on Fedora

According to the following instruction:
=> https://github.com/qbittorrent/qBittorrent/blob/master/INSTALL

## Dependencies

### Boost

``` bash
sudo dnf install boost-devel
```

### OpenSSL

``` bash
sudo dnf install openssl-devel
```

### libtorrent-rasterbar

``` bash
sudo dnf install rb_libtorrent
```

Or, build from source:

``` bash
wget https://github.com/arvidn/libtorrent/releases/download/v2.0.11/libtorrent-rasterbar-2.0.11.tar.gz
tar -xzf libtorrent-rasterbar-2.0.11.tar.gz
rm libtorrent-rasterbar-2.0.11.tar.gz
cd libtorrent-rasterbar-2.0.11
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo cmake --install build
```
* replace 2.0.11 value with the actual version
* last step will install the libtorrent-rasterbar globally

### zlib-static

``` bash
sudo dnf install zlib-static
```

### Qt

``` bash
sudo dnf install qt6-qtbase-devel\
                 qt6-qttools-devel\
                 qt6-qtsvg-devel\
                 qt6-qtbase-private-devel
```

### Python

``` bash
sudo dnf install python3
```

## Compile and install

Get the latest qBittorrent source code:

``` bash
git clone https://github.com/qbittorrent/qBittorrent.git
cd qBittorrent
```

### With graphical interface (Qt client)

``` bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
qbittorrent
```

### Without GUI (server with Web UI)

``` bash
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGUI=OFF
cmake --build build
cmake --install build
qbittorrent-nox
```

## Troubleshooting

### Cannot open shared object file

If you see the following message upon launch:

``` bash
qbittorrent: error while loading shared libraries: libtorrent-rasterbar.so.2.0: cannot open shared object file: No such file or directory
```

Try to create the soft symlinks:

``` bash
sudo ln -s /usr/local/lib64/libtorrent-rasterbar.so /usr/local/lib/libtorrent-rasterbar.so
sudo ln -s /usr/local/lib64/libtorrent-rasterbar.so.2.0 /usr/local/lib/libtorrent-rasterbar.so.2.0
sudo ln -s /usr/local/lib64/libtorrent-rasterbar.so.2.0.11 /usr/local/lib/libtorrent-rasterbar.so.2.0.11
```
* please note that the version may be different!