net-p2p/deluge: x86 stable wrt bug #566206
[gentoo.git] / net-p2p / deluge / deluge-1.3.12.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python2_7 )
8 DISTUTILS_SINGLE_IMPL=1
9 inherit distutils-r1 eutils systemd
10
11 DESCRIPTION="BitTorrent client with a client/server model"
12 HOMEPAGE="http://deluge-torrent.org/"
13
14 if [[ ${PV} == 9999 ]]; then
15         inherit git-2
16         EGIT_REPO_URI="git://deluge-torrent.org/${PN}.git
17                 http://git.deluge-torrent.org/${PN}"
18         SRC_URI=""
19         KEYWORDS=""
20 else
21         SRC_URI="http://download.deluge-torrent.org/source/${P}.tar.bz2"
22         KEYWORDS="amd64 ~arm ~ppc ~sparc x86"
23 fi
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 IUSE="geoip gtk libnotify setproctitle sound webinterface"
28 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
29
30 DEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         dev-util/intltool"
33 RDEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
34         dev-python/chardet[${PYTHON_USEDEP}]
35         dev-python/pyopenssl[${PYTHON_USEDEP}]
36         dev-python/pyxdg[${PYTHON_USEDEP}]
37         >=dev-python/twisted-core-8.1[${PYTHON_USEDEP}]
38         >=dev-python/twisted-web-8.1[${PYTHON_USEDEP}]
39         geoip? ( dev-libs/geoip )
40         gtk? (
41                 sound? ( dev-python/pygame[${PYTHON_USEDEP}] )
42                 dev-python/pygobject:2[${PYTHON_USEDEP}]
43                 >=dev-python/pygtk-2.12[${PYTHON_USEDEP}]
44                 gnome-base/librsvg
45                 libnotify? ( dev-python/notify-python[${PYTHON_USEDEP}] )
46         )
47         setproctitle? ( dev-python/setproctitle[${PYTHON_USEDEP}] )
48         webinterface? ( dev-python/mako[${PYTHON_USEDEP}] )"
49
50 python_prepare_all() {
51         local PATCHES=(
52                 "${FILESDIR}"/${PN}-1.3.5-disable_libtorrent_internal_copy.patch
53         )
54
55         distutils-r1_python_prepare_all
56 }
57
58 _distutils-r1_create_setup_cfg() {
59         # bug 531370: deluge has its own plugin system. No need to relocate its egg info files.
60         # Override this call from the distutils-r1 eclass.
61         # This does not respect the distutils-r1 API. DONOT copy this example.
62         :
63 }
64
65 python_install_all() {
66         distutils-r1_python_install_all
67         newinitd "${FILESDIR}"/deluged.init deluged
68         newconfd "${FILESDIR}"/deluged.conf deluged
69         systemd_dounit "${FILESDIR}"/deluged.service
70         systemd_dounit "${FILESDIR}"/deluge-web.service
71 }
72
73 pkg_postinst() {
74         elog
75         elog "If after upgrading it doesn't work, please remove the"
76         elog "'~/.config/deluge' directory and try again, but make a backup"
77         elog "first!"
78         elog
79         elog "To start the daemon either run 'deluged' as user"
80         elog "or modify /etc/conf.d/deluged and run"
81         elog "/etc/init.d/deluged start as root"
82         elog "You can still use deluge the old way"
83         elog
84         elog "For more information look at http://dev.deluge-torrent.org/wiki/Faq"
85         elog
86 }