summaryrefslogtreecommitdiff
blob: 7a65a216fc353f5b3bb23d02d8a24d5016706fa4 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk-app_icd/asterisk-app_icd-1.0.0.ebuild,v 1.7 2006/04/16 00:09:14 stkn Exp $

inherit eutils

MY_PN="icd"

DESCRIPTION="ICD (Intelligent Call Distributor) application plugin for Asterisk"
HOMEPAGE="http://icd.sourceforge.net/"
SRC_URI="mirror://sourceforge/${MY_PN}/${MY_PN}-${PV}.tar.gz"

IUSE="debug"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc x86"

DEPEND="sys-libs/glibc
	>=net-misc/asterisk-1.0.7-r1
	>=net-misc/zaptel-1.0.7-r1
	!>=net-misc/asterisk-1.2.0"

S=${WORKDIR}/${MY_PN}-${PV}

src_unpack() {
	unpack ${A}

	cd ${S}
	epatch ${FILESDIR}/${P}-gentoo.diff

	# asterisk + bristuff
	if built_with_use net-misc/asterisk bri; then
		epatch ${FILESDIR}/${P}-bristuff.diff
	fi

	# fix segfault in config parser (patch sent upstream)
	epatch ${FILESDIR}/${P}-configsegv.diff
}

src_compile() {
	local myconf

	use debug && \
		myconf="${myconf} DEBUG=1"

	emake CFLAGS="${CFLAGS}" \
		.sqlite || die "Building sqlite failed"

	emake \
		${myconf} || die "emake failed"
}

src_install() {
	make INSTALL_PREFIX=${D} install || die

	insinto /etc/asterisk
	newins  icd_config/extensions.conf.sample extensions.conf.icd

	chmod -R 750 ${D}/etc/asterisk
	chown -R root:asterisk ${D}/etc/asterisk

	dodoc README README.memory BUGS *.txt
}

pkg_postinst() {
	einfo "An example dialplan config for asterisk has been installed into:"
	einfo "   ${ROOT}/etc/asterisk/extensions.conf.icd"
	einfo ""
	einfo "See http://icd.sourceforge.net/ for more information"
}