/[gentoo-x86]/net-misc/asterisk/asterisk-1.8.5.0-r1.ebuild
Gentoo

Contents of /net-misc/asterisk/asterisk-1.8.5.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jul 14 08:55:33 2011 UTC (8 years, 4 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
An intermittent explosion due to memory corruption was identified and patched by Jaco Kroon, closes bug #375141. Old ebuild killed.

(Portage version: 2.1.10.6/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.8.5.0-r1.ebuild,v 1.1 2011/07/13 10:38:47 chainsaw Exp $
4
5 EAPI=3
6 inherit autotools base eutils linux-info multilib
7
8 MY_P="${PN}-${PV/_/-}"
9
10 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
11 HOMEPAGE="http://www.asterisk.org/"
12 SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz
13 mirror://gentoo/gentoo-asterisk-patchset-0.9.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk h323 http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex ssl sqlite sqlite3 srtp static syslog usb vorbis"
19
20 EPATCH_SUFFIX="patch"
21 PATCHES=( "${WORKDIR}/asterisk-patchset" )
22
23 RDEPEND="sys-libs/ncurses
24 dev-libs/popt
25 sys-libs/zlib
26 dev-libs/libxml2
27 ais? ( sys-cluster/openais )
28 alsa? ( media-libs/alsa-lib )
29 bluetooth? ( net-wireless/bluez )
30 calendar? ( net-libs/neon
31 dev-libs/libical
32 dev-libs/iksemel )
33 caps? ( sys-libs/libcap )
34 curl? ( net-misc/curl )
35 dahdi? ( >=net-libs/libpri-1.4.12_beta2
36 net-misc/dahdi-tools )
37 freetds? ( dev-db/freetds )
38 gtalk? ( dev-libs/iksemel )
39 h323? ( net-libs/openh323 )
40 http? ( dev-libs/gmime )
41 iconv? ( virtual/libiconv )
42 jabber? ( dev-libs/iksemel )
43 jingle? ( dev-libs/iksemel )
44 ldap? ( net-nds/openldap )
45 lua? ( dev-lang/lua )
46 mysql? ( dev-db/mysql )
47 newt? ( dev-libs/newt )
48 odbc? ( dev-db/unixODBC )
49 osplookup? ( net-libs/osptoolkit
50 dev-libs/openssl )
51 portaudio? ( media-libs/portaudio )
52 postgres? ( dev-db/postgresql-base )
53 radius? ( net-dialup/radiusclient-ng )
54 snmp? ( net-analyzer/net-snmp )
55 span? ( media-libs/spandsp )
56 speex? ( media-libs/speex )
57 sqlite? ( dev-db/sqlite:0 )
58 sqlite3? ( dev-db/sqlite:3 )
59 srtp? ( net-libs/libsrtp )
60 ssl? ( dev-libs/openssl )
61 usb? ( dev-libs/libusb
62 media-libs/alsa-lib )
63 vorbis? ( media-libs/libvorbis )"
64
65 DEPEND="${RDEPEND}
66 !net-misc/asterisk-addons
67 !net-misc/asterisk-chan_unistim
68 !net-misc/zaptel"
69
70 RDEPEND="${RDEPEND}
71 syslog? ( virtual/logger )"
72
73 PDEPEND="net-misc/asterisk-core-sounds
74 net-misc/asterisk-extra-sounds
75 net-misc/asterisk-moh-opsound"
76
77 S="${WORKDIR}/${MY_P}"
78
79 pkg_setup() {
80 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
81 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
82 have reported that this module dropped critical SIP packets in their deployments. You
83 may want to disable it if you see such problems."
84 check_extra_config
85
86 enewgroup asterisk
87 enewgroup dialout 20
88 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
89 }
90
91 src_prepare() {
92 base_src_prepare
93 AT_M4DIR=autoconf eautoreconf
94 }
95
96 src_configure() {
97 econf \
98 --libdir="/usr/$(get_libdir)" \
99 --localstatedir="/var" \
100 --with-gsm=internal \
101 --with-popt \
102 --with-z \
103 $(use_with caps cap) \
104 $(use_with http gmime) \
105 $(use_with newt) \
106 $(use_with portaudio) \
107 $(use_with ssl crypto) \
108 $(use_with ssl)
109
110 #
111 # blank out sounds/sounds.xml file to prevent
112 # asterisk from installing sounds files (we pull them in via
113 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
114 #
115 >"${S}"/sounds/sounds.xml
116
117 # Compile menuselect binary for optional components
118 emake menuselect.makeopts
119
120 # Broken functionality is forcibly disabled (bug #360143)
121 menuselect/menuselect --disable chan_misdn menuselect.makeopts
122
123 # Utility set is forcibly enabled (bug #358001)
124 menuselect/menuselect --enable smsq menuselect.makeopts
125 menuselect/menuselect --enable streamplayer menuselect.makeopts
126 menuselect/menuselect --enable aelparse menuselect.makeopts
127 menuselect/menuselect --enable astman menuselect.makeopts
128
129 # The others are based on USE-flag settings
130 if use ais; then
131 menuselect/menuselect --enable res_ais menuselect.makeopts
132 else
133 menuselect/menuselect --disable res_ais menuselect.makeopts
134 fi
135 if use alsa; then
136 menuselect/menuselect --enable chan_alsa menuselect.makeopts
137 else
138 menuselect/menuselect --disable chan_alsa menuselect.makeopts
139 fi
140 if use bluetooth; then
141 menuselect/menuselect --enable chan_mobile menuselect.makeopts
142 else
143 menuselect/menuselect --disable chan_mobile menuselect.makeopts
144 fi
145 if use calendar; then
146 menuselect/menuselect --enable res_calendar menuselect.makeopts
147 menuselect/menuselect --enable res_calendar_caldav menuselect.makeopts
148 menuselect/menuselect --enable res_calendar_ews menuselect.makeopts
149 menuselect/menuselect --enable res_calendar_exchange menuselect.makeopts
150 menuselect/menuselect --enable res_calendar_icalendar menuselect.makeopts
151 else
152 menuselect/menuselect --disable res_calendar menuselect.makeopts
153 menuselect/menuselect --disable res_calendar_caldav menuselect.makeopts
154 menuselect/menuselect --disable res_calendar_ews menuselect.makeopts
155 menuselect/menuselect --disable res_calendar_exchange menuselect.makeopts
156 menuselect/menuselect --disable res_calendar_icalendar menuselect.makeopts
157 fi
158 if use curl; then
159 menuselect/menuselect --enable func_curl menuselect.makeopts
160 menuselect/menuselect --enable res_config_curl menuselect.makeopts
161 menuselect/menuselect --enable res_curl menuselect.makeopts
162 else
163 menuselect/menuselect --disable func_curl menuselect.makeopts
164 menuselect/menuselect --disable res_config_curl menuselect.makeopts
165 menuselect/menuselect --disable res_curl menuselect.makeopts
166 fi
167 if use dahdi; then
168 menuselect/menuselect --enable app_dahdibarge menuselect.makeopts
169 menuselect/menuselect --enable app_dahdiras menuselect.makeopts
170 menuselect/menuselect --enable chan_dahdi menuselect.makeopts
171 menuselect/menuselect --enable codec_dahdi menuselect.makeopts
172 menuselect/menuselect --enable res_timing_dahdi menuselect.makeopts
173 else
174 menuselect/menuselect --disable app_dahdibarge menuselect.makeopts
175 menuselect/menuselect --disable app_dahdiras menuselect.makeopts
176 menuselect/menuselect --disable chan_dahdi menuselect.makeopts
177 menuselect/menuselect --disable codec_dahdi menuselect.makeopts
178 menuselect/menuselect --disable res_timing_dahdi menuselect.makeopts
179 fi
180 if use freetds; then
181 menuselect/menuselect --enable cdr_tds menuselect.makeopts
182 menuselect/menuselect --enable cel_tds menuselect.makeopts
183 else
184 menuselect/menuselect --disable cdr_tds menuselect.makeopts
185 menuselect/menuselect --disable cel_tds menuselect.makeopts
186 fi
187 if use gtalk; then
188 menuselect/menuselect --enable chan_gtalk menuselect.makeopts
189 else
190 menuselect/menuselect --disable chan_gtalk menuselect.makeopts
191 fi
192 if use h323; then
193 menuselect/menuselect --enable chan_ooh323 menuselect.makeopts
194 else
195 menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
196 fi
197 if use http; then
198 menuselect/menuselect --enable res_http_post menuselect.makeopts
199 else
200 menuselect/menuselect --disable res_http_post menuselect.makeopts
201 fi
202 if use iconv; then
203 menuselect/menuselect --enable func_iconv menuselect.makeopts
204 else
205 menuselect/menuselect --disable func_iconv menuselect.makeopts
206 fi
207 if use jabber; then
208 menuselect/menuselect --enable res_jabber menuselect.makeopts
209 else
210 menuselect/menuselect --disable res_jabber menuselect.makeopts
211 fi
212 if use jingle; then
213 menuselect/menuselect --enable chan_jingle menuselect.makeopts
214 else
215 menuselect/menuselect --disable chan_jingle menuselect.makeopts
216 fi
217 if use ldap; then
218 menuselect/menuselect --enable res_config_ldap menuselect.makeopts
219 else
220 menuselect/menuselect --disable res_config_ldap menuselect.makeopts
221 fi
222 if use lua; then
223 menuselect/menuselect --enable pbx_lua menuselect.makeopts
224 else
225 menuselect/menuselect --disable pbx_lua menuselect.makeopts
226 fi
227 if use mysql; then
228 menuselect/menuselect --enable app_mysql menuselect.makeopts
229 menuselect/menuselect --enable cdr_mysql menuselect.makeopts
230 menuselect/menuselect --enable res_config_mysql menuselect.makeopts
231 else
232 menuselect/menuselect --disable app_mysql menuselect.makeopts
233 menuselect/menuselect --disable cdr_mysql menuselect.makeopts
234 menuselect/menuselect --disable res_config_mysql menuselect.makeopts
235 fi
236 if use odbc; then
237 menuselect/menuselect --enable cdr_adaptive_odbc menuselect.makeopts
238 menuselect/menuselect --enable cdr_odbc menuselect.makeopts
239 menuselect/menuselect --enable cel_odbc menuselect.makeopts
240 menuselect/menuselect --enable func_odbc menuselect.makeopts
241 menuselect/menuselect --enable res_config_odbc menuselect.makeopts
242 menuselect/menuselect --enable res_odbc menuselect.makeopts
243 else
244 menuselect/menuselect --disable cdr_adaptive_odbc menuselect.makeopts
245 menuselect/menuselect --disable cdr_odbc menuselect.makeopts
246 menuselect/menuselect --disable cel_odbc menuselect.makeopts
247 menuselect/menuselect --disable func_odbc menuselect.makeopts
248 menuselect/menuselect --disable res_config_odbc menuselect.makeopts
249 menuselect/menuselect --disable res_odbc menuselect.makeopts
250 fi
251 if use osplookup; then
252 menuselect/menuselect --enable app_osplookup menuselect.makeopts
253 else
254 menuselect/menuselect --disable app_osplookup menuselect.makeopts
255 fi
256 if use oss; then
257 menuselect/menuselect --enable chan_oss menuselect.makeopts
258 else
259 menuselect/menuselect --disable chan_oss menuselect.makeopts
260 fi
261 if use postgres; then
262 menuselect/menuselect --enable cdr_pgsql menuselect.makeopts
263 menuselect/menuselect --enable cel_pgsql menuselect.makeopts
264 menuselect/menuselect --enable res_config_pgsql menuselect.makeopts
265 else
266 menuselect/menuselect --disable cdr_pgsql menuselect.makeopts
267 menuselect/menuselect --disable cel_pgsql menuselect.makeopts
268 menuselect/menuselect --disable res_config_pgsql menuselect.makeopts
269 fi
270 if use radius; then
271 menuselect/menuselect --enable cdr_radius menuselect.makeopts
272 menuselect/menuselect --enable cel_radius menuselect.makeopts
273 else
274 menuselect/menuselect --disable cdr_radius menuselect.makeopts
275 menuselect/menuselect --disable cel_radius menuselect.makeopts
276 fi
277 if use snmp; then
278 menuselect/menuselect --enable res_snmp menuselect.makeopts
279 else
280 menuselect/menuselect --disable res_snmp menuselect.makeopts
281 fi
282 if use span; then
283 menuselect/menuselect --enable res_fax_spandsp menuselect.makeopts
284 else
285 menuselect/menuselect --disable res_fax_spandsp menuselect.makeopts
286 fi
287 if use speex; then
288 menuselect/menuselect --enable codec_speex menuselect.makeopts
289 menuselect/menuselect --enable func_speex menuselect.makeopts
290 else
291 menuselect/menuselect --disable codec_speex menuselect.makeopts
292 menuselect/menuselect --disable func_speex menuselect.makeopts
293 fi
294 if use sqlite; then
295 menuselect/menuselect --enable cdr_sqlite menuselect.makeopts
296 else
297 menuselect/menuselect --disable cdr_sqlite menuselect.makeopts
298 fi
299 if use sqlite3; then
300 menuselect/menuselect --enable cdr_sqlite3_custom menuselect.makeopts
301 menuselect/menuselect --enable cel_sqlite3_custom menuselect.makeopts
302 else
303 menuselect/menuselect --disable cdr_sqlite3_custom menuselect.makeopts
304 menuselect/menuselect --disable cel_sqlite3_custom menuselect.makeopts
305 fi
306 if use srtp; then
307 menuselect/menuselect --enable res_srtp menuselect.makeopts
308 else
309 menuselect/menuselect --disable res_srtp menuselect.makeopts
310 fi
311 if use syslog; then
312 menuselect/menuselect --enable cdr_syslog menuselect.makeopts
313 else
314 menuselect/menuselect --disable cdr_syslog menuselect.makeopts
315 fi
316 if use usb; then
317 menuselect/menuselect --enable chan_usbradio menuselect.makeopts
318 else
319 menuselect/menuselect --disable chan_usbradio menuselect.makeopts
320 fi
321 if use vorbis; then
322 menuselect/menuselect --enable format_ogg_vorbis menuselect.makeopts
323 else
324 menuselect/menuselect --disable format_ogg_vorbis menuselect.makeopts
325 fi
326 }
327
328 src_compile() {
329 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
330 }
331
332 src_install() {
333 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
334 emake DESTDIR="${D}" installdirs || die "emake installdirs failed"
335 emake DESTDIR="${D}" install || die "emake installdirs failed"
336
337 if use samples; then
338 emake DESTDIR="${D}" samples || die "emake samples failed"
339 for conffile in "${D}"etc/asterisk/*.*
340 do
341 chown asterisk:asterisk $conffile
342 chmod 0660 $conffile
343 done
344 einfo "Sample files have been installed"
345 else
346 einfo "Skipping installation of sample files..."
347 rm -f "${D}"var/lib/asterisk/mohmp3/*
348 rm -f "${D}"var/lib/asterisk/sounds/demo-*
349 rm -f "${D}"var/lib/asterisk/agi-bin/*
350 rm -f "${D}"etc/asterisk/*
351 fi
352 rm -rf "${D}"var/spool/asterisk/voicemail/default
353
354 # keep directories
355 diropts -m 0770 -o asterisk -g asterisk
356 keepdir /etc/asterisk
357 keepdir /var/lib/asterisk
358 keepdir /var/run/asterisk
359 keepdir /var/spool/asterisk
360 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
361 diropts -m 0750 -o asterisk -g asterisk
362 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
363
364 newinitd "${FILESDIR}"/1.6.2/asterisk.initd3 asterisk
365 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
366
367 # install the upgrade documentation
368 #
369 dodoc README UPGRADE* BUGS CREDITS
370
371 # install extra documentation
372 #
373 if use doc
374 then
375 dodoc doc/*.txt
376 dodoc doc/*.pdf
377 fi
378
379 # install SIP scripts; bug #300832
380 #
381 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
382 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
383 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
384 dodoc "${FILESDIR}/1.6.2/call_data.txt"
385
386 # install logrotate snippet; bug #329281
387 #
388 insinto /etc/logrotate.d
389 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
390 }
391
392 pkg_postinst() {
393 #
394 # Announcements, warnings, reminders...
395 #
396 einfo "Asterisk has been installed"
397 echo
398 elog "If you want to know more about asterisk, visit these sites:"
399 elog "http://www.asteriskdocs.org/"
400 elog "http://www.voip-info.org/wiki-Asterisk"
401 echo
402 elog "http://www.automated.it/guidetoasterisk.htm"
403 echo
404 elog "Gentoo VoIP IRC Channel:"
405 elog "#gentoo-voip @ irc.freenode.net"
406 echo
407 echo
408 elog "1.6 -> 1.8 changes that you may care about:"
409 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
410 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
411 }
412
413 pkg_config() {
414 einfo "Do you want to reset file permissions and ownerships (y/N)?"
415
416 read tmp
417 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
418
419 if [[ "$tmp" = "y" ]] ||\
420 [[ "$tmp" = "yes" ]]
421 then
422 einfo "Resetting permissions to defaults..."
423
424 for x in spool run lib log; do
425 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
426 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
427 done
428
429 chown -R root:asterisk "${ROOT}"etc/asterisk
430 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
431
432 einfo "done"
433 else
434 einfo "skipping"
435 fi
436 }

  ViewVC Help
Powered by ViewVC 1.1.20