########## # THIS SPEC FILE IS MODIFIED FROM https://src.fedoraproject.org/rpms/qbittorrent/blob/rawhide/f/qbittorrent.spec ########## %global giturl https://github.com/c0re100/qBittorrent-Enhanced-Edition %global commit 535a622c53cb20f0bd9bb7737e25c07f093ad4f9 Name: qbittorrent-enhanced Summary: A Enhanced qBittorrent Client Epoch: 1 Version: 4.6.4.10 Release: 1%{?dist} License: GPLv2+ URL: https://github.com/c0re100/qBittorrent-Enhanced-Edition Source0: %{giturl}/archive/%{commit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: ninja-build BuildRequires: systemd BuildRequires: cmake(Qt6Core) BuildRequires: cmake(Qt6Gui) BuildRequires: cmake(Qt6Svg) BuildRequires: cmake(Qt6LinguistTools) BuildRequires: libxkbcommon-devel BuildRequires: qt6-qtbase-private-devel BuildRequires: qt6-linguist BuildRequires: pkgconfig(zlib) BuildRequires: rb_libtorrent-devel >= 2.0 BuildRequires: desktop-file-utils BuildRequires: boost-devel >= 1.60 BuildRequires: libappstream-glib Requires: python3 %description A enhanced version of qBittorrent client using rb_libtorrent and a Qt5. Features: Auto Ban Xunlei, QQ, Baidu, Xfplay, DLBT and Offline downloader Auto Ban Unknown Peer from China Option (Default: OFF) Auto Update Public Trackers List (Default: OFF) Auto Ban BitTorrent Media Player Peer Option (Default: OFF) Peer whitelist/blacklist %package nox Summary: A Headless Bittorrent Client %description nox A headless enhanced version of qBittorrent client using rb_libtorrent and a Qt5. Features: Auto Ban Xunlei, QQ, Baidu, Xfplay, DLBT and Offline downloader Auto Ban Unknown Peer from China Option (Default: OFF) Auto Update Public Trackers List (Default: OFF) Auto Ban BitTorrent Media Player Peer Option (Default: OFF) Peer whitelist/blacklist %prep %setup -q -n qBittorrent-Enhanced-Edition-%{commit} -c mv qBittorrent-Enhanced-Edition-%{commit} build pushd build # Remove "enhanced" UA. sed 's/qBittorrent Enhanced/qBittorrent/g' -i src/base/bittorrent/sessionimpl.cpp #sed 's/QBT_VERSION_BUGFIX 1/QBT_VERSION_BUGFIX 0/g' -i src/base/version.h.in #sed 's/QBT_VERSION_BUGFIX 2/QBT_VERSION_BUGFIX 0/g' -i src/base/version.h.in #sed 's/QBT_VERSION_BUGFIX 3/QBT_VERSION_BUGFIX 0/g' -i src/base/version.h.in #sed 's/QBT_VERSION_BUGFIX 5/QBT_VERSION_BUGFIX 0/g' -i src/base/version.h.in sed 's/QBT_VERSION_BUILD 10/QBT_VERSION_BUILD 0/g' -i src/base/version.h.in sed 's/QBT_VERSION_BUILD 11/QBT_VERSION_BUILD 0/g' -i src/base/version.h.in #sed 's/qBittorrent Enhanced/qBittorrent/g' -i src/base/net/dnsupdater.cpp # Rename desktop files with enhanced as suffix to avoid conflict with original qb. sed 's/org.qbittorrent.qBittorrent/org.qbittorrent.qBittorrent-Enhanced-Edition/g' -i dist/unix/org.qbittorrent.qBittorrent.appdata.xml sed 's/qBittorrent/qBittorrent-Enhanced-Edition/g' -i dist/unix/org.qbittorrent.qBittorrent.desktop sed 's/Exec=qbittorrent/Exec=qbittorrent-enhanced/g' -i dist/unix/org.qbittorrent.qBittorrent.desktop sed 's/\/qbittorrent-nox/\/qbittorrent-enhanced-nox/g' -i dist/unix/systemd/qbittorrent-nox@.service.in cp README.md AUTHORS Changelog COPYING .. popd cp -Rp build build-nox %build export LDFLAGS="%{?__global_ldflags} -pthread" # Build headless first pushd build-nox %cmake -DSYSTEMD=ON -Wno-dev -GNinja -DGUI=OFF -DQT6=ON %cmake_build popd # Build gui version pushd build %cmake -Wno-dev -GNinja -DQT6=ON %cmake_build popd %install # install headless version pushd build-nox %cmake_install popd # install gui version pushd build %cmake_install popd # Rename with enhanced suffix mv %{buildroot}%{_bindir}/qbittorrent %{buildroot}%{_bindir}/qbittorrent-enhanced mv %{buildroot}%{_bindir}/qbittorrent-nox %{buildroot}%{_bindir}/qbittorrent-enhanced-nox mv %{buildroot}%{_datadir}/applications/org.qbittorrent.qBittorrent.desktop \ %{buildroot}%{_datadir}/applications/org.qbittorrent.qBittorrent-Enhanced-Edition.desktop mv %{buildroot}%{_metainfodir}/org.qbittorrent.qBittorrent.appdata.xml \ %{buildroot}%{_metainfodir}/org.qbittorrent.qBittorrent-Enhanced-Edition.appdata.xml mv %{buildroot}%{_unitdir}/qbittorrent-nox@.service \ %{buildroot}%{_unitdir}/qbittorrent-enhanced-nox@.service \ desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications/ \ %{buildroot}%{_datadir}/applications/org.qbittorrent.qBittorrent-Enhanced-Edition.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.qbittorrent.qBittorrent-Enhanced-Edition.appdata.xml %files %license COPYING %doc README.md AUTHORS Changelog %{_bindir}/qbittorrent-enhanced %{_metainfodir}/org.qbittorrent.qBittorrent-Enhanced-Edition.appdata.xml %{_datadir}/applications/org.qbittorrent.qBittorrent-Enhanced-Edition.desktop %{_datadir}/icons/hicolor/*/apps/qbittorrent.* %{_datadir}/icons/hicolor/*/status/qbittorrent-tray* %{_mandir}/man1/qbittorrent.1* %files nox %license COPYING %doc AUTHORS Changelog %{_bindir}/qbittorrent-enhanced-nox %{_unitdir}/qbittorrent-enhanced-nox@.service %{_mandir}/man1/qbittorrent-nox.1*