File deluge.spec of Package deluge

# spec file for package deluge
# Copyright (c) 2022 SUSE LLC
# 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

%global __requires_exclude typelib\\(GConf|AyatanaAppIndicator3\\)

%define _version 2.1
Name:           deluge
Version:        2.1.1
Release:        0
Summary:        BitTorrent Client
License:        SUSE-GPL-3.0-with-openssl-exception
Group:          Productivity/Networking/File-Sharing
# PATCH-FIX-OPENSUSE deluge-suse-geoip-location.patch -- Point to the right GeoIP.dat location.
Patch0:         %{name}-suse-geoip-location.patch
# PATCH-FIX-UPSTREAM deluge-update_7z_binary.patch
Patch1:         %{name}-update_7z_binary.patch
BuildRequires:  fdupes
BuildRequires:  gettext
BuildRequires:  gobject-introspection-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  python-rpm-macros
%if 0%{suse_version} >= 1550
BuildRequires:  python3-Twisted-tls >= 17.1
BuildRequires:  python3-Twisted >= 17.1
BuildRequires:  python3-devel
BuildRequires:  python3-libtorrent-rasterbar >= 1.2
BuildRequires:  python3-rjsmin
BuildRequires:  python3-setuptools
BuildRequires:  python3-slimit
BuildRequires:  python3-wheel
BuildRequires:  strip-nondeterminism
BuildRequires:  update-desktop-files
Requires:       python3-Mako
Requires:       python3-Pillow
%if 0%{suse_version} >= 1550
Requires:       python3-Twisted-tls >= 17.1
Requires:       python3-Twisted >= 17.1
Requires:       python3-gobject
Requires:       python3-gobject-Gdk
Requires:       python3-gobject-cairo
Requires:       python3-libtorrent-rasterbar >= 1.2
Requires:       python3-pyOpenSSL
Requires:       python3-pyxdg
Requires:       python3-rencode
Requires:       python3-setproctitle
Requires:       python3-setuptools
Requires:       python3-six
Requires:       python3-zope.interface
Requires:       xdg-utils
Recommends:     %{name}-lang
Recommends:     python3-GeoIP
Recommends:     python3-Pillow
Recommends:     python3-chardet
Recommends:     python3-dbus-python
Recommends:     python3-distro
Recommends:     python3-notify
Recommends:     python3-pygame
Recommends:     python3-service_identity
Recommends:     python3-setproctitle
BuildArch:      noarch
%if %{?suse_version} >= 1550
Requires:       python3-pycairo
Requires:       python3-cairo

Deluge is a Free Software, cross-platform BitTorrent client on
Python and Gtk3 with multiple user interfaces in client/server


%autosetup -p1
sed -i '/^#!/d' deluge/ deluge/ui/gtk3/


strip-nondeterminism -t zip %{buildroot}%{python3_sitelib}/%{name}/plugins/*.egg
install -D -m 644 packaging/systemd/deluged.service %{buildroot}%{_userunitdir}/deluged.service
install -D -m 644 packaging/systemd/deluge-web.service %{buildroot}%{_userunitdir}/deluge-web.service
%fdupes %{buildroot}%{python3_sitelib}/
%fdupes %{buildroot}%{_datadir}/icons/hicolor/

mv %{buildroot}%{python3_sitelib}/%{name}/i18n %{buildroot}%{_datadir}/locale
%find_lang %{name}

pushd %{buildroot}%{_datadir}/locale/
mkdir %{buildroot}%{python3_sitelib}/%{name}/i18n/
ls | while read -r f; do
    if ( echo "$f" | grep -q '\.py$' ); then
        mv -f "$f" %{buildroot}%{python3_sitelib}/%{name}/i18n/
        ln -s "%{_datadir}/locale/$f" \
%fdupes %{buildroot%}%{_datadir}/icons

%systemd_user_pre deluged.service deluge-web.service

%systemd_user_post deluged.service deluge-web.service

%systemd_user_preun deluged.service deluge-web.service

%systemd_user_postun deluged.service deluge-web.service

%license LICENSE

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by