Package deluge: Specfile

%define major 2.0

Name: deluge
Version: %major.3
Release: alt2

Summary: full-featured BitTorrent client
License: GPL-3.0-or-later with OpenSSL exception
Group: Networking/File transfer

Url: http://deluge-torrent.org

# repacked https://ftp.osuosl.org/pub/deluge/source/%major/deluge-%version.tar.xz
Source: %name-%version.tar
Source1: deluged.service
Source2: deluge-web.service
Patch1: deluge-2.0.3-alt-setup-no-requires.patch
BuildArch: noarch

BuildRequires(pre): rpm-build-python3
BuildRequires(pre): libappindicator-gtk3-gir-devel librsvg-devel
# Automatically added by buildreq on Sun Mar 22 2020
# optimized out: libboost_python3-1.72.0 libtorrent-rasterbar10 perl perl-Encode perl-XML-Parser perl-parent python2-base python3 python3-base python3-dev python3-module-pkg_resources sh4
BuildRequires: intltool python3-module-chardet python3-module-libtorrent-rasterbar python3-module-setuptools

Requires: deluge-gtk

%description
Deluge is a full-featured  BitTorrent client for Linux, OS X, Unix and
Windows. It uses  libtorrent in it's backend and features multiple
user-interfaces including: GTK+, web and console. It has been designed
using the client server model with a daemon process that handles all the
bittorrent activity. The Deluge daemon is able to run on headless
machines with the user-interfaces being able to connect remotely from
any platform.

Deluge features a rich plugin collection; in fact, most of Deluge's
functionality is available in the form of plugins.

Deluge was created with the intention of being lightweight and
unobtrusive. It is our belief that downloading shouldn't be the primary
task on your computer and therefore shouldn't monopolize system
resources.

Deluge is not designed for any one desktop environment and will work
just fine in GNOME, KDE, XFCE and others. We do our best to adhere to
the  freedesktop standards.

Deluge is  Free Software and is licensed under the  GNU General Public
License.

%package -n python3-module-deluge
Group: Networking/File transfer
Summary: full-featured BitTorrent client (common files)
Requires: python3-module-simplejson python3-module-pyxdg python3-module-libtorrent-rasterbar python3-module-twisted-web
Requires: python3-module-service-identity python3-module-Pillow python3-module-chardet python3-module-setproctitle
# https://bugzilla.altlinux.org/show_bug.cgi?id=39192
Requires: GConf

%description -n python3-module-deluge
This package contains data files commons to both the deluge daemon and
the user-interfaces.

%package console
Group: Networking/File transfer
Summary: full-featured BitTorrent client (console UI)
Requires: python3-module-deluge

%description console
This package contains the console user-interface.

%package -n deluged
Group: Networking/File transfer
Summary: full-featured BitTorrent client (deluge daemon)
Requires: python3-module-deluge

%description -n deluged
Deluge daemon process handles all the bittorrent activity.
The Deluge daemon is able to run on headless machines with the
user-interfaces being able to connect remotely from any platform.

%package gtk
%filter_from_requires '/^python3\(gi\.repository/d'
Group: Networking/File transfer
Summary: full-featured BitTorrent client (GTK UI)
Requires: python3-module-deluge python3-module-twisted-core-gui python3-module-pygobject3-pygtkcompat

%description gtk
This package contains the GTK user-interface.

%package web
Group: Networking/File transfer
Summary: full-featured BitTorrent client (web UI)
Requires: python3-module-deluge

%description web
This package contains the web user-interface.

%prep
%setup -q
cp -a %SOURCE1 .
cp -a %SOURCE2 .
%patch1 -p2

%build
%python3_build

%install
%python3_install
rm -f %buildroot%_datadir/pixmaps/*
rm -f %buildroot%python_sitelibdir/%name/ui/webui/scripts/build_webui_tarball.sh
mkdir -p %buildroot{%_unitdir,%_spooldir/%{name}d}
cp -a %{name}d.service %buildroot%_unitdir
cp -a %name-web.service %buildroot%_unitdir

%pre -n deluged
%_sbindir/groupadd -r -f _deluge
%_sbindir/useradd -r -n -g _deluge -d %_spooldir/%{name}d -s /dev/null -c "deluge bittorrent daemon" _deluge >/dev/null 2>&1 ||:

%post -n deluged
%post_service deluged

%preun -n deluged
%preun_service deluged

%files
%_bindir/%name
%_man1dir/%name.1*
%doc LICENSE CHANGELOG.md README.md

%files -n python3-module-deluge
%dir %python3_sitelibdir/%name
%python3_sitelibdir/%name/*.py*
%python3_sitelibdir/%name/core
%python3_sitelibdir/%name/ui/data
%python3_sitelibdir/%name/i18n
%python3_sitelibdir/%name/plugins
%dir %python3_sitelibdir/%name/ui
%python3_sitelibdir/%name/ui/*.py*
%python3_sitelibdir/*.egg-info

%files console
%_bindir/%name-console
%_man1dir/%name-console.1*
%python3_sitelibdir/%name/ui/console

%files -n deluged
%_unitdir/%{name}d.service
%_bindir/%{name}d
%_man1dir/%{name}d.1*
%attr(0775,root,_deluge) %dir %_spooldir/%{name}d

%files gtk
%_bindir/%name-gtk
%_man1dir/%name-gtk.1*
%python3_sitelibdir/%name/ui/gtk3
%_iconsdir/hicolor/*/apps/*
%_desktopdir/%name.desktop
%_datadir/appdata/%name.appdata.xml

%files web
%_unitdir/%name-web.service
%_bindir/%name-web
%_man1dir/%name-web.1*
%python3_sitelibdir/%name/ui/web

%changelog
* Fri Nov 06 2020 Vladimir D. Seleznev <vseleznv@altlinux.org> 2.0.3-alt2
- python3-module-deluge: Added dependency on GConf (closes: #39192).

* Sat Mar 07 2020 Vladimir D. Seleznev <vseleznv@altlinux.org> 2.0.3-alt1
- Updated to 2.0.3.
- Switched to Python 3 by upstream.
- Fixed license field.
- Cleaned up spec.

* Fri Sep 29 2017 Vladimir Lettiev <crux@altlinux.org> 1.3.15-alt1
- New version 1.3.13
- deluged/deluge-web managed by systemd

* Mon Sep 12 2016 Vladimir Lettiev <crux@altlinux.ru> 1.3.13-alt1
- New version 1.3.13

* Mon Feb 08 2016 Vladimir Lettiev <crux@altlinux.ru> 1.3.12-alt1
- New version 1.3.12

* Tue Apr 09 2013 Vladimir Lettiev <crux@altlinux.ru> 1.3.6-alt1
- New version 1.3.6 (Closes: #28750)

* Thu May 31 2012 Vladimir Lettiev <crux@altlinux.ru> 1.3.5-alt2
- Fixed subpackages dependencies (Closed: #27388)

* Wed Apr 11 2012 Vladimir Lettiev <crux@altlinux.ru> 1.3.5-alt1
- New version 1.3.5

* Mon Apr 09 2012 Vladimir Lettiev <crux@altlinux.ru> 1.3.4-alt1
- New version 1.3.4

* Sat Oct 22 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 1.3.3-alt3.1
- Rebuild with Python-2.7

* Tue Aug 16 2011 Vladimir Lettiev <crux@altlinux.ru> 1.3.3-alt3
- Fixed default port of WebUI - 8112

* Fri Aug 12 2011 Vladimir Lettiev <crux@altlinux.ru> 1.3.3-alt2
- Fixed _deluge home dir

* Thu Aug 11 2011 Vladimir Lettiev <crux@altlinux.ru> 1.3.3-alt1
- New version 1.3.3
- split up package: deluge, python-module-deluge, deluge-console,
  deluge-web, deluge-gtk, deluged
- added initscript for deluged and deluge-web

* Mon May 23 2011 Repocop Q. A. Robot <repocop@altlinux.org> 1.3.1-alt1.qa1
- NMU (by repocop). See http://www.altlinux.org/Tools/Repocop
- applied repocop fixes:
  * freedesktop-desktop-file-proposed-patch for deluge

* Wed Nov 17 2010 Vladimir Lettiev <crux@altlinux.ru> 1.3.1-alt1
- New version 1.3.1

* Wed Sep 22 2010 Vladimir Lettiev <crux@altlinux.ru> 1.3.0-alt2
- Added python-module-pyxdg to requires (Closes: #24132)
- Added librsvg to requires (loading svg logo)

* Sun Sep 19 2010 Vladimir Lettiev <crux@altlinux.ru> 1.3.0-alt1
- New version 1.3.0

* Sun Sep 05 2010 Vladimir Lettiev <crux@altlinux.ru> 1.3.0-alt0.rc2
- New version 1.3.0_rc2

* Thu Aug 05 2010 Vladimir Lettiev <crux@altlinux.ru> 1.2.3-alt2
- Add python-module-twisted-core-gui to requires (Closes: #23854)

* Sun Mar 28 2010 Vladimir Lettiev <crux@altlinux.ru> 1.2.3-alt1
- New version 1.2.3

* Wed Mar 03 2010 Vladimir Lettiev <crux@altlinux.ru> 1.2.1-alt1
- New version 1.2.1

* Fri Jan 29 2010 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt3
- Fixed deluged failure with new libtorrent-rasterbar0.15 (Closes: #22849)

* Sun Jan 17 2010 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt2
- New version 1.2.0

* Tue Dec 29 2009 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt1.rc5
- YARC

* Tue Dec 01 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.2.0-alt1.rc3.1
- Rebuilt with python 2.6

* Tue Nov 03 2009 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt1.rc3
- another RC

* Mon Oct 26 2009 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt1.rc2
- new RC

* Sat Oct 17 2009 Vladimir Lettiev <crux@altlinux.ru> 1.2.0-alt1.rc1
- new version
- do not check new version by default (Closes: #21908)

* Tue Jun 16 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.9-alt1
- new version

* Sun Jun 14 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.8-alt2
- build with system libtorrent-rasterbar (Closes: 20387)
- dropped libtorrent patches and buildreqs
- noarch

* Sun May 31 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.8-alt1
- new version

* Sun Apr 26 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.7-alt1
- new version
- patch2 moved to upstream

* Thu Apr 09 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.6-alt2
- fix bug #18929

* Tue Apr 07 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.6-alt1
- new version

* Sun Feb 22 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.3-alt1
- new version

* Mon Jan 26 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.1-alt1
- new version

* Thu Jan 15 2009 Vladimir Lettiev <crux@altlinux.ru> 1.1.0-alt1
- new version
- cleared deprecated macroses
- fixed #18201

* Mon Oct 13 2008 Vladimir Lettiev <crux@altlinux.ru> 1.0.2-alt1
- new version
- applied patch from Ivan A. Melnikov (iv@) to fix build with new
  boost and old gcc (workaround gcc-c++ bug #33094)
- removed patch for boost lib detection logic (merged in upstream)
- updated bosts's dependencies
- removed icon from pixmaps dir

* Tue Sep 23 2008 Vladimir Lettiev <crux@altlinux.ru> 1.0.0-alt2
- Fix build on x86_64 (patch from deluge trac ticket #503)

* Mon Sep 22 2008 Vladimir Lettiev <crux@altlinux.ru> 1.0.0-alt1
- Initial build for Sisyphus