File qbittorrent.spec of Package qbittorrent

# spec file for package qbittorrent
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Mariusz Fik <>.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           qbittorrent
Version:        3.3.13
Release:        0
Summary:        A BitTorrent client in Qt
License:        GPL-2.0+
Group:          Productivity/Networking/File-Sharing
Source2:        %{name}.keyring
# PATCH-FIX-OPENSUSE bittorrent_missing_ppc64le_in_ax_boost_base.m4.patch -- Add ppc64le support.
Patch0:         bittorrent_missing_ppc64le_in_ax_boost_base.m4.patch
# PATCH-FIX-OPENSUSE qbittorrent-libtorrent-1.1.1.patch -- Fix building with libtorrent-rasterbar 1.1.1.
Patch1:         qbittorrent-libtorrent-1.1.1.patch
# PATCH-FIX-OPENSUSE qbittorrent-fix-qt-5.4-compat.patch -- Fix compatibility with Qt 5.4 or older.
Patch2:         qbittorrent-fix-qt-5.4-compat.patch
BuildRequires:  autoconf
BuildRequires:  automake
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_system-devel
BuildRequires:  boost-devel
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(libtorrent-rasterbar) >= 1.0.6
# For geolocalisation.
Requires:       GeoIP
Recommends:     python
# For search engines.
Recommends:     python3
%if 0%{?suse_version} >= 1320 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires:  libqt5-linguist >= 5.2.0
BuildRequires:  pkgconfig(Qt5Concurrent) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Core) >= 5.2.0
BuildRequires:  pkgconfig(Qt5DBus) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Gui) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Network) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Xml) >= 5.2.0
BuildRequires:  libqt4-linguist >= 4.8.0
BuildRequires:  pkgconfig(QtCore) >= 4.8.0
BuildRequires:  pkgconfig(QtDBus) >= 4.8.0
BuildRequires:  pkgconfig(QtGui) >= 4.8.0
BuildRequires:  pkgconfig(QtNetwork) >= 4.8.0
BuildRequires:  pkgconfig(QtXml) >= 4.8.0

qBittorrent is a bittorrent client programmed in C++ and Qt that
uses libtorrent-rasterbar.

It has a streaming-like function to let users download and play video
files, supports Unicode and has a bandwith scheduler.

%package nox
Summary:        A BitTorrent client in Qt, CLI version
Group:          Productivity/Networking/File-Sharing

%description nox
qBittorrent is a bittorrent client programmed in C++ and Qt that
uses libtorrent-rasterbar. This subpackage contains a command-line

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

aclocal -I m4
%global _configure ../configure
for ui in nox gui; do
    [[ "$ui" == nox ]] && ui_opt='--disable-gui' || ui_opt=
    mkdir $ui
    pushd $ui
    %configure \
      $ui_opt          \
%if 0%{?suse_version} < 1320 && !(0%{?sle_version} >= 120100 && 0%{?is_opensuse})
      --with-qt4       \
    make %{?_smp_mflags} V=1

make INSTALL_ROOT=%{buildroot} install -C nox
make INSTALL_ROOT=%{buildroot} install -C gui

mkdir -p %{buildroot}%{_sbindir}/
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-nox

%fdupes %{buildroot}%{_datadir}/



%pre nox
%service_add_pre %{name}-nox.service

%post nox
%service_add_post %{name}-nox.service

%preun nox
%service_del_preun %{name}-nox.service

%postun nox
%service_del_postun %{name}-nox.service

%dir %{_datadir}/appdata/

%files nox