summaryrefslogtreecommitdiff
blob: 02edaf7c06f14d10176795bc7667dd0c53f3b8a8 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit qt3 eutils

DESCRIPTION="A SIP user agent for Linux, with which you can initiate VoIP connections over the Internet."
HOMEPAGE="http://sourceforge.net/projects/kphone"
SRC_URI="mirror://sourceforge/kphone/${P/-/_}.tar.gz"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="alsa debug srtp"

S=${WORKDIR}/${PN}

DEPEND="=x11-libs/qt-3*
	dev-libs/openssl
	alsa? ( media-libs/alsa-lib )
	srtp? ( >=net-libs/libsrtp-1.4.0 )"

src_unpack() {
	unpack "${A}"
	cd "${S}"

	# - re-arrange conditioals in Makefile, only link against srtp if
	#   it has been enabled at configure time
	# - add $(DESTDIR) handling to several makefiles and fix kphoneringing Makefile.in
	#   to use locations defined by configure
	# - remove srtp include path and prepare to use configure result for AR in the future (AR=@AR@)
	epatch "${FILESDIR}"/kphoneSI-1.0.2.1-Makefile.in.diff

	# fix #include of srtp.h, octet_t -> unsigned char
	epatch "${FILESDIR}"/kphoneSI_1.0-SRTPWrapper.h.diff

	# use srtp-1.4 compatible wrapper, change include in dspoutrtp.h (should be changed)
	# and fix library name in srtp-1.4 Makefile.in (should be changed too)
	epatch "${FILESDIR}"/kphoneSI-1.0.2.1-srtp-1.4.diff

	# preserve custom cflags passed to configure (parts taken from kphoneSI CVS)
	epatch "${FILESDIR}"/kphoneSI-1.0.2.1-use-custom-cflags.patch
}

src_compile() {
	econf \
		$(use_enable alsa) \
		$(use_enable debug) \
		$(use_enable srtp) \
		|| die "econf failed"
	emake all || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"

	dodoc CHANGES README

	make_desktop_entry "kpsi" KPhoneSI "/usr/share/KPhoneSI/icons/large-phone.png" "Telephony;Qt"
}