Merge remote-tracking branch 'github/pr/536'.
[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
29 DEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
30         dev-python/setuptools[${PYTHON_USEDEP}]
31         dev-util/intltool"
32 RDEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
33         dev-python/chardet[${PYTHON_USEDEP}]
34         dev-python/pyopenssl[${PYTHON_USEDEP}]
35         dev-python/pyxdg[${PYTHON_USEDEP}]
36         >=dev-python/twisted-core-8.1[${PYTHON_USEDEP}]
37         >=dev-python/twisted-web-8.1[${PYTHON_USEDEP}]
38         geoip? ( dev-libs/geoip )
39         gtk? (
40                 sound? ( dev-python/pygame[${PYTHON_USEDEP}] )
41                 dev-python/pygobject:2[${PYTHON_USEDEP}]
42                 >=dev-python/pygtk-2.12[${PYTHON_USEDEP}]
43                 gnome-base/librsvg
44                 libnotify? ( dev-python/notify-python[${PYTHON_USEDEP}] )
45         )
46         setproctitle? ( dev-python/setproctitle[${PYTHON_USEDEP}] )
47         webinterface? ( dev-python/mako[${PYTHON_USEDEP}] )"
48
49 python_prepare_all() {
50         local PATCHES=(
51                 "${FILESDIR}"/${PN}-1.3.5-disable_libtorrent_internal_copy.patch
52         )
53
54         distutils-r1_python_prepare_all
55 }
56
57 _distutils-r1_create_setup_cfg() {
58         # bug 531370: deluge has its own plugin system. No need to relocate its egg info files.
59         # Override this call from the distutils-r1 eclass.
60         # This does not respect the distutils-r1 API. DONOT copy this example.
61         :
62 }
63
64 python_install_all() {
65         distutils-r1_python_install_all
66         newinitd "${FILESDIR}"/deluged.init deluged
67         newconfd "${FILESDIR}"/deluged.conf deluged
68         systemd_dounit "${FILESDIR}"/deluged.service
69         systemd_dounit "${FILESDIR}"/deluge-web.service
70 }
71
72 pkg_postinst() {
73         elog
74         elog "If after upgrading it doesn't work, please remove the"
75         elog "'~/.config/deluge' directory and try again, but make a backup"
76         elog "first!"
77         elog
78         elog "To start the daemon either run 'deluged' as user"
79         elog "or modify /etc/conf.d/deluged and run"
80         elog "/etc/init.d/deluged start as root"
81         elog "You can still use deluge the old way"
82         elog
83         elog "For more information look at http://dev.deluge-torrent.org/wiki/Faq"
84         elog
85 }