summaryrefslogtreecommitdiff
blob: 929c0ba3c276f0a4f83fa3beb81c0805c5426863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/rb_libtorrent/rb_libtorrent-0.13-r1.ebuild,v 1.1 2009/06/28 00:02:56 yngwin Exp $

EAPI="2"
inherit eutils flag-o-matic

MY_P=${P/rb_/}
S=${WORKDIR}/${MY_P}

DESCRIPTION="A C++ BitTorrent implementation focusing on efficiency and scalability"
HOMEPAGE="http://www.rasterbar.com/products/libtorrent/"
SRC_URI="mirror://sourceforge/libtorrent/${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
IUSE="debug doc"

DEPEND="|| ( >=dev-libs/boost-1.34.1
		~dev-libs/boost-1.33.1[threads] )
	!net-libs/libtorrent"
RDEPEND="${DEPEND}"

src_prepare() {
	epatch "${FILESDIR}"/${P}-CVE-2009-1760.patch  # bug 273156
	epatch "${FILESDIR}"/${P}-boost-1.37.patch     # bug 270447
	epatch "${FILESDIR}"/${P}-gcc44.patch
}

src_configure() {
	append-ldflags -pthread

	# fails with as-needed, bug 271818
	append-ldflags -Wl,--no-as-needed

	# use multi-threaded boost libs
	local BOOST_LIBS="--with-boost-date-time=boost_date_time-mt \
		--with-boost-filesystem=boost_filesystem-mt \
		--with-boost-thread=boost_thread-mt \
		--with-boost-regex=boost_regex-mt \
		--with-boost-program_options=boost_program_options-mt"

	econf $(use_enable debug) ${BOOST_LIBS}
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc ChangeLog AUTHORS NEWS README || die "dodoc failed"
	if use doc ; then
		dohtml docs/* || die "Could not install HTML documentation"
	fi
}