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

Contents of /net-misc/asterisk/asterisk-1.8.19.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jan 2 22:36:18 2013 UTC (7 years ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Security releases on all three branches; stop using stack allocations in TCP receive paths, as multiple packets may be concatenated together and overflow the stack as a result (CVE-2012-5976 / AST-2012-015). Never cache devices that are not associated with a physical entity, as to do so allows a denial of service through cache exhaustion (CVE-2012-5977 / AST-2012-014). Remove all non-stable vulnerable ebuilds. As requested by Sean Amoss in bug #449828.

(Portage version: 2.1.11.38/cvs/Linux x86_64, unsigned Manifest commit)

1 chainsaw 1.1 # Copyright 1999-2012 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.19.0.ebuild,v 1.1 2012/12/13 10:57:06 chainsaw Exp $
4 chainsaw 1.1
5     EAPI=4
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/releases/${MY_P}.tar.gz
13     mirror://gentoo/gentoo-asterisk-patchset-1.16.tar.bz2"
14     LICENSE="GPL-2"
15     SLOT="0"
16     KEYWORDS="~amd64 ~x86"
17    
18     IUSE_VOICEMAIL_STORAGE="
19     +voicemail_storage_file
20     voicemail_storage_odbc
21     voicemail_storage_imap
22     "
23     IUSE="${IUSE_VOICEMAIL_STORAGE} ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius selinux snmp span speex sqlite sqlite3 srtp static syslog vorbis"
24    
25     IUSE_EXPAND="VOICEMAIL_STORAGE"
26    
27     REQUIRED_USE="
28     gtalk? ( jabber )
29     ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
30     voicemail_storage_odbc? ( odbc )
31     "
32    
33     EPATCH_SUFFIX="patch"
34     PATCHES=( "${WORKDIR}/asterisk-patchset" )
35    
36     RDEPEND="dev-libs/popt
37     dev-libs/libxml2
38     dev-libs/openssl
39     sys-libs/ncurses
40     sys-libs/zlib
41     ais? ( sys-cluster/openais )
42     alsa? ( media-libs/alsa-lib )
43     bluetooth? ( net-wireless/bluez )
44     calendar? ( net-libs/neon
45     dev-libs/libical
46     dev-libs/iksemel )
47     caps? ( sys-libs/libcap )
48     curl? ( net-misc/curl )
49     dahdi? ( >=net-libs/libpri-1.4.12_beta2
50     net-misc/dahdi-tools )
51     freetds? ( dev-db/freetds )
52     gtalk? ( dev-libs/iksemel )
53     http? ( dev-libs/gmime:2.4 )
54     iconv? ( virtual/libiconv )
55     jabber? ( dev-libs/iksemel )
56     jingle? ( dev-libs/iksemel )
57     ldap? ( net-nds/openldap )
58     lua? ( dev-lang/lua )
59     mysql? ( virtual/mysql )
60     newt? ( dev-libs/newt )
61     odbc? ( dev-db/unixODBC )
62     osplookup? ( net-libs/osptoolkit )
63     portaudio? ( media-libs/portaudio )
64     postgres? ( dev-db/postgresql-base )
65     radius? ( net-dialup/radiusclient-ng )
66     selinux? ( sec-policy/selinux-asterisk )
67     snmp? ( net-analyzer/net-snmp )
68     span? ( media-libs/spandsp )
69     speex? ( media-libs/speex )
70     sqlite? ( dev-db/sqlite:0 )
71     sqlite3? ( dev-db/sqlite:3 )
72     srtp? ( net-libs/libsrtp )
73     vorbis? ( media-libs/libvorbis )"
74    
75     DEPEND="${RDEPEND}
76     voicemail_storage_imap? ( virtual/imap-c-client )
77     !net-libs/openh323"
78    
79     RDEPEND="${RDEPEND}
80     syslog? ( virtual/logger )"
81    
82     PDEPEND="net-misc/asterisk-core-sounds
83     net-misc/asterisk-extra-sounds
84     net-misc/asterisk-moh-opsound"
85    
86     S="${WORKDIR}/${MY_P}"
87    
88     pkg_setup() {
89     CONFIG_CHECK="~!NF_CONNTRACK_SIP"
90     local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
91     have reported that this module dropped critical SIP packets in their deployments. You
92     may want to disable it if you see such problems."
93     check_extra_config
94    
95     enewgroup asterisk
96     enewgroup dialout 20
97     enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
98     }
99    
100     src_prepare() {
101     base_src_prepare
102     AT_M4DIR=autoconf eautoreconf
103     }
104    
105     src_configure() {
106     local vmst
107    
108     econf \
109     --libdir="/usr/$(get_libdir)" \
110     --localstatedir="/var" \
111     --with-crypto \
112     --with-gsm=internal \
113     --with-popt \
114     --with-ssl \
115     --with-z \
116     --without-pwlib \
117     $(use_with caps cap) \
118     $(use_with http gmime) \
119     $(use_with newt) \
120     $(use_with portaudio)
121    
122     # Blank out sounds/sounds.xml file to prevent
123     # asterisk from installing sounds files (we pull them in via
124     # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
125     >"${S}"/sounds/sounds.xml
126    
127     # Compile menuselect binary for optional components
128     emake menuselect.makeopts
129    
130     # Broken functionality is forcibly disabled (bug #360143)
131     menuselect/menuselect --disable chan_misdn menuselect.makeopts
132     menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
133    
134     # Utility set is forcibly enabled (bug #358001)
135     menuselect/menuselect --enable smsq menuselect.makeopts
136     menuselect/menuselect --enable streamplayer menuselect.makeopts
137     menuselect/menuselect --enable aelparse menuselect.makeopts
138     menuselect/menuselect --enable astman menuselect.makeopts
139    
140     # this is connected, otherwise it would not find
141     # ast_pktccops_gate_alloc symbol
142     menuselect/menuselect --enable chan_mgcp menuselect.makeopts
143     menuselect/menuselect --enable res_pktccops menuselect.makeopts
144    
145     # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
146     menuselect/menuselect --enable pbx_dundi menuselect.makeopts
147     menuselect/menuselect --enable func_aes menuselect.makeopts
148     menuselect/menuselect --enable chan_iax2 menuselect.makeopts
149    
150     # The others are based on USE-flag settings
151     use_select() {
152     local state=$(use "$1" && echo enable || echo disable)
153     shift # remove use from parameters
154    
155     while [[ -n $1 ]]; do
156     menuselect/menuselect --${state} "$1" menuselect.makeopts
157     shift
158     done
159     }
160    
161     use_select ais res_ais
162     use_select alsa chan_alsa
163     use_select bluetooth chan_mobile
164     use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
165     use_select curl func_curl res_config_curl res_curl
166     use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi
167     use_select freetds {cdr,cel}_tds
168     use_select gtalk chan_gtalk
169     use_select http res_http_post
170     use_select iconv func_iconv
171     use_select jabber res_jabber
172     use_select jingle chan_jingle
173     use_select ldap res_config_ldap
174     use_select lua pbx_lua
175     use_select mysql app_mysql cdr_mysql res_config_mysql
176     use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
177     use_select osplookup app_osplookup
178     use_select oss chan_oss
179     use_select postgres {cdr,cel}_pgsql res_config_pgsql
180     use_select radius {cdr,cel}_radius
181     use_select snmp res_snmp
182     use_select span res_fax_spandsp
183     use_select speex {codec,func}_speex
184     use_select sqlite cdr_sqlite
185     use_select sqlite3 {cdr,cel}_sqlite3_custom
186     use_select srtp res_srtp
187     use_select syslog cdr_syslog
188     use_select vorbis format_ogg_vorbis
189    
190     # Voicemail storage ...
191     for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
192     if use ${vmst}; then
193     menuselect/menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
194     fi
195     done
196     }
197    
198     src_compile() {
199     ASTLDFLAGS="${LDFLAGS}" emake
200     }
201    
202     src_install() {
203     mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
204     emake DESTDIR="${D}" installdirs
205     emake DESTDIR="${D}" install
206    
207     if use radius; then
208     insinto /etc/radiusclient-ng/
209     doins contrib/dictionary.digium
210     fi
211     if use samples; then
212     emake DESTDIR="${D}" samples
213     for conffile in "${D}"etc/asterisk/*.*
214     do
215     chown asterisk:asterisk $conffile
216     chmod 0660 $conffile
217     done
218     einfo "Sample files have been installed"
219     else
220     einfo "Skipping installation of sample files..."
221     rm -f "${D}"var/lib/asterisk/mohmp3/* || die
222     rm -f "${D}"var/lib/asterisk/sounds/demo-* || die
223     rm -f "${D}"var/lib/asterisk/agi-bin/* || die
224     rm -f "${D}"etc/asterisk/* || die
225     fi
226     rm -rf "${D}"var/spool/asterisk/voicemail/default || die
227    
228     # keep directories
229     diropts -m 0770 -o asterisk -g asterisk
230     keepdir /etc/asterisk
231     keepdir /var/lib/asterisk
232     keepdir /var/run/asterisk
233     keepdir /var/spool/asterisk
234     keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
235     diropts -m 0750 -o asterisk -g asterisk
236     keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
237    
238     newinitd "${FILESDIR}"/1.8.0/asterisk.initd4 asterisk
239     newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk
240    
241     # install the upgrade documentation
242     #
243     dodoc README UPGRADE* BUGS CREDITS
244    
245     # install extra documentation
246     #
247     if use doc
248     then
249     dodoc doc/*.txt
250     dodoc doc/*.pdf
251     fi
252    
253     # install SIP scripts; bugs #300832 & #414585
254     #
255     dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
256     dodoc "${FILESDIR}/1.8.0/find_call_sip_trace.sh"
257     dodoc "${FILESDIR}/1.8.0/find_call_ids.sh"
258     dodoc "${FILESDIR}/1.6.2/call_data.txt"
259    
260     # install logrotate snippet; bug #329281
261     #
262     insinto /etc/logrotate.d
263     newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
264     }
265    
266     pkg_postinst() {
267     #
268     # Announcements, warnings, reminders...
269     #
270     einfo "Asterisk has been installed"
271     echo
272     elog "If you want to know more about asterisk, visit these sites:"
273     elog "http://www.asteriskdocs.org/"
274     elog "http://www.voip-info.org/wiki-Asterisk"
275     echo
276     elog "http://www.automated.it/guidetoasterisk.htm"
277     echo
278     elog "Gentoo VoIP IRC Channel:"
279     elog "#gentoo-voip @ irc.freenode.net"
280     echo
281     echo
282     elog "1.6 -> 1.8 changes that you may care about:"
283     elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
284     elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
285     }
286    
287     pkg_config() {
288     einfo "Do you want to reset file permissions and ownerships (y/N)?"
289    
290     read tmp
291     tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
292    
293     if [[ "$tmp" = "y" ]] ||\
294     [[ "$tmp" = "yes" ]]
295     then
296     einfo "Resetting permissions to defaults..."
297    
298     for x in spool run lib log; do
299     chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
300     chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
301     done
302    
303     chown -R root:asterisk "${ROOT}"etc/asterisk
304     chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
305    
306     einfo "done"
307     else
308     einfo "skipping"
309     fi
310     }

  ViewVC Help
Powered by ViewVC 1.1.20