summaryrefslogtreecommitdiff
blob: d5bcf7be3e1dea4e029b797785cabb21bc210ecf (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
# Copyright 1999-2005 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.1 2005/06/15 23:42:46 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="-*"

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

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
}

src_compile() {
	local myconf

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

	emake -j1 \
		${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"
}