/[gentoo-x86]/net-misc/asterisk-addons/asterisk-addons-1.2.9.ebuild
Gentoo

Contents of /net-misc/asterisk-addons/asterisk-addons-1.2.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Feb 27 19:21:57 2011 UTC (8 years, 9 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Asterisk 1.2 has been removed from portage; clean up accordingly.

(Portage version: 2.1.9.41/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk-addons/asterisk-addons-1.2.9.ebuild,v 1.1 2009/05/01 15:43:59 chainsaw Exp $
4
5 inherit eutils flag-o-matic autotools
6
7 IUSE="elibc_uclibc mysql sqlite h323"
8 SQLITE_PV="3.2.1"
9
10 MY_P="${P/_/-}"
11
12 DESCRIPTION="Additional Plugins for Asterisk"
13 HOMEPAGE="http://www.asterisk.org/"
14 SRC_URI="http://downloads.digium.com/pub/asterisk/old-releases/${MY_P}.tar.gz
15 sqlite? ( http://www.sqlite.org/sqlite-${SQLITE_PV}.tar.gz )"
16
17 S=${WORKDIR}/${MY_P}
18
19 SLOT="0"
20 LICENSE="GPL-2"
21 KEYWORDS="~amd64 ~sparc ~x86"
22
23 RDEPEND="=net-misc/asterisk-1.2*
24 mysql? ( virtual/mysql )"
25
26 pkg_setup() {
27 local n dosleep=0
28 einfo "Running pre-flight checks..."
29
30 if use h323 && built_with_use net-misc/asterisk h323; then
31 echo
32 ewarn "h323: Emerging ${PN} with the h323 flag enabled will overwrite asterisk's chan_h323.so!"
33 ewarn "h323: Be sure to upgrade ${ROOT}etc/asterisk/h323.conf afterwards!"
34 dosleep=1
35 fi
36
37 if use sqlite && built_with_use net-misc/asterisk sqlite; then
38 echo
39 ewarn "sqlite: Emerging ${PN} with the sqlite flag enabled will overwrite asterisk's res_sqlite.so!"
40 ewarn "sqlite: Be sure to upgrade ${ROOT}etc/asterisk/res_sqlite.conf afterwards!"
41 dosleep=1
42 fi
43
44 echo
45 if [[ $dosleep -gt 0 ]]; then
46 ebeep
47 n=10
48 while [[ $n -gt 0 ]]; do
49 echo -en " Waiting $n seconds...\r"
50 sleep 1
51 (( n-- ))
52 done
53 fi
54 }
55
56 src_unpack() {
57 unpack ${A}
58 cd "${S}"
59
60 #
61 # gentoo patchset
62 #
63 epatch "${FILESDIR}/${PN}-1.2.0-gentoo-base.diff"
64 epatch "${FILESDIR}/${PN}-1.2.0-gentoo-res_sqlite3.diff"
65 epatch "${FILESDIR}/${PN}-1.2.2-gentoo-format_mp3.diff"
66 epatch "${FILESDIR}/${PN}-1.2.3-gentoo-ooh323c.diff"
67
68 # patch from jaervosz for uclibc
69 if use elibc_uclibc; then
70 epatch "${FILESDIR}/${PN}-1.2.2-uclibc.diff"
71 epatch "${FILESDIR}/${PN}-1.2.4-uclibc.diff"
72 fi
73 # patch sqlite
74 if use sqlite; then
75 cd "${WORKDIR}/sqlite-${SQLITE_PV}"
76
77 epatch "${FILESDIR}/sqlite-${SQLITE_PV}-data-corruption.patch"
78 epunt_cxx
79 fi
80
81 # rebuild ooh323c configure
82 if use h323; then
83 cd "${S}/asterisk-ooh323c"
84 eautoreconf
85 fi
86 }
87
88 src_compile() {
89 append-flags -fPIC
90
91 emake -j1 OPTIMIZE="${CFLAGS}" || die "Make failed"
92
93 if use sqlite; then
94 cd "${WORKDIR}/sqlite-${SQLITE_PV}"
95 econf --enable-threadsafe || die ""
96 emake || die ""
97
98 cd "${S}"
99 emake -j1 -C res_sqlite3 \
100 SQLITEDIR="${WORKDIR}/sqlite-${SQLITE_PV}" || die "Make res_sqlite failed"
101 fi
102
103 if use h323; then
104 cd "${S}/asterisk-ooh323c"
105 econf || die "econf failed"
106 emake || die "emake failed"
107 fi
108 }
109
110 src_install() {
111 make DESTDIR="${D}" install || die "Make install failed"
112
113 if use sqlite; then
114 make -C res_sqlite3 \
115 DESTDIR="${D}" install || die "Make install res_sqlite3 failed"
116 fi
117
118 if use h323; then
119 make -C asterisk-ooh323c \
120 DESTDIR="${D}" install || die "Make instal ooh323c failed"
121 fi
122
123 # install standard docs...
124 dodoc README
125 dodoc doc/cdr_mysql.txt
126
127 insinto "/usr/share/doc/${PF}"
128 doins configs/*.sample
129
130 if use sqlite; then
131 cd "${S}/res_sqlite3"
132 docinto res_sqlite3
133 dodoc README
134 insinto "/usr/share/doc/${PF}/res_sqlite3"
135 doins res_sqlite.conf dialplan.sql
136 keepdir /var/lib/asterisk/sqlite
137 fi
138
139 if use h323; then
140 cd "${S}/asterisk-ooh323c"
141 docinto chan_ooh323c
142 dodoc AUTHORS INSTALL NEWS README ChangeLog
143 dodoc h323.conf.sample extensions.conf.sample
144
145 insinto /etc/asterisk
146 newins h323.conf.sample h323.conf
147 fi
148
149 cd "${S}"
150
151 if use mysql; then
152 insinto /etc/asterisk
153 newins configs/cdr_mysql.conf.sample cdr_mysql.conf
154 newins configs/res_mysql.conf.sample res_mysql.conf
155 fi
156
157 if use h323 || use mysql; then
158 einfo "Fixing permissions"
159 chown -R root:asterisk "${D}etc/asterisk"
160 chmod -R u=rwX,g=rX,o= "${D}etc/asterisk"
161 fi
162 }
163
164 pkg_postinst() {
165 einfo "********* Some notes from the asterisk-addons readme: **********"
166 echo
167 ewarn "\"Using res_config_mysql at the same time as res_config_odbc can create"
168 ewarn "system instability on some systems. Please load only one or the other.\""
169 echo
170 ewarn "\"format_mp3 can cause Asterisk to crash on certain mp3 files (notably"
171 ewarn "8k files made with lame) due to bugs in mpglib. If you must use this"
172 ewarn "module, use it only with mp3's you know will work with it.\""
173 }

  ViewVC Help
Powered by ViewVC 1.1.20