/[gentoo-x86]/net-misc/asterisk/asterisk-1.8.1.1-r2.ebuild
Gentoo

Contents of /net-misc/asterisk/asterisk-1.8.1.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jan 19 12:52:32 2011 UTC (9 years, 1 month ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Trim down 1.8 branch by culling vulnerable ebuilds for security bug #352059. Adding 1.8.2.1 which fixes a stack buffer overflow in SIP URI encoding. Patchset unchanged.

(Portage version: 2.1.9.31/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20