Gentoo Archives: gentoo-commits

From: "Tony Vroon (chainsaw)" <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/asterisk: ChangeLog asterisk-1.2.32.ebuild
Date: Fri, 03 Apr 2009 15:03:29
Message-Id: E1LpkvW-0000s9-1s@stork.gentoo.org
1 chainsaw 09/04/03 15:03:26
2
3 Modified: ChangeLog
4 Added: asterisk-1.2.32.ebuild
5 Log:
6 Version bump for security bug #237476. BRIstuff, which already seemed fragile to me just plain broke this time. Unless you include a patch to make it work, or link to something newer then 0.3.0-PRE-1y-w, a bug report will not be accepted.
7 (Portage version: 2.1.6.11/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.194 net-misc/asterisk/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.194&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.194&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.193&r2=1.194
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
19 retrieving revision 1.193
20 retrieving revision 1.194
21 diff -u -r1.193 -r1.194
22 --- ChangeLog 2 Apr 2009 11:28:22 -0000 1.193
23 +++ ChangeLog 3 Apr 2009 15:03:25 -0000 1.194
24 @@ -1,6 +1,16 @@
25 # ChangeLog for net-misc/asterisk
26 # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.193 2009/04/02 11:28:22 chainsaw Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.194 2009/04/03 15:03:25 chainsaw Exp $
29 +
30 +*asterisk-1.2.32 (03 Apr 2009)
31 +
32 + 03 Apr 2009; <chainsaw@g.o>
33 + +files/1.2.0/asterisk-1.2.32-comma-is-not-pipe.diff,
34 + +files/1.2.0/asterisk-1.2.32-svn89254.diff, +asterisk-1.2.32.ebuild:
35 + Version bump for security bug #237476. BRIstuff, which already seemed
36 + fragile to me just plain broke this time. Unless you include a patch to
37 + make it work, or link to something newer then 0.3.0-PRE-1y-w, a bug report
38 + will not be accepted.
39
40 *asterisk-1.6.0.7 (02 Apr 2009)
41
42
43
44
45 1.1 net-misc/asterisk/asterisk-1.2.32.ebuild
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.32.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.32.ebuild?rev=1.1&content-type=text/plain
49
50 Index: asterisk-1.2.32.ebuild
51 ===================================================================
52 # Copyright 1999-2009 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.32.ebuild,v 1.1 2009/04/03 15:03:25 chainsaw Exp $
55
56 EAPI=2
57 inherit eutils multilib toolchain-funcs
58
59 IUSE="alsa curl debug doc gtk h323 hardened lowmem mmx nosamples \
60 odbc osp postgres pri sqlite ssl speex zaptel elibc_uclibc"
61
62 AST_PATCHES="1.2.27-patches-1.0"
63
64 MY_P="${P/_p/.}"
65
66 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
67 HOMEPAGE="http://www.asterisk.org/"
68 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz
69 mirror://gentoo/${PN}-${AST_PATCHES}.tar.bz2"
70
71 S="${WORKDIR}/${MY_P}"
72
73 SLOT="0"
74 LICENSE="GPL-2"
75 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
76
77 RDEPEND="dev-libs/newt
78 media-sound/sox
79 ssl? ( dev-libs/openssl )
80 gtk? ( =x11-libs/gtk+-1.2* )
81 pri? ( >=net-libs/libpri-1.2.5[-bri] )
82 h323? ( >=dev-libs/pwlib-1.8.3
83 >=net-libs/openh323-1.15.0 )
84 alsa? ( media-libs/alsa-lib )
85 curl? ( net-misc/curl )
86 odbc? ( dev-db/unixODBC )
87 speex? ( media-libs/speex )
88 sqlite? ( <dev-db/sqlite-3.0.0 )
89 zaptel? ( >=net-misc/zaptel-1.2.16 )
90 postgres? ( virtual/postgresql-base )
91 osp? ( >=net-libs/osptoolkit-3.3.4 )"
92
93 DEPEND="${RDEPEND}
94 sys-devel/flex
95 sys-devel/bison
96 doc? ( app-doc/doxygen )
97 virtual/logger"
98
99 #asterisk uses special mpg123 functions and does not work with mpeg321, bug #42703
100 PDEPEND="|| ( media-sound/mpg123 net-misc/asterisk-addons )"
101
102 QA_TEXTRELS_x86="usr/lib/asterisk/modules/codec_gsm.so"
103 QA_EXECSTACK_x86="usr/lib/asterisk/modules/codec_gsm.so"
104
105 #
106 # List of modules to ignore during scan (because they have been removed in 1.2.x)
107 #
108 SCAN_IGNORE_MODS="
109 app_qcall
110 chan_modem
111 chan_modem_i4l
112 chan_modem_bestdata
113 chan_modme_aopen"
114
115 #
116 # shortcuts
117 #
118 is_ast10update() {
119 return $(has_version "=net-misc/asterisk-1.0*")
120 }
121
122 is_astupdate() {
123 if ! is_ast10update; then
124 return $(has_version "<net-misc/asterisk-${PV}")
125 fi
126 return 0
127 }
128
129 #
130 # Scan for asterisk-1.0.x modules that will have to be updated
131 #
132 scan_modules() {
133 local modules_list=""
134 local n
135
136 for x in $(ls -1 "${ROOT}"usr/$(get_libdir)/asterisk/modules/*.so); do
137 echo -en "Scanning.... $(basename ${x}) \r"
138
139 # skip blacklisted modules
140 hasq $(basename ${x//.so}) ${SCAN_IGNORE_MODS} && continue
141
142 if $(readelf -s "${x}" | grep -q "\(ast_load\|ast_destroy\)$"); then
143 modules_list="${modules_list} $(basename ${x//.so})"
144 fi
145 done
146
147 if [[ -n "${modules_list}" ]]; then
148 echo " ========================================================"
149 ewarn "Please update or unmerge the following modules:"
150 echo
151
152 n=0
153 for x in ${modules_list}; do
154 ewarn " - ${x}"
155 (( n++ ))
156 done
157
158 echo
159 ewarn "Warning: $n outdated module(s) found!"
160 ewarn "Warning: asterisk may not work if you don't update them!"
161 echo " ========================================================"
162 echo
163 einfo "You can use the \"asterisk-updater\" script to update the modules"
164 epause
165 echo
166 return 1
167 else
168 einfo "No asterisk-1.0.x modules found!"
169 return 0
170 fi
171 }
172
173 pkg_setup() {
174 local checkfailed=0 waitaftermsg=0
175
176 if is_ast10update; then
177 ewarn " Asterisk UPGRADE Warning"
178 ewarn ""
179 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz after the installation!"
180 ewarn ""
181 ewarn " Asterisk UPGRADE Warning"
182 echo
183 waitaftermsg=1
184 fi
185
186 #
187 # Regular checks
188 #
189 einfo "Running some pre-flight checks..."
190 echo
191
192 }
193
194 src_unpack() {
195 unpack ${A}
196 cd "${S}"
197
198 #
199 # gentoo patchset
200 #
201 for x in $(grep -v "^#\| \+" "${WORKDIR}"/patches/patches.list); do
202 epatch "${WORKDIR}"/patches/${x}
203 done
204
205 if use mmx; then
206 if ! use hardened; then
207 einfo "Enabling mmx optimization"
208 sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
209 Makefile
210 else
211 ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
212 fi
213 fi
214
215 if ! use debug; then
216 einfo "Disabling debug support"
217 sed -i -e "s:^\(DEBUG=\):#\1:" \
218 Makefile
219 fi
220
221 if ! use ssl; then
222 einfo "Disabling crypto support"
223 sed -i -e 's:^#\(NOCRYPTO=yes\):\1:' \
224 -e '/^LIBS+=-lssl/d' Makefile || die
225 fi
226
227 epatch "${FILESDIR}/1.2.0/asterisk-1.2.21.1-h323-dumb-makefile.diff"
228 epatch "${FILESDIR}/1.2.0/${P}-svn89254.diff"
229 epatch "${FILESDIR}/1.2.0/${P}-comma-is-not-pipe.diff"
230
231 #
232 # uclibc patch
233 #
234 if use elibc_uclibc; then
235 einfo "Patching asterisk for uclibc..."
236 epatch "${FILESDIR}"/1.0.0/${PN}-1.0.5-uclibc-dns.diff
237 epatch "${FILESDIR}"/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff
238 fi
239
240 #
241 # Disable AEL, security bug #171884
242 # Re-enable at your own risk (no USE since it can be critical)
243 #
244 sed -i -e 's/pbx_ael.so//' pbx/Makefile || die
245
246 # codecs/Makefile does not add -lspeexdsp needed for speex 1.2, bug #206463
247 if use speex && has_version ">=media-libs/speex-1.2"; then
248 sed -i -e "s/-lspeex/-lspeex -lspeexdsp/" codecs/Makefile \
249 || die "patching codecs/Makefile failed"
250 fi
251 }
252
253 src_compile() {
254 local myopts
255
256 use lowmem && \
257 myopts="-DLOW_MEMORY"
258
259 if use h323; then
260 einfo "Building H.323 wrapper lib..."
261 make -C channels/h323 \
262 NOTRACE=1 \
263 PWLIBDIR=/usr/share/pwlib \
264 OPENH323DIR=/usr/share/openh323 \
265 libchanh323.a Makefile.ast || die "Make h323 failed"
266 fi
267
268 einfo "Building Asterisk..."
269 make \
270 CC=$(tc-getCC) \
271 NOTRACE=1 \
272 OPTIMIZE="${CFLAGS}" \
273 PWLIBDIR=/usr/share/pwlib \
274 OPENH323DIR=/usr/share/openh323 \
275 OPTIONS="${myopts}" || die "Make failed"
276
277 # create api docs
278 use doc && \
279 make progdocs
280 }
281
282 src_install() {
283
284 # install asterisk
285 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" install || die "Make install failed"
286 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" samples || die "Failed to create sample files"
287
288 # remove installed sample files if nosamples flag is set
289 if use nosamples; then
290 einfo "Skipping installation of sample files..."
291 rm -rf "${D}"var/spool/asterisk/voicemail/default
292 rm -f "${D}"var/lib/asterisk/mohmp3/*
293 rm -f "${D}"var/lib/asterisk/sounds/demo-*
294 rm -f "${D}"var/lib/asterisk/agi-bin/*
295 else
296 einfo "Sample files have been installed"
297 keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
298 fi
299
300 # move sample configuration files to doc directory
301 if is_ast10update; then
302 elog "Updating from old (pre-1.2) asterisk version, new configuration files have been installed"
303 elog "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
304 elif has_version "net-misc/asterisk"; then
305 elog "Configuration samples have been moved to: $ROOT/usr/share/doc/${PF}/conf"
306 insinto /usr/share/doc/${PF}/conf
307 doins "${D}"etc/asterisk/*.conf*
308 rm -f "${D}"etc/asterisk/*.conf* 2>/dev/null
309 fi
310
311 # don't delete these directories, even if they are empty
312 for x in voicemail meetme system dictate monitor tmp; do
313 keepdir /var/spool/asterisk/${x}
314 done
315 keepdir /var/lib/asterisk/sounds/priv-callerintros
316 keepdir /var/lib/asterisk/mohmp3
317 keepdir /var/lib/asterisk/agi-bin
318 keepdir /var/log/asterisk/cdr-csv
319 keepdir /var/log/asterisk/cdr-custom
320 keepdir /var/run/asterisk
321
322 # install astxs
323 dobin contrib/scripts/astxs
324
325 newinitd "${FILESDIR}"/1.2.0/asterisk.rc6 asterisk
326 newconfd "${FILESDIR}"/1.2.0/asterisk.confd asterisk
327
328 # install standard docs...
329 dodoc BUGS CREDITS ChangeLog HARDWARE README README.fpm
330 dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
331 dodoc doc/README.*
332 dodoc doc/*.txt
333
334 docinto scripts
335 dodoc contrib/scripts/*
336
337 docinto utils
338 dodoc contrib/utils/*
339
340 docinto configs
341 dodoc configs/*
342
343 # install api docs
344 if use doc; then
345 insinto /usr/share/doc/${PF}/api/html
346 doins doc/api/html/*
347 fi
348
349 insinto /usr/share/doc/${PF}/cgi
350 doins contrib/scripts/vmail.cgi
351 doins images/*.gif
352
353 # install asterisk-updater
354 dosbin "${FILESDIR}"/1.2.0/asterisk-updater
355
356 # install asterisk.h, a lot of external modules need this
357 insinto /usr/include/asterisk
358 doins include/asterisk.h
359
360 # make sure misdn/capi stuff is not installed, provided by asterisk-chan_..
361 rm -f "${D}"/etc/asterisk/misdn.conf "${D}"/usr/lib/asterisk/modules/chan_misdn.so \
362 "${D}"/usr/share/doc/${PF}/{conf/misdn.conf,configs/misdn.conf.sample.gz,README.misdn.gz}
363 rm -f "${D}"/usr/include/asterisk/chan_capi{,_app}.h \
364 "${D}"/usr/share/doc/${PF}/{conf/capi.conf,configs/capi.conf.sample.gz}
365
366 # make sure the broken speex support does not keep Asterisk from starting up
367 # bug #206463 if you care about this. solution needs to work with --as-needed
368 # rm -f "${D}"usr/$(get_libdir)/asterisk/modules/codec_speex.so 2>/dev/null
369 rm -f "${D}"usr/$(get_libdir)/asterisk/modules/codec_speex.so || die "BROKEN"
370 }
371
372 pkg_preinst() {
373 enewgroup asterisk
374 enewuser asterisk -1 -1 /var/lib/asterisk asterisk
375 }
376
377 pkg_postinst() {
378 einfo "Fixing permissions"
379 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
380 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
381
382 for x in lib run spool; do
383 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
384 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
385 done
386
387 chown asterisk:asterisk "${ROOT}"etc/asterisk/
388 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
389 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
390 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
391 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
392 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
393 echo
394
395 #
396 # Announcements, warnings, reminders...
397 #
398 einfo "Asterisk has been installed"
399 einfo ""
400 elog "If you want to know more about asterisk, visit these sites:"
401 elog "http://www.asteriskdocs.org/"
402 elog "http://www.voip-info.org/wiki-Asterisk"
403 elog
404 elog "http://www.automated.it/guidetoasterisk.htm"
405 elog
406 elog "Gentoo VoIP IRC Channel:"
407 elog "#gentoo-voip @ irc.freenode.net"
408 elog
409 elog "Please note that AEL is no longer built because of security bugs"
410 elog "See http://bugs.gentoo.org/show_bug.cgi?id=171884"
411 elog
412 echo
413 echo
414
415 #
416 # Warning about 1.0 -> 1.2 changes...
417 #
418 if is_ast10update; then
419 ewarn ""
420 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz before continuing"
421 ewarn ""
422 fi
423
424 if is_astupdate; then
425 ewarn ""
426 ewarn " - The initgroups patch has been dropped, please update your"
427 ewarn " \"conf.d/asterisk\" and \"init.d/asterisk\" file!"
428 ewarn ""
429 fi
430
431 # scan for old modules
432 if is_ast10update; then
433 einfo "Asterisk has been updated from pre-1.2.x, scanning for old modules"
434 scan_modules
435 fi
436 }
437
438 pkg_config() {
439 einfo "Do you want to reset file permissions and ownerships (y/N)?"
440
441 read tmp
442 tmp="$(echo $tmp | tr [:upper:] [:lower:])"
443
444 if [[ "$tmp" = "y" ]] ||\
445 [[ "$tmp" = "yes" ]]
446 then
447 einfo "Resetting permissions to defaults..."
448
449 for x in spool run lib log; do
450 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
451 chmod -R u=rwX,g=rX,o= "${ROOT}"var/${x}/asterisk
452 done
453
454 chown -R root:asterisk "${ROOT}"etc/asterisk
455 chmod -R u=rwX,g=rX,o= "${ROOT}"etc/asterisk
456
457 einfo "done"
458 else
459 einfo "skipping"
460 fi
461 }