1 |
chainsaw 09/11/05 11:21:11 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: asterisk-1.2.36.ebuild asterisk-1.6.1.9.ebuild |
5 |
Removed: asterisk-1.6.1.8-r1.ebuild asterisk-1.6.1.8.ebuild |
6 |
asterisk-1.2.35-r1.ebuild |
7 |
Log: |
8 |
Version bumps as requested by Alex "a3li" Legler in security bug #284892, drop any non-stable vulnerable ebuild. Upstream advisory AST-2009-008. |
9 |
(Portage version: 2.2_rc48/cvs/Linux x86_64) |
10 |
|
11 |
Revision Changes Path |
12 |
1.223 net-misc/asterisk/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.223&view=markup |
15 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.223&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.222&r2=1.223 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v |
21 |
retrieving revision 1.222 |
22 |
retrieving revision 1.223 |
23 |
diff -u -r1.222 -r1.223 |
24 |
--- ChangeLog 28 Oct 2009 12:50:31 -0000 1.222 |
25 |
+++ ChangeLog 5 Nov 2009 11:21:10 -0000 1.223 |
26 |
@@ -1,6 +1,15 @@ |
27 |
# ChangeLog for net-misc/asterisk |
28 |
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.222 2009/10/28 12:50:31 chainsaw Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.223 2009/11/05 11:21:10 chainsaw Exp $ |
31 |
+ |
32 |
+*asterisk-1.6.1.9 (04 Nov 2009) |
33 |
+*asterisk-1.2.36 (04 Nov 2009) |
34 |
+ |
35 |
+ 04 Nov 2009; <chainsaw@g.o> -asterisk-1.2.35-r1.ebuild, |
36 |
+ +asterisk-1.2.36.ebuild, -asterisk-1.6.1.8.ebuild, |
37 |
+ -asterisk-1.6.1.8-r1.ebuild, +asterisk-1.6.1.9.ebuild: |
38 |
+ Version bumps as requested by Alex "a3li" Legler in security bug #284892, |
39 |
+ drop any non-stable vulnerable ebuild. Upstream advisory AST-2009-008. |
40 |
|
41 |
*asterisk-1.6.1.8-r1 (28 Oct 2009) |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
1.1 net-misc/asterisk/asterisk-1.2.36.ebuild |
47 |
|
48 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.36.ebuild?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.36.ebuild?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: asterisk-1.2.36.ebuild |
52 |
=================================================================== |
53 |
# Copyright 1999-2009 Gentoo Foundation |
54 |
# Distributed under the terms of the GNU General Public License v2 |
55 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.36.ebuild,v 1.1 2009/11/05 11:21:10 chainsaw Exp $ |
56 |
|
57 |
EAPI=2 |
58 |
inherit eutils multilib toolchain-funcs |
59 |
|
60 |
IUSE="alsa curl debug doc gtk hardened lowmem mmx nosamples \ |
61 |
odbc osp postgres pri sqlite ssl speex zaptel elibc_uclibc" |
62 |
|
63 |
AST_PATCHES="1.2.27-patches-1.0" |
64 |
|
65 |
MY_P="${P/_p/.}" |
66 |
|
67 |
DESCRIPTION="Asterisk: A Modular Open Source PBX System" |
68 |
HOMEPAGE="http://www.asterisk.org/" |
69 |
SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz |
70 |
mirror://gentoo/${PN}-${AST_PATCHES}.tar.bz2" |
71 |
|
72 |
S="${WORKDIR}/${MY_P}" |
73 |
|
74 |
SLOT="0" |
75 |
LICENSE="GPL-2" |
76 |
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" |
77 |
|
78 |
RDEPEND="dev-libs/newt |
79 |
media-sound/sox |
80 |
ssl? ( dev-libs/openssl ) |
81 |
gtk? ( =x11-libs/gtk+-1.2* ) |
82 |
pri? ( =net-libs/libpri-1.2*[-bri] ) |
83 |
alsa? ( media-libs/alsa-lib ) |
84 |
curl? ( net-misc/curl ) |
85 |
odbc? ( dev-db/unixODBC ) |
86 |
speex? ( media-libs/speex ) |
87 |
sqlite? ( <dev-db/sqlite-3.0.0 ) |
88 |
zaptel? ( >=net-misc/zaptel-1.2.16 ) |
89 |
postgres? ( virtual/postgresql-base ) |
90 |
osp? ( >=net-libs/osptoolkit-3.3.4 )" |
91 |
|
92 |
DEPEND="${RDEPEND} |
93 |
sys-devel/flex |
94 |
sys-devel/bison |
95 |
doc? ( app-doc/doxygen ) |
96 |
virtual/logger" |
97 |
|
98 |
#asterisk uses special mpg123 functions and does not work with mpeg321, bug #42703 |
99 |
PDEPEND="|| ( media-sound/mpg123 net-misc/asterisk-addons )" |
100 |
|
101 |
QA_TEXTRELS_x86="usr/lib/asterisk/modules/codec_gsm.so" |
102 |
QA_EXECSTACK_x86="usr/lib/asterisk/modules/codec_gsm.so" |
103 |
|
104 |
# |
105 |
# List of modules to ignore during scan (because they have been removed in 1.2.x) |
106 |
# |
107 |
SCAN_IGNORE_MODS=" |
108 |
app_qcall |
109 |
chan_modem |
110 |
chan_modem_i4l |
111 |
chan_modem_bestdata |
112 |
chan_modme_aopen" |
113 |
|
114 |
# |
115 |
# shortcuts |
116 |
# |
117 |
is_ast10update() { |
118 |
return $(has_version "=net-misc/asterisk-1.0*") |
119 |
} |
120 |
|
121 |
is_astupdate() { |
122 |
if ! is_ast10update; then |
123 |
return $(has_version "<net-misc/asterisk-${PV}") |
124 |
fi |
125 |
return 0 |
126 |
} |
127 |
|
128 |
# |
129 |
# Scan for asterisk-1.0.x modules that will have to be updated |
130 |
# |
131 |
scan_modules() { |
132 |
local modules_list="" |
133 |
local n |
134 |
|
135 |
for x in $(ls -1 "${ROOT}"usr/$(get_libdir)/asterisk/modules/*.so); do |
136 |
echo -en "Scanning.... $(basename ${x}) \r" |
137 |
|
138 |
# skip blacklisted modules |
139 |
hasq $(basename ${x//.so}) ${SCAN_IGNORE_MODS} && continue |
140 |
|
141 |
if $(readelf -s "${x}" | grep -q "\(ast_load\|ast_destroy\)$"); then |
142 |
modules_list="${modules_list} $(basename ${x//.so})" |
143 |
fi |
144 |
done |
145 |
|
146 |
if [[ -n "${modules_list}" ]]; then |
147 |
echo " ========================================================" |
148 |
ewarn "Please update or unmerge the following modules:" |
149 |
echo |
150 |
|
151 |
n=0 |
152 |
for x in ${modules_list}; do |
153 |
ewarn " - ${x}" |
154 |
(( n++ )) |
155 |
done |
156 |
|
157 |
echo |
158 |
ewarn "Warning: $n outdated module(s) found!" |
159 |
ewarn "Warning: asterisk may not work if you don't update them!" |
160 |
echo " ========================================================" |
161 |
echo |
162 |
einfo "You can use the \"asterisk-updater\" script to update the modules" |
163 |
epause |
164 |
echo |
165 |
return 1 |
166 |
else |
167 |
einfo "No asterisk-1.0.x modules found!" |
168 |
return 0 |
169 |
fi |
170 |
} |
171 |
|
172 |
pkg_setup() { |
173 |
local checkfailed=0 waitaftermsg=0 |
174 |
|
175 |
if is_ast10update; then |
176 |
ewarn " Asterisk UPGRADE Warning" |
177 |
ewarn "" |
178 |
ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz after the installation!" |
179 |
ewarn "" |
180 |
ewarn " Asterisk UPGRADE Warning" |
181 |
echo |
182 |
waitaftermsg=1 |
183 |
fi |
184 |
|
185 |
# |
186 |
# Regular checks |
187 |
# |
188 |
einfo "Running some pre-flight checks..." |
189 |
echo |
190 |
|
191 |
} |
192 |
|
193 |
src_prepare() { |
194 |
# |
195 |
# gentoo patchset |
196 |
# |
197 |
for x in $(grep -v "^#\| \+" "${WORKDIR}"/patches/patches.list); do |
198 |
epatch "${WORKDIR}"/patches/${x} |
199 |
done |
200 |
|
201 |
if use mmx; then |
202 |
if ! use hardened; then |
203 |
einfo "Enabling mmx optimization" |
204 |
sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \ |
205 |
Makefile |
206 |
else |
207 |
ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!" |
208 |
fi |
209 |
fi |
210 |
|
211 |
if ! use debug; then |
212 |
einfo "Disabling debug support" |
213 |
sed -i -e "s:^\(DEBUG=\):#\1:" \ |
214 |
Makefile |
215 |
fi |
216 |
|
217 |
if ! use ssl; then |
218 |
einfo "Disabling crypto support" |
219 |
sed -i -e 's:^#\(NOCRYPTO=yes\):\1:' \ |
220 |
-e '/^LIBS+=-lssl/d' Makefile || die |
221 |
fi |
222 |
|
223 |
epatch "${FILESDIR}/1.2.0/${PN}-1.2.35-lpc10-prototypes.diff" |
224 |
|
225 |
# |
226 |
# uclibc patch |
227 |
# |
228 |
if use elibc_uclibc; then |
229 |
einfo "Patching asterisk for uclibc..." |
230 |
epatch "${FILESDIR}"/1.0.0/${PN}-1.0.5-uclibc-dns.diff |
231 |
epatch "${FILESDIR}"/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff |
232 |
fi |
233 |
|
234 |
# |
235 |
# Disable AEL, security bug #171884 |
236 |
# Re-enable at your own risk (no USE since it can be critical) |
237 |
# |
238 |
sed -i -e 's/pbx_ael.so//' pbx/Makefile || die |
239 |
|
240 |
# codecs/Makefile does not add -lspeexdsp needed for speex 1.2, bug #206463 |
241 |
if use speex && has_version ">=media-libs/speex-1.2"; then |
242 |
sed -i -e "s/-lspeex/-lspeex -lspeexdsp/" codecs/Makefile \ |
243 |
|| die "patching codecs/Makefile failed" |
244 |
fi |
245 |
} |
246 |
|
247 |
src_compile() { |
248 |
local myopts |
249 |
|
250 |
use lowmem && \ |
251 |
myopts="-DLOW_MEMORY" |
252 |
|
253 |
einfo "Building Asterisk..." |
254 |
if use debug; then |
255 |
unset CFLAGS |
256 |
make \ |
257 |
CC=$(tc-getCC) \ |
258 |
NOTRACE=1 \ |
259 |
PWLIBDIR=/usr/share/pwlib \ |
260 |
OPTIONS="${myopts}" \ |
261 |
dont-optimize=1 || die "Make failed" |
262 |
else |
263 |
make \ |
264 |
CC=$(tc-getCC) \ |
265 |
NOTRACE=1 \ |
266 |
OPTIMIZE="${CFLAGS}" \ |
267 |
PWLIBDIR=/usr/share/pwlib \ |
268 |
OPTIONS="${myopts}" || die "Make failed" |
269 |
fi |
270 |
|
271 |
# create api docs |
272 |
use doc && \ |
273 |
make progdocs |
274 |
} |
275 |
|
276 |
src_install() { |
277 |
|
278 |
# install asterisk |
279 |
make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" install || die "Make install failed" |
280 |
make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" samples || die "Failed to create sample files" |
281 |
|
282 |
# remove installed sample files if nosamples flag is set |
283 |
if use nosamples; then |
284 |
einfo "Skipping installation of sample files..." |
285 |
rm -rf "${D}"var/spool/asterisk/voicemail/default |
286 |
rm -f "${D}"var/lib/asterisk/mohmp3/* |
287 |
rm -f "${D}"var/lib/asterisk/sounds/demo-* |
288 |
rm -f "${D}"var/lib/asterisk/agi-bin/* |
289 |
else |
290 |
einfo "Sample files have been installed" |
291 |
keepdir /var/spool/asterisk/voicemail/default/1234/INBOX |
292 |
fi |
293 |
|
294 |
# move sample configuration files to doc directory |
295 |
if is_ast10update; then |
296 |
elog "Updating from old (pre-1.2) asterisk version, new configuration files have been installed" |
297 |
elog "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them" |
298 |
elif has_version "net-misc/asterisk"; then |
299 |
elog "Configuration samples have been moved to: $ROOT/usr/share/doc/${PF}/conf" |
300 |
insinto /usr/share/doc/${PF}/conf |
301 |
doins "${D}"etc/asterisk/*.conf* |
302 |
rm -f "${D}"etc/asterisk/*.conf* 2>/dev/null |
303 |
fi |
304 |
|
305 |
# don't delete these directories, even if they are empty |
306 |
for x in voicemail meetme system dictate monitor tmp; do |
307 |
keepdir /var/spool/asterisk/${x} |
308 |
done |
309 |
keepdir /var/lib/asterisk/sounds/priv-callerintros |
310 |
keepdir /var/lib/asterisk/mohmp3 |
311 |
keepdir /var/lib/asterisk/agi-bin |
312 |
keepdir /var/log/asterisk/cdr-csv |
313 |
keepdir /var/log/asterisk/cdr-custom |
314 |
keepdir /var/run/asterisk |
315 |
|
316 |
# install astxs |
317 |
dobin contrib/scripts/astxs |
318 |
|
319 |
newinitd "${FILESDIR}"/1.2.0/asterisk.rc6 asterisk |
320 |
newconfd "${FILESDIR}"/1.2.0/asterisk.confd asterisk |
321 |
|
322 |
# install standard docs... |
323 |
dodoc BUGS CREDITS ChangeLog HARDWARE README |
324 |
dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt |
325 |
dodoc doc/README.* |
326 |
dodoc doc/*.txt |
327 |
|
328 |
docinto scripts |
329 |
dodoc contrib/scripts/* |
330 |
|
331 |
docinto utils |
332 |
dodoc contrib/utils/* |
333 |
|
334 |
docinto configs |
335 |
dodoc configs/* |
336 |
|
337 |
# install api docs |
338 |
if use doc; then |
339 |
insinto /usr/share/doc/${PF}/api/html |
340 |
doins doc/api/html/* |
341 |
fi |
342 |
|
343 |
insinto /usr/share/doc/${PF}/cgi |
344 |
doins contrib/scripts/vmail.cgi |
345 |
doins images/*.gif |
346 |
|
347 |
# install asterisk-updater |
348 |
dosbin "${FILESDIR}"/1.2.0/asterisk-updater |
349 |
|
350 |
# install asterisk.h, a lot of external modules need this |
351 |
insinto /usr/include/asterisk |
352 |
doins include/asterisk.h |
353 |
|
354 |
# make sure misdn/capi stuff is not installed, provided by asterisk-chan_.. |
355 |
rm -f "${D}"/etc/asterisk/misdn.conf "${D}"/usr/lib/asterisk/modules/chan_misdn.so \ |
356 |
"${D}"/usr/share/doc/${PF}/{conf/misdn.conf,configs/misdn.conf.sample.gz,README.misdn.gz} |
357 |
rm -f "${D}"/usr/include/asterisk/chan_capi{,_app}.h \ |
358 |
"${D}"/usr/share/doc/${PF}/{conf/capi.conf,configs/capi.conf.sample.gz} |
359 |
|
360 |
# make sure the broken speex support does not keep Asterisk from starting up |
361 |
# bug #206463 if you care about this. solution needs to work with --as-needed |
362 |
rm -f "${D}"usr/$(get_libdir)/asterisk/modules/codec_speex.so || die "Unable to remove fatally flawed codec_speex.so" |
363 |
} |
364 |
|
365 |
pkg_preinst() { |
366 |
enewgroup asterisk |
367 |
enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout" |
368 |
} |
369 |
|
370 |
pkg_postinst() { |
371 |
einfo "Fixing permissions" |
372 |
chown -R asterisk:asterisk "${ROOT}"var/log/asterisk |
373 |
chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk |
374 |
|
375 |
for x in lib run spool; do |
376 |
chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk |
377 |
chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk |
378 |
done |
379 |
|
380 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/ |
381 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi |
382 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael |
383 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/ |
384 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi |
385 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael |
386 |
echo |
387 |
|
388 |
# |
389 |
# Announcements, warnings, reminders... |
390 |
# |
391 |
einfo "Asterisk has been installed" |
392 |
einfo "" |
393 |
elog "If you want to know more about asterisk, visit these sites:" |
394 |
elog "http://www.asteriskdocs.org/" |
395 |
elog "http://www.voip-info.org/wiki-Asterisk" |
396 |
elog |
397 |
elog "http://www.automated.it/guidetoasterisk.htm" |
398 |
elog |
399 |
elog "Gentoo VoIP IRC Channel:" |
400 |
elog "#gentoo-voip @ irc.freenode.net" |
401 |
elog |
402 |
elog "Please note that AEL is no longer built because of security bugs" |
403 |
elog "See http://bugs.gentoo.org/show_bug.cgi?id=171884" |
404 |
elog |
405 |
echo |
406 |
echo |
407 |
|
408 |
# |
409 |
# Warning about 1.0 -> 1.2 changes... |
410 |
# |
411 |
if is_ast10update; then |
412 |
ewarn "" |
413 |
ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz before continuing" |
414 |
ewarn "" |
415 |
fi |
416 |
|
417 |
if is_astupdate; then |
418 |
ewarn "" |
419 |
ewarn " - The initgroups patch has been dropped, please update your" |
420 |
ewarn " \"conf.d/asterisk\" and \"init.d/asterisk\" file!" |
421 |
ewarn "" |
422 |
fi |
423 |
|
424 |
# scan for old modules |
425 |
if is_ast10update; then |
426 |
einfo "Asterisk has been updated from pre-1.2.x, scanning for old modules" |
427 |
scan_modules |
428 |
fi |
429 |
} |
430 |
|
431 |
pkg_config() { |
432 |
einfo "Do you want to reset file permissions and ownerships (y/N)?" |
433 |
|
434 |
read tmp |
435 |
tmp="$(echo $tmp | tr [:upper:] [:lower:])" |
436 |
|
437 |
if [[ "$tmp" = "y" ]] ||\ |
438 |
[[ "$tmp" = "yes" ]] |
439 |
then |
440 |
einfo "Resetting permissions to defaults..." |
441 |
|
442 |
for x in spool run lib log; do |
443 |
chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk |
444 |
chmod -R u=rwX,g=rX,o= "${ROOT}"var/${x}/asterisk |
445 |
done |
446 |
|
447 |
chown -R root:asterisk "${ROOT}"etc/asterisk |
448 |
chmod -R u=rwX,g=rX,o= "${ROOT}"etc/asterisk |
449 |
|
450 |
einfo "done" |
451 |
else |
452 |
einfo "skipping" |
453 |
fi |
454 |
} |
455 |
|
456 |
|
457 |
|
458 |
1.1 net-misc/asterisk/asterisk-1.6.1.9.ebuild |
459 |
|
460 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.9.ebuild?rev=1.1&view=markup |
461 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.9.ebuild?rev=1.1&content-type=text/plain |
462 |
|
463 |
Index: asterisk-1.6.1.9.ebuild |
464 |
=================================================================== |
465 |
# Copyright 1999-2009 Gentoo Foundation |
466 |
# Distributed under the terms of the GNU General Public License v2 |
467 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.9.ebuild,v 1.1 2009/11/05 11:21:10 chainsaw Exp $ |
468 |
|
469 |
EAPI=1 |
470 |
inherit eutils autotools |
471 |
|
472 |
MY_P="${PN}-${PV/_/-}" |
473 |
|
474 |
DESCRIPTION="Asterisk: A Modular Open Source PBX System" |
475 |
HOMEPAGE="http://www.asterisk.org/" |
476 |
SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz" |
477 |
LICENSE="GPL-2" |
478 |
SLOT="0" |
479 |
KEYWORDS="~amd64 ~x86" |
480 |
|
481 |
IUSE="alsa +caps curl dahdi debug freetds iconv jabber ldap keepsrc misdn newt nosamples odbc oss postgres radius snmp span speex ssl sqlite static vorbis" |
482 |
|
483 |
RDEPEND="sys-libs/ncurses |
484 |
dev-libs/popt |
485 |
sys-libs/zlib |
486 |
alsa? ( media-libs/alsa-lib ) |
487 |
caps? ( sys-libs/libcap ) |
488 |
curl? ( net-misc/curl ) |
489 |
dahdi? ( >=net-libs/libpri-1.4.7 |
490 |
net-misc/dahdi-tools ) |
491 |
freetds? ( dev-db/freetds ) |
492 |
iconv? ( virtual/libiconv ) |
493 |
jabber? ( dev-libs/iksemel ) |
494 |
ldap? ( net-nds/openldap ) |
495 |
misdn? ( net-dialup/misdnuser ) |
496 |
newt? ( dev-libs/newt ) |
497 |
odbc? ( dev-db/unixODBC ) |
498 |
postgres? ( virtual/postgresql-base ) |
499 |
radius? ( net-dialup/radiusclient-ng ) |
500 |
snmp? ( net-analyzer/net-snmp ) |
501 |
span? ( media-libs/spandsp ) |
502 |
speex? ( media-libs/speex ) |
503 |
sqlite? ( dev-db/sqlite ) |
504 |
ssl? ( dev-libs/openssl ) |
505 |
vorbis? ( media-libs/libvorbis )" |
506 |
|
507 |
DEPEND="${RDEPEND} |
508 |
!<net-misc/asterisk-addons-1.6 |
509 |
!net-misc/zaptel" |
510 |
|
511 |
S="${WORKDIR}/${MY_P}" |
512 |
|
513 |
# |
514 |
# shortcuts |
515 |
# |
516 |
|
517 |
# update from asterisk-1.0.x |
518 |
is_ast10update() { |
519 |
return $(has_version "=net-misc/asterisk-1.0*") |
520 |
} |
521 |
|
522 |
# update from asterisk-1.2.x |
523 |
is_ast12update() { |
524 |
return $(has_version "=net-misc/asterisk-1.2*") |
525 |
} |
526 |
|
527 |
# update from asterisk 1.4.x |
528 |
is_ast14update() { |
529 |
return $(has_version "=net-misc/asterisk-1.4*") |
530 |
} |
531 |
|
532 |
# update in the asterisk-1.6.x line |
533 |
is_astupdate() { |
534 |
if ! is_ast10update && ! is_ast12update && !is_ast14update; then |
535 |
return $(has_version "<net-misc/asterisk-${PV}") |
536 |
fi |
537 |
return 0 |
538 |
} |
539 |
|
540 |
get_available_modules() { |
541 |
local modules mod x |
542 |
|
543 |
# build list of available modules... |
544 |
for x in app cdr codec format func pbx res; do |
545 |
|
546 |
for mod in $(find "${S}" -type f -name "${x}_*.c*" -print) |
547 |
do |
548 |
modules="${modules} $(basename ${mod/%.c*})" |
549 |
done |
550 |
done |
551 |
|
552 |
echo "${modules}" |
553 |
} |
554 |
|
555 |
pkg_setup() { |
556 |
local checkfailed=0 waitaftermsg=0 |
557 |
|
558 |
if is_ast12update ; then |
559 |
ewarn "Please note that the configuration style (particularly the dial plan) has changed significantly." |
560 |
ewarn "sip.conf: insecure=very -> insecure=port,invite" |
561 |
ewarn "asterisk.conf: please familiarise yourself with [compat]" |
562 |
ewarn "extensions.conf: use comma instead of pipe as a separator" |
563 |
ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!" |
564 |
echo |
565 |
waitaftermsg=1 |
566 |
fi |
567 |
|
568 |
if [[ $waitaftermsg -eq 1 ]]; then |
569 |
einfo "Press Ctrl+C to abort" |
570 |
echo |
571 |
ebeep 10 |
572 |
fi |
573 |
|
574 |
# |
575 |
# Regular checks |
576 |
# |
577 |
einfo "Running some pre-flight checks..." |
578 |
echo |
579 |
|
580 |
if [[ -n "${ASTERISK_MODULES}" ]] ; then |
581 |
ewarn "You are overriding ASTERISK_MODULES. We will assume you know what you are doing. There is no support for this option, try without if you see breakage." |
582 |
fi |
583 |
} |
584 |
|
585 |
src_unpack() { |
586 |
unpack ${A} |
587 |
cd "${S}" |
588 |
|
589 |
# |
590 |
# put pid file(s) into /var/run/asterisk |
591 |
# |
592 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-var_rundir.patch || die "patch failed" |
593 |
|
594 |
# |
595 |
# fix gsm codec cflags (e.g. i586 core epias) and disable |
596 |
# assembler optimizations |
597 |
# |
598 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed" |
599 |
|
600 |
# |
601 |
# add missing LIBS for uclibc |
602 |
# |
603 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed" |
604 |
|
605 |
# |
606 |
# compensate for non-standard LUA header paths in Gentoo |
607 |
# |
608 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-lua-includes.patch || die "patch failed" |
609 |
|
610 |
# |
611 |
# make sure FXO ports are usable immediately, without requiring an inbound call first |
612 |
# https://issues.asterisk.org/view.php?id=14577 |
613 |
# |
614 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-fxsks-hookstate.patch || die "patch failed" |
615 |
|
616 |
# |
617 |
# avoid segmentation fault when transferring a queue call |
618 |
# https://issues.asterisk.org/view.php?id=15848 |
619 |
# |
620 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-transfer-segfault.patch || die "patch failed" |
621 |
|
622 |
# |
623 |
# do not ignore alarm-cleared event while V23 caller ID detection is in progress |
624 |
# otherwise automated British Telecom line test causes permanent red alarm |
625 |
# https://issues.asterisk.org/view.php?id=14163 |
626 |
# |
627 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-bt-line-test.patch || die "patch failed" |
628 |
|
629 |
# |
630 |
# SIP invites without a session-expires header end up with an expiry time of -1 seconds |
631 |
# causing immediate hangup. |
632 |
# https://issues.asterisk.org/view.php?id=15621 |
633 |
# |
634 |
epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.8-session_expiry.patch || die "patch failed" |
635 |
|
636 |
AT_M4DIR=autoconf eautoreconf |
637 |
|
638 |
# parse modules list |
639 |
if [[ -n "${ASTERISK_MODULES}" ]]; then |
640 |
local x modules="$(get_available_modules)" |
641 |
|
642 |
einfo "Custom list of modules specified, checking..." |
643 |
|
644 |
use debug && { |
645 |
einfo "Available modules: ${modules}" |
646 |
einfo " Selected modules: ${ASTERISK_MODULES}" |
647 |
} |
648 |
|
649 |
for x in ${ASTERISK_MODULES}; do |
650 |
if [[ "${x}" = "-*" ]]; then |
651 |
MODULES_LIST="" |
652 |
else |
653 |
if has ${x} ${modules} |
654 |
then |
655 |
MODULES_LIST="${MODULES_LIST} ${x}" |
656 |
else |
657 |
eerror "Unknown module: ${x}" |
658 |
fi |
659 |
fi |
660 |
done |
661 |
|
662 |
export MODULES_LIST |
663 |
fi |
664 |
} |
665 |
|
666 |
src_compile() { |
667 |
# |
668 |
# start with configure |
669 |
# |
670 |
econf \ |
671 |
--libdir="/usr/$(get_libdir)" \ |
672 |
--localstatedir="/var" \ |
673 |
--with-gsm=internal \ |
674 |
--with-popt \ |
675 |
--with-z \ |
676 |
$(use_with alsa asound) \ |
677 |
$(use_with caps cap) \ |
678 |
$(use_with curl) \ |
679 |
$(use_with dahdi pri) \ |
680 |
$(use_with dahdi tonezone) \ |
681 |
$(use_with dahdi) \ |
682 |
$(use_with freetds tds) \ |
683 |
$(use_with iconv) \ |
684 |
$(use_with jabber iksemel) \ |
685 |
$(use_with misdn isdnnet) \ |
686 |
$(use_with misdn suppserv) \ |
687 |
$(use_with misdn) \ |
688 |
$(use_with newt) \ |
689 |
$(use_with odbc) \ |
690 |
$(use_with oss) \ |
691 |
$(use_with postgres) \ |
692 |
$(use_with radius) \ |
693 |
$(use_with snmp netsnmp) \ |
694 |
$(use_with span spandsp) \ |
695 |
$(use_with speex) \ |
696 |
$(use_with speex speexdsp) \ |
697 |
$(use_with sqlite sqlite3) \ |
698 |
$(use_with ssl crypto) \ |
699 |
$(use_with ssl) \ |
700 |
$(use_with vorbis ogg) \ |
701 |
$(use_with vorbis) || die "econf failed" |
702 |
|
703 |
# |
704 |
# custom module filter |
705 |
# run menuselect to evaluate the list of modules |
706 |
# and rewrite the list afterwards |
707 |
# |
708 |
if [[ -n "${MODULES_LIST}" ]] |
709 |
then |
710 |
local mod category tmp_list failed_list |
711 |
|
712 |
### |
713 |
# run menuselect |
714 |
|
715 |
emake menuselect.makeopts || die "emake menuselect.makeopts failed" |
716 |
|
717 |
### |
718 |
# get list of modules with failed dependencies |
719 |
|
720 |
failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)" |
721 |
|
722 |
### |
723 |
# traverse our list of modules |
724 |
|
725 |
for category in app cdr codec format func pbx res; do |
726 |
tmp_list="" |
727 |
|
728 |
# search list of modules for matching ones first... |
729 |
for mod in ${MODULES_LIST}; do |
730 |
# module is from current category? |
731 |
if [[ "${mod/%_*}" = "${category}" ]] |
732 |
then |
733 |
# check menuselect thinks the dependencies are met |
734 |
if has ${mod} ${failed_list} |
735 |
then |
736 |
eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!" |
737 |
else |
738 |
tmp_list="${tmp_list} ${mod}" |
739 |
fi |
740 |
fi |
741 |
done |
742 |
|
743 |
use debug && echo "${category} tmp: ${tmp_list}" |
744 |
|
745 |
# replace the module list for $category with our custom one |
746 |
if [[ -n "${tmp_list}" ]] |
747 |
then |
748 |
category="$(echo ${category} | tr '[:lower:]' '[:upper:]')" |
749 |
sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \ |
750 |
menuselect.makeopts || die "failed to set list of ${category} applications" |
751 |
fi |
752 |
done |
753 |
fi |
754 |
|
755 |
emake || die "emake failed" |
756 |
} |
757 |
|
758 |
src_install() { |
759 |
# setup directory structure |
760 |
# |
761 |
mkdir -p "${D}"usr/lib/pkgconfig |
762 |
|
763 |
emake DESTDIR="${D}" install || die "emake install failed" |
764 |
emake DESTDIR="${D}" samples || die "emake samples failed" |
765 |
|
766 |
# remove installed sample files if nosamples flag is set |
767 |
if use nosamples; then |
768 |
einfo "Skipping installation of sample files..." |
769 |
rm -f "${D}"var/lib/asterisk/mohmp3/* |
770 |
rm -f "${D}"var/lib/asterisk/sounds/demo-* |
771 |
rm -f "${D}"var/lib/asterisk/agi-bin/* |
772 |
else |
773 |
einfo "Sample files have been installed" |
774 |
fi |
775 |
rm -rf "${D}"var/spool/asterisk/voicemail/default |
776 |
|
777 |
# move sample configuration files to doc directory |
778 |
if is_ast10update || is_ast12update || is_ast14update; then |
779 |
einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed" |
780 |
einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them" |
781 |
fi |
782 |
|
783 |
einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf" |
784 |
insinto /usr/share/doc/${PF}/conf |
785 |
doins "${D}"etc/asterisk/*.conf* |
786 |
|
787 |
# keep directories |
788 |
diropts -m 0770 -o asterisk -g asterisk |
789 |
keepdir /etc/asterisk |
790 |
keepdir /var/lib/asterisk |
791 |
keepdir /var/run/asterisk |
792 |
keepdir /var/spool/asterisk |
793 |
keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail} |
794 |
diropts -m 0750 -o asterisk -g asterisk |
795 |
keepdir /var/log/asterisk/{cdr-csv,cdr-custom} |
796 |
|
797 |
newinitd "${FILESDIR}"/1.6.1/asterisk.initd asterisk |
798 |
newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk |
799 |
|
800 |
# some people like to keep the sources around for custom patching |
801 |
# copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there |
802 |
if use keepsrc |
803 |
then |
804 |
einfo "keepsrc useflag enabled, copying source..." |
805 |
dodir /usr/src |
806 |
|
807 |
cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed" |
808 |
|
809 |
ebegin "running make clean..." |
810 |
emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed" |
811 |
eend $? |
812 |
|
813 |
einfo "Source files have been saved to "${ROOT}"usr/src/${PF}" |
814 |
fi |
815 |
|
816 |
# install the upgrade documentation |
817 |
# |
818 |
dodoc README UPGRADE* BUGS CREDITS |
819 |
|
820 |
# install snmp mib files |
821 |
# |
822 |
if use snmp |
823 |
then |
824 |
insinto /usr/share/snmp/mibs/ |
825 |
doins doc/digium-mib.txt doc/asterisk-mib.txt |
826 |
fi |
827 |
} |
828 |
|
829 |
pkg_preinst() { |
830 |
enewgroup asterisk |
831 |
enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout" |
832 |
} |
833 |
|
834 |
pkg_postinst() { |
835 |
ebegin "Fixing up permissions" |
836 |
chown -R asterisk:asterisk "${ROOT}"var/log/asterisk |
837 |
chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk |
838 |
|
839 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/ |
840 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi |
841 |
chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael |
842 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/ |
843 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi |
844 |
chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael |
845 |
eend $? |
846 |
|
847 |
# |
848 |
# Announcements, warnings, reminders... |
849 |
# |
850 |
einfo "Asterisk has been installed" |
851 |
echo |
852 |
elog "If you want to know more about asterisk, visit these sites:" |
853 |
elog "http://www.asteriskdocs.org/" |
854 |
elog "http://www.voip-info.org/wiki-Asterisk" |
855 |
echo |
856 |
elog "http://www.automated.it/guidetoasterisk.htm" |
857 |
echo |
858 |
elog "Gentoo VoIP IRC Channel:" |
859 |
elog "#gentoo-voip @ irc.freenode.net" |
860 |
echo |
861 |
echo |
862 |
|
863 |
# |
864 |
# Warning about 1.x -> 1.6 changes... |
865 |
# |
866 |
if is_ast10update || is_ast12update || is_ast14update; then |
867 |
ewarn "" |
868 |
ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing" |
869 |
ewarn "" |
870 |
fi |
871 |
} |
872 |
|
873 |
pkg_config() { |
874 |
einfo "Do you want to reset file permissions and ownerships (y/N)?" |
875 |
|
876 |
read tmp |
877 |
tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')" |
878 |
|
879 |
if [[ "$tmp" = "y" ]] ||\ |
880 |
[[ "$tmp" = "yes" ]] |
881 |
then |
882 |
einfo "Resetting permissions to defaults..." |
883 |
|
884 |
for x in spool run lib log; do |
885 |
chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk |
886 |
chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk |
887 |
done |
888 |
|
889 |
chown -R root:asterisk "${ROOT}"etc/asterisk |
890 |
chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk |
891 |
|
892 |
einfo "done" |
893 |
else |
894 |
einfo "skipping" |
895 |
fi |
896 |
} |