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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Mar 16 10:39:56 2012 UTC (2 years, 4 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Security update, fixing a remote DoS (no code execution, AST-2012-002) in app_milliwatt and a stack buffer overflow in the HTTP manager interface (remote code injection, AST-2012-003). As per bug #408431 by Tim Sammut. Actually honour the IAX2 trunk frequency, as per Jaco Kroon in bug #408033. Remove vulnerable ebuilds from tree.

(Portage version: 2.1.10.49/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20