summaryrefslogtreecommitdiff
blob: 3b72b967fafc405e1896c15cbfa4c67320e0695f (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/ktorrent/ktorrent-2.2.5.ebuild,v 1.1 2008/01/29 02:19:23 tgurr Exp $

inherit kde

MY_P="${P/_/}"
MY_PV="${PV/_/}"
DESCRIPTION="A BitTorrent program for KDE."
HOMEPAGE="http://ktorrent.org/"
SRC_URI="http://ktorrent.org/downloads/${MY_PV}/${MY_P}.tar.bz2"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
IUSE="avahi geoip kdeenablefinal"

DEPEND="dev-libs/gmp
		avahi? ( >=net-dns/avahi-0.6.16-r1 )
		geoip? ( >=dev-libs/geoip-1.4.0-r1 )"
RDEPEND="${DEPEND}
		|| ( kde-base/kdebase kde-base/kdebase-kioslaves )"

S="${WORKDIR}/${MY_P}"

need-kde 3.5

LANGS="ar bg br ca cs cy da de el en_GB es et fa fr gl hu it ja ka lt
ms nb nds nl pa pl pt pt_BR ru rw sk sr sr@Latn sv tr uk zh_CN zh_TW"

for X in ${LANGS} ; do
	IUSE="${IUSE} linguas_${X}"
done

pkg_setup() {
	if use avahi && ! built_with_use net-dns/avahi qt3 ; then
		echo
		eerror "In order to use ktorrents zeroconf plugin you need to have"
		eerror "net-dns/avahi emerged with \"qt3\" in your USE flag. Please add"
		eerror "that flag, re-emerge avahi, and then emerge ktorrent again."
		echo
		die "net-dns/avahi not built with \"qt3\" support."
	fi

	kde_pkg_setup
}

src_unpack() {
	kde_src_unpack

	local MAKE_LANGS
	cd "${WORKDIR}/${MY_P}/translations"
	for X in ${LANGS} ; do
		use linguas_${X} && MAKE_LANGS="${MAKE_LANGS} ${X}"
	done
	sed -i -e "s:SUBDIRS=.*:SUBDIRS=${MAKE_LANGS}:" Makefile.am

	cd "${S}"
	# Fix automagic dependencies on avahi and geoip
	epatch "${FILESDIR}/${PN}-2.2.5-avahi-check.patch"
	epatch "${FILESDIR}/${PN}-2.2.2-geoip-check.patch"

	rm -f "${S}/configure"
}

src_compile(){
	local myconf="--enable-knetwork --enable-builtin-country-flags"
	myconf="${myconf} --enable-torrent-mimetype"

	if use geoip ; then
		myconf="${myconf} --enable-system-geoip --disable-geoip"
	else
		myconf="${myconf} --disable-geoip --disable-system-geoip"
	fi

	if use avahi ; then
		myconf="${myconf} --with-avahi"
	else
		myconf="${myconf} --without-avahi"
	fi

	kde_src_compile
}