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.35-r1.ebuild
Date: Wed, 28 Oct 2009 12:26:07
Message-Id: E1N37bI-0005kW-Oj@stork.gentoo.org
1 chainsaw 09/10/28 12:26:04
2
3 Modified: ChangeLog
4 Added: asterisk-1.2.35-r1.ebuild
5 Log:
6 H323 depends on pwlib which is going away. Unable to migrate to ptlib as libopenh323 *also* depends on pwlib. You can still get H323 support through asterisk-addons. As requested by Mounir "volkmar" Lamouri in bug #290065.
7 (Portage version: 2.1.7.1/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.221 net-misc/asterisk/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.221&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.221&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.220&r2=1.221
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
19 retrieving revision 1.220
20 retrieving revision 1.221
21 diff -u -r1.220 -r1.221
22 --- ChangeLog 28 Oct 2009 11:31:03 -0000 1.220
23 +++ ChangeLog 28 Oct 2009 12:26:04 -0000 1.221
24 @@ -1,6 +1,18 @@
25 # ChangeLog for net-misc/asterisk
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.220 2009/10/28 11:31:03 chainsaw Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.221 2009/10/28 12:26:04 chainsaw Exp $
29 +
30 +*asterisk-1.2.35-r1 (28 Oct 2009)
31 +
32 + 28 Oct 2009; <chainsaw@g.o>
33 + -files/1.2.0/asterisk-1.2.31.1-bri-fixups.diff,
34 + -files/1.2.0/asterisk-1.2.31.1-svn89254.diff,
35 + -files/1.2.0/asterisk-1.2.32-comma-is-not-pipe.diff,
36 + -files/1.2.0/asterisk-1.2.32-svn89254.diff, +asterisk-1.2.35-r1.ebuild:
37 + H323 depends on pwlib which is going away. Unable to migrate to ptlib as
38 + libopenh323 *also* depends on pwlib. You can still get H323 support
39 + through asterisk-addons. As requested by Mounir "volkmar" Lamouri in bug
40 + #290065.
41
42 28 Oct 2009; <chainsaw@g.o> asterisk-1.6.1.8.ebuild:
43 Explicitly block zaptel prior to unmasking.
44
45
46
47 1.1 net-misc/asterisk/asterisk-1.2.35-r1.ebuild
48
49 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.35-r1.ebuild?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.35-r1.ebuild?rev=1.1&content-type=text/plain
51
52 Index: asterisk-1.2.35-r1.ebuild
53 ===================================================================
54 # Copyright 1999-2009 Gentoo Foundation
55 # Distributed under the terms of the GNU General Public License v2
56 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.35-r1.ebuild,v 1.1 2009/10/28 12:26:04 chainsaw Exp $
57
58 EAPI=2
59 inherit eutils multilib toolchain-funcs
60
61 IUSE="alsa curl debug doc gtk hardened lowmem mmx nosamples \
62 odbc osp postgres pri sqlite ssl speex zaptel elibc_uclibc"
63
64 AST_PATCHES="1.2.27-patches-1.0"
65
66 MY_P="${P/_p/.}"
67
68 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
69 HOMEPAGE="http://www.asterisk.org/"
70 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz
71 mirror://gentoo/${PN}-${AST_PATCHES}.tar.bz2"
72
73 S="${WORKDIR}/${MY_P}"
74
75 SLOT="0"
76 LICENSE="GPL-2"
77 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
78
79 RDEPEND="dev-libs/newt
80 media-sound/sox
81 ssl? ( dev-libs/openssl )
82 gtk? ( =x11-libs/gtk+-1.2* )
83 pri? ( =net-libs/libpri-1.2*[-bri] )
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_prepare() {
195 #
196 # gentoo patchset
197 #
198 for x in $(grep -v "^#\| \+" "${WORKDIR}"/patches/patches.list); do
199 epatch "${WORKDIR}"/patches/${x}
200 done
201
202 if use mmx; then
203 if ! use hardened; then
204 einfo "Enabling mmx optimization"
205 sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
206 Makefile
207 else
208 ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
209 fi
210 fi
211
212 if ! use debug; then
213 einfo "Disabling debug support"
214 sed -i -e "s:^\(DEBUG=\):#\1:" \
215 Makefile
216 fi
217
218 if ! use ssl; then
219 einfo "Disabling crypto support"
220 sed -i -e 's:^#\(NOCRYPTO=yes\):\1:' \
221 -e '/^LIBS+=-lssl/d' Makefile || die
222 fi
223
224 epatch "${FILESDIR}/1.2.0/${P}-lpc10-prototypes.diff"
225
226 #
227 # uclibc patch
228 #
229 if use elibc_uclibc; then
230 einfo "Patching asterisk for uclibc..."
231 epatch "${FILESDIR}"/1.0.0/${PN}-1.0.5-uclibc-dns.diff
232 epatch "${FILESDIR}"/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff
233 fi
234
235 #
236 # Disable AEL, security bug #171884
237 # Re-enable at your own risk (no USE since it can be critical)
238 #
239 sed -i -e 's/pbx_ael.so//' pbx/Makefile || die
240
241 # codecs/Makefile does not add -lspeexdsp needed for speex 1.2, bug #206463
242 if use speex && has_version ">=media-libs/speex-1.2"; then
243 sed -i -e "s/-lspeex/-lspeex -lspeexdsp/" codecs/Makefile \
244 || die "patching codecs/Makefile failed"
245 fi
246 }
247
248 src_compile() {
249 local myopts
250
251 use lowmem && \
252 myopts="-DLOW_MEMORY"
253
254 einfo "Building Asterisk..."
255 if use debug; then
256 unset CFLAGS
257 make \
258 CC=$(tc-getCC) \
259 NOTRACE=1 \
260 PWLIBDIR=/usr/share/pwlib \
261 OPTIONS="${myopts}" \
262 dont-optimize=1 || die "Make failed"
263 else
264 make \
265 CC=$(tc-getCC) \
266 NOTRACE=1 \
267 OPTIMIZE="${CFLAGS}" \
268 PWLIBDIR=/usr/share/pwlib \
269 OPTIONS="${myopts}" || die "Make failed"
270 fi
271
272 # create api docs
273 use doc && \
274 make progdocs
275 }
276
277 src_install() {
278
279 # install asterisk
280 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" install || die "Make install failed"
281 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" samples || die "Failed to create sample files"
282
283 # remove installed sample files if nosamples flag is set
284 if use nosamples; then
285 einfo "Skipping installation of sample files..."
286 rm -rf "${D}"var/spool/asterisk/voicemail/default
287 rm -f "${D}"var/lib/asterisk/mohmp3/*
288 rm -f "${D}"var/lib/asterisk/sounds/demo-*
289 rm -f "${D}"var/lib/asterisk/agi-bin/*
290 else
291 einfo "Sample files have been installed"
292 keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
293 fi
294
295 # move sample configuration files to doc directory
296 if is_ast10update; then
297 elog "Updating from old (pre-1.2) asterisk version, new configuration files have been installed"
298 elog "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
299 elif has_version "net-misc/asterisk"; then
300 elog "Configuration samples have been moved to: $ROOT/usr/share/doc/${PF}/conf"
301 insinto /usr/share/doc/${PF}/conf
302 doins "${D}"etc/asterisk/*.conf*
303 rm -f "${D}"etc/asterisk/*.conf* 2>/dev/null
304 fi
305
306 # don't delete these directories, even if they are empty
307 for x in voicemail meetme system dictate monitor tmp; do
308 keepdir /var/spool/asterisk/${x}
309 done
310 keepdir /var/lib/asterisk/sounds/priv-callerintros
311 keepdir /var/lib/asterisk/mohmp3
312 keepdir /var/lib/asterisk/agi-bin
313 keepdir /var/log/asterisk/cdr-csv
314 keepdir /var/log/asterisk/cdr-custom
315 keepdir /var/run/asterisk
316
317 # install astxs
318 dobin contrib/scripts/astxs
319
320 newinitd "${FILESDIR}"/1.2.0/asterisk.rc6 asterisk
321 newconfd "${FILESDIR}"/1.2.0/asterisk.confd asterisk
322
323 # install standard docs...
324 dodoc BUGS CREDITS ChangeLog HARDWARE README
325 dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
326 dodoc doc/README.*
327 dodoc doc/*.txt
328
329 docinto scripts
330 dodoc contrib/scripts/*
331
332 docinto utils
333 dodoc contrib/utils/*
334
335 docinto configs
336 dodoc configs/*
337
338 # install api docs
339 if use doc; then
340 insinto /usr/share/doc/${PF}/api/html
341 doins doc/api/html/*
342 fi
343
344 insinto /usr/share/doc/${PF}/cgi
345 doins contrib/scripts/vmail.cgi
346 doins images/*.gif
347
348 # install asterisk-updater
349 dosbin "${FILESDIR}"/1.2.0/asterisk-updater
350
351 # install asterisk.h, a lot of external modules need this
352 insinto /usr/include/asterisk
353 doins include/asterisk.h
354
355 # make sure misdn/capi stuff is not installed, provided by asterisk-chan_..
356 rm -f "${D}"/etc/asterisk/misdn.conf "${D}"/usr/lib/asterisk/modules/chan_misdn.so \
357 "${D}"/usr/share/doc/${PF}/{conf/misdn.conf,configs/misdn.conf.sample.gz,README.misdn.gz}
358 rm -f "${D}"/usr/include/asterisk/chan_capi{,_app}.h \
359 "${D}"/usr/share/doc/${PF}/{conf/capi.conf,configs/capi.conf.sample.gz}
360
361 # make sure the broken speex support does not keep Asterisk from starting up
362 # bug #206463 if you care about this. solution needs to work with --as-needed
363 rm -f "${D}"usr/$(get_libdir)/asterisk/modules/codec_speex.so || die "Unable to remove fatally flawed codec_speex.so"
364 }
365
366 pkg_preinst() {
367 enewgroup asterisk
368 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
369 }
370
371 pkg_postinst() {
372 einfo "Fixing permissions"
373 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
374 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
375
376 for x in lib run spool; do
377 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
378 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
379 done
380
381 chown asterisk:asterisk "${ROOT}"etc/asterisk/
382 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
383 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
384 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
385 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
386 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
387 echo
388
389 #
390 # Announcements, warnings, reminders...
391 #
392 einfo "Asterisk has been installed"
393 einfo ""
394 elog "If you want to know more about asterisk, visit these sites:"
395 elog "http://www.asteriskdocs.org/"
396 elog "http://www.voip-info.org/wiki-Asterisk"
397 elog
398 elog "http://www.automated.it/guidetoasterisk.htm"
399 elog
400 elog "Gentoo VoIP IRC Channel:"
401 elog "#gentoo-voip @ irc.freenode.net"
402 elog
403 elog "Please note that AEL is no longer built because of security bugs"
404 elog "See http://bugs.gentoo.org/show_bug.cgi?id=171884"
405 elog
406 echo
407 echo
408
409 #
410 # Warning about 1.0 -> 1.2 changes...
411 #
412 if is_ast10update; then
413 ewarn ""
414 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz before continuing"
415 ewarn ""
416 fi
417
418 if is_astupdate; then
419 ewarn ""
420 ewarn " - The initgroups patch has been dropped, please update your"
421 ewarn " \"conf.d/asterisk\" and \"init.d/asterisk\" file!"
422 ewarn ""
423 fi
424
425 # scan for old modules
426 if is_ast10update; then
427 einfo "Asterisk has been updated from pre-1.2.x, scanning for old modules"
428 scan_modules
429 fi
430 }
431
432 pkg_config() {
433 einfo "Do you want to reset file permissions and ownerships (y/N)?"
434
435 read tmp
436 tmp="$(echo $tmp | tr [:upper:] [:lower:])"
437
438 if [[ "$tmp" = "y" ]] ||\
439 [[ "$tmp" = "yes" ]]
440 then
441 einfo "Resetting permissions to defaults..."
442
443 for x in spool run lib log; do
444 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
445 chmod -R u=rwX,g=rX,o= "${ROOT}"var/${x}/asterisk
446 done
447
448 chown -R root:asterisk "${ROOT}"etc/asterisk
449 chmod -R u=rwX,g=rX,o= "${ROOT}"etc/asterisk
450
451 einfo "done"
452 else
453 einfo "skipping"
454 fi
455 }