dev-ros/rosbash: Fix catking prefix patch.
[gentoo.git] / net-p2p / rtorrent / rtorrent-0.9.4-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit autotools eutils systemd
8
9 DESCRIPTION="BitTorrent Client using libtorrent"
10 HOMEPAGE="http://libtorrent.rakshasa.no/"
11 SRC_URI="http://libtorrent.rakshasa.no/downloads/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris"
16 IUSE="daemon debug ipv6 selinux test xmlrpc"
17
18 COMMON_DEPEND="~net-libs/libtorrent-0.13.${PV##*.}
19         >=dev-libs/libsigc++-2.2.2:2
20         >=net-misc/curl-7.19.1
21         sys-libs/ncurses:0=
22         xmlrpc? ( dev-libs/xmlrpc-c )"
23 RDEPEND="${COMMON_DEPEND}
24         daemon? ( app-misc/screen )
25         selinux? ( sec-policy/selinux-rtorrent )
26 "
27 DEPEND="${COMMON_DEPEND}
28         dev-util/cppunit
29         virtual/pkgconfig"
30
31 DOCS=( doc/rtorrent.rc )
32
33 src_prepare() {
34         # bug #358271
35         epatch \
36                 "${FILESDIR}"/${PN}-0.9.1-ncurses.patch \
37                 "${FILESDIR}"/${P}-tinfo.patch
38
39         # upstream forgot to include
40         cp "${FILESDIR}"/rtorrent.1 "${S}"/doc/ || die
41
42         eautoreconf
43 }
44
45 src_configure() {
46         # configure needs bash or script bombs out on some null shift, bug #291229
47         CONFIG_SHELL=${BASH} econf \
48                 --disable-dependency-tracking \
49                 $(use_enable debug) \
50                 $(use_enable ipv6) \
51                 $(use_with xmlrpc xmlrpc-c)
52 }
53
54 src_install() {
55         default
56         doman doc/rtorrent.1
57
58         if use daemon; then
59                 newinitd "${FILESDIR}/rtorrentd.init" rtorrentd
60                 newconfd "${FILESDIR}/rtorrentd.conf" rtorrentd
61                 systemd_newunit "${FILESDIR}/rtorrentd_at.service" "rtorrentd@.service"
62         fi
63 }