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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Mar 11 09:05:12 2014 UTC (5 years, 8 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
New releases in all three branches to address a stack overflow in HTTP cookie header processing, a file descriptor exhaustion through session timers in chan_sip and two remote crashes in PJSIP (12 branch only). Removed all vulnerable non-stable ebuilds. Upstream vulnerability reports AST-2014-001, 002, 003 & 004.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A)

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

  ViewVC Help
Powered by ViewVC 1.1.20