Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/asterisk/
Date: Mon, 04 May 2020 17:26:35
Message-Id: 1588613168.9bba8866c2494ca62273be220a18aee165e60aea.juippis@gentoo
1 commit: 9bba8866c2494ca62273be220a18aee165e60aea
2 Author: Jaco Kroon <jaco <AT> uls <DOT> co <DOT> za>
3 AuthorDate: Sun May 3 11:30:10 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon May 4 17:26:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bba8866
7
8 net-misc/asterisk: version bumps
9
10 Switch to media-libs/libilbc for iLBC support.
11 Stop installing various scripts I provided a long time ago which are no
12 longer needed (tools exist that supercedes these now).
13 Drop samples IUSE.
14 Remove patches that's now upstreamed.
15
16 Package-Manager: Portage-2.3.89, Repoman-2.3.20
17 Signed-off-by: Jaco Kroon <jaco <AT> uls.co.za>
18 Bug: https://bugs.gentoo.org/720184
19 Closes: https://github.com/gentoo/gentoo/pull/15622
20 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
21
22 net-misc/asterisk/Manifest | 2 +
23 net-misc/asterisk/asterisk-13.33.0.ebuild | 296 +++++++++++++++++++++++++++++
24 net-misc/asterisk/asterisk-16.10.0.ebuild | 301 ++++++++++++++++++++++++++++++
25 3 files changed, 599 insertions(+)
26
27 diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
28 index 6a41581ef86..14846d5bc2c 100644
29 --- a/net-misc/asterisk/Manifest
30 +++ b/net-misc/asterisk/Manifest
31 @@ -1,5 +1,7 @@
32 DIST asterisk-11.25.3.tar.gz 35134682 BLAKE2B 9da24d5d6a674ab660edb103e5fc56ddfbcc58cd86166cc08cceb0598a63b51eae36133565e09a30ad11ff6623ba8945437dfb561d2916f68341d398540dabce SHA512 9c0521d55e5b69663ea40066d52e397ba6c165a4b20cd0a1e5e375b9c0e5a6e4f37908e50b0b580e288dec9be252af9a8bce7bceb03ba029f902fb757e6311ed
33 DIST asterisk-13.32.0.tar.gz 33652378 BLAKE2B c6b0ca0895b25526c135332966f33761b74a88dec4a7b0ff0fe40263640ee2fb928eca29e716fba3cc8e96c6e395e7c70c36f41def6a0d055baac2a5c7b8637a SHA512 daafcd5d3544725e7a96bd467d998c4d74fd3c5d7e9d8fb4ce16e340ce09c502b1603e468e89c5a62b59282848b4ff0a43bdbcd75902cd11f6951d828511e841
34 +DIST asterisk-13.33.0.tar.gz 33683712 BLAKE2B ecfc122628c08e93fc389f111e1ee8ddcf3d27895437df9da5b83a6440c2135f9223a5605e0ef436e8585f8b023abba5b74680cac97f1700e1bc153872c1ed87 SHA512 b866a63cce7c289d32333b4b3b0a605c413b48fc7518976aa0768dd5c68894348d0de1c9bc7c56b73eb86b69e0fd9847d7226fa0f9e449f8ebb8a7118329db56
35 +DIST asterisk-16.10.0.tar.gz 27706766 BLAKE2B b8d7866fe3e8420ef5ce6ea5e016316f63e4f2e8904a79de69c4ddfb7aedcd00f09cfb414da43938af0771cdde387dcebfe716eb34e5ed1de3a30ff534459c7f SHA512 254c582593cf6ec691649d995a8d73260d2e340ad6ae65f0af62f6b8c3ef59c4da6ad9172bc04cc29a907d1e8d2ef105ae2ae20190b30115d5d402423c8c08cb
36 DIST asterisk-16.9.0.tar.gz 27674324 BLAKE2B 991fb0146f5dea338a8c6ad98007e2ac1b182ac2ed7dbabd4143aa7f968dc353563ac4aba18bb07e9b0a705dabd1446319b06f4be284922a804d5c2dbddf6f7b SHA512 b8101fa3cc6068230b6b9a28a558415e7104b9bc3a8c0c245af34e9839cf1eb287739a2142ad0227d2fef41e6d40a5c01128a0b44a7ecaae13a00767d0fa8ab9
37 DIST gentoo-asterisk-patchset-3.17.tar.bz2 5074 BLAKE2B 3c945e77b54b2449253acb9fcea8d289a7a3184729190622c14aff5557d36c93556efa83320fe4e7ae84021960c09f35ae9f997e8015706eef933aae2948309e SHA512 37f86f3c699b2643afd8080391e817a282571694bb56e00efd0734918dbc33d6c12a2463dbc24667597420863b4f506870140fbb8ef3f1700124ef790ae7252d
38 DIST gentoo-asterisk-patchset-4.08.tar.bz2 2176 BLAKE2B 7f8c9b5fda855091e66b2534d2be23fb1616f565480459f71f766826e5deeeecb24899e2ee9eefe74323e892624d32ab954ec7e9be6a002431ff029fc13493ed SHA512 365c1b8628882c48c279e1fd77d982e6d0820ba7d7122e97bb4988f875d7010caa956798c833c3b01d389004fa08a63a9de2c1b452c9e5701c6106e29fd8e9e1
39
40 diff --git a/net-misc/asterisk/asterisk-13.33.0.ebuild b/net-misc/asterisk/asterisk-13.33.0.ebuild
41 new file mode 100644
42 index 00000000000..c404fa5c5bd
43 --- /dev/null
44 +++ b/net-misc/asterisk/asterisk-13.33.0.ebuild
45 @@ -0,0 +1,296 @@
46 +# Copyright 1999-2020 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI=7
50 +
51 +inherit autotools linux-info systemd
52 +
53 +DESCRIPTION="Asterisk: A Modular Open Source PBX System"
54 +HOMEPAGE="https://www.asterisk.org/"
55 +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz
56 + https://downloads.uls.co.za/gentoo/asterisk/gentoo-asterisk-patchset-4.08.tar.bz2"
57 +LICENSE="GPL-2"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~ppc ~x86"
60 +
61 +IUSE_VOICEMAIL_STORAGE="
62 + +voicemail_storage_file
63 + voicemail_storage_odbc
64 + voicemail_storage_imap
65 +"
66 +IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libedit libressl lua mysql newt odbc osplookup oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp"
67 +IUSE_EXPAND="VOICEMAIL_STORAGE"
68 +REQUIRED_USE="gtalk? ( xmpp )
69 + ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
70 + voicemail_storage_odbc? ( odbc )
71 +"
72 +
73 +PATCHES=(
74 + "${FILESDIR}/asterisk-historic-no-var-run-install.patch"
75 +)
76 +
77 +DEPEND="acct-user/asterisk
78 + acct-group/asterisk
79 + dev-db/sqlite:3
80 + dev-libs/popt
81 + dev-libs/jansson
82 + dev-libs/libxml2:2
83 + dev-libs/libxslt
84 + sys-libs/ncurses:0=
85 + sys-libs/zlib
86 + alsa? ( media-libs/alsa-lib )
87 + bluetooth? ( net-wireless/bluez:= )
88 + calendar? (
89 + net-libs/neon:=
90 + dev-libs/libical:=
91 + dev-libs/iksemel
92 + )
93 + caps? ( sys-libs/libcap )
94 + cluster? ( sys-cluster/corosync )
95 + curl? ( net-misc/curl )
96 + dahdi? (
97 + net-libs/libpri
98 + net-misc/dahdi-tools
99 + )
100 + freetds? ( dev-db/freetds )
101 + gtalk? ( dev-libs/iksemel )
102 + http? ( dev-libs/gmime:2.6 )
103 + iconv? ( virtual/libiconv )
104 + ilbc? ( media-libs/libilbc )
105 + ldap? ( net-nds/openldap )
106 + libedit? ( dev-libs/libedit )
107 + lua? ( dev-lang/lua:* )
108 + mysql? ( dev-db/mysql-connector-c:= )
109 + newt? ( dev-libs/newt )
110 + odbc? ( dev-db/unixODBC )
111 + osplookup? ( net-libs/osptoolkit )
112 + pjproject? ( net-libs/pjproject )
113 + portaudio? ( media-libs/portaudio )
114 + postgres? ( dev-db/postgresql:* )
115 + radius? ( net-dialup/freeradius-client )
116 + snmp? ( net-analyzer/net-snmp:= )
117 + span? ( media-libs/spandsp )
118 + speex? (
119 + media-libs/speex
120 + media-libs/speexdsp
121 + )
122 + srtp? ( net-libs/libsrtp:0 )
123 + ssl? (
124 + !libressl? ( dev-libs/openssl:0= )
125 + libressl? ( dev-libs/libressl:0= )
126 + )
127 + vorbis? ( media-libs/libvorbis )
128 + voicemail_storage_imap? ( virtual/imap-c-client )
129 + xmpp? ( dev-libs/iksemel )
130 +"
131 +
132 +RDEPEND="${DEPEND}
133 + net-misc/asterisk-core-sounds
134 + net-misc/asterisk-extra-sounds
135 + net-misc/asterisk-moh-opsound
136 + selinux? ( sec-policy/selinux-asterisk )
137 + syslog? ( virtual/logger )"
138 +
139 +BDEPEND="virtual/pkgconfig"
140 +
141 +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
142 +
143 +pkg_setup() {
144 + CONFIG_CHECK="~!NF_CONNTRACK_SIP"
145 + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
146 + have reported that this module dropped critical SIP packets in their deployments. You
147 + may want to disable it if you see such problems."
148 + check_extra_config
149 +}
150 +
151 +src_prepare() {
152 + default
153 + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf
154 +}
155 +
156 +function menuselect() {
157 + menuselect/menuselect "$@" || die "menuselect $* failed."
158 +}
159 +
160 +src_configure() {
161 + local vmst
162 +
163 + econf \
164 + --libdir="/usr/$(get_libdir)" \
165 + --localstatedir="/var" \
166 + --with-crypto \
167 + --with-gsm=internal \
168 + --with-popt \
169 + --with-z \
170 + --without-libedit \
171 + $(use_with caps cap) \
172 + $(use_with http gmime) \
173 + $(use_with newt) \
174 + $(use_with pjproject) \
175 + $(use_with portaudio) \
176 + $(use_with ssl)
177 +
178 + # Blank out sounds/sounds.xml file to prevent
179 + # asterisk from installing sounds files (we pull them in via
180 + # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
181 + >"${S}"/sounds/sounds.xml
182 +
183 + # That NATIVE_ARCH chatter really is quite bothersome
184 + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
185 +
186 + # Compile menuselect binary for optional components
187 + emake NOISE_BUILD=yes menuselect.makeopts
188 +
189 + # Disable BUILD_NATIVE (bug #667498)
190 + menuselect --disable build_native menuselect.makeopts
191 +
192 + # Broken functionality is forcibly disabled (bug #360143)
193 + menuselect --disable chan_misdn menuselect.makeopts
194 + menuselect --disable chan_ooh323 menuselect.makeopts
195 +
196 + # Utility set is forcibly enabled (bug #358001)
197 + menuselect --enable smsq menuselect.makeopts
198 + menuselect --enable streamplayer menuselect.makeopts
199 + menuselect --enable aelparse menuselect.makeopts
200 + menuselect --enable astman menuselect.makeopts
201 +
202 + # this is connected, otherwise it would not find
203 + # ast_pktccops_gate_alloc symbol
204 + menuselect --enable chan_mgcp menuselect.makeopts
205 + menuselect --enable res_pktccops menuselect.makeopts
206 +
207 + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
208 + menuselect --enable pbx_dundi menuselect.makeopts
209 + menuselect --enable func_aes menuselect.makeopts
210 + menuselect --enable chan_iax2 menuselect.makeopts
211 +
212 + # SQlite3 is now the main database backend, enable related features
213 + menuselect --enable cdr_sqlite3_custom menuselect.makeopts
214 + menuselect --enable cel_sqlite3_custom menuselect.makeopts
215 +
216 + # The others are based on USE-flag settings
217 + use_select() {
218 + local state=$(use "$1" && echo enable || echo disable)
219 + shift # remove use from parameters
220 +
221 + while [[ -n $1 ]]; do
222 + menuselect --${state} "$1" menuselect.makeopts
223 + shift
224 + done
225 + }
226 +
227 + use_select alsa chan_alsa
228 + use_select bluetooth chan_mobile
229 + use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
230 + use_select cluster res_corosync
231 + use_select curl func_curl res_config_curl res_curl
232 + use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
233 + use_select freetds {cdr,cel}_tds
234 + use_select gtalk chan_motif
235 + use_select http res_http_post
236 + use_select iconv func_iconv
237 + use_select ilbc codec_ilbc format_ilbc
238 + use_select ldap res_config_ldap
239 + use_select lua pbx_lua
240 + use_select mysql app_mysql cdr_mysql res_config_mysql
241 + use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
242 + use_select osplookup app_osplookup
243 + use_select oss chan_oss
244 + use_select postgres {cdr,cel}_pgsql res_config_pgsql
245 + use_select radius {cdr,cel}_radius
246 + use_select snmp res_snmp
247 + use_select span res_fax_spandsp
248 + use_select speex {codec,func}_speex
249 + use_select srtp res_srtp
250 + use_select statsd res_statsd res_{endpoint,chan}_stats
251 + use_select syslog cdr_syslog
252 + use_select vorbis format_ogg_vorbis
253 + use_select xmpp res_xmpp
254 +
255 + # Voicemail storage ...
256 + for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
257 + if use ${vmst}; then
258 + menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
259 + fi
260 + done
261 +
262 + if use debug; then
263 + for o in DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES; do
264 + menuselect --enable $o menuselect.makeopts
265 + done
266 + fi
267 +}
268 +
269 +src_compile() {
270 + emake ASTCFLAGS="${CFLAGS}" ASTLDFLAGS="${LDFLAGS}" NOISY_BUILD=yes
271 +}
272 +
273 +src_install() {
274 + local d
275 +
276 + mkdir -p "${ED}/usr/$(get_libdir)/pkgconfig" || die
277 + emake DESTDIR="${ED}" NOISY_BUILD=yes install
278 +
279 + if use radius; then
280 + insinto /etc/radiusclient/
281 + doins contrib/dictionary.digium
282 + fi
283 + diropts -m 0750 -o root -g asterisk
284 + keepdir /etc/asterisk
285 + emake NOISY_BUILD=yes DESTDIR="${ED}" CONFIG_SRC=configs/samples CONFIG_EXTEN=.sample install-configs
286 + for conffile in "${ED}/etc/asterisk/"*
287 + do
288 + fowners root:root "${conffile#${ED}}"
289 + fperms 0644 "${conffile#${ED}}"
290 + done
291 +
292 + # keep directories
293 + diropts -m 0750 -o asterisk -g root
294 + keepdir /var/lib/asterisk
295 + keepdir /var/spool/asterisk
296 + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording}
297 + diropts -m 0750 -o asterisk -g asterisk
298 + keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
299 +
300 + newinitd "${FILESDIR}"/initd-13.32.0-r1 asterisk
301 + newconfd "${FILESDIR}"/confd-13.32.0 asterisk
302 +
303 + systemd_dounit "${FILESDIR}"/asterisk.service
304 + systemd_newtmpfilesd "${FILESDIR}"/asterisk.tmpfiles.conf asterisk.conf
305 + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf
306 +
307 + # Reset diropts else dodoc uses it for doc installations.
308 + diropts -m0755
309 +
310 + # install the upgrade documentation
311 + dodoc UPGRADE* BUGS CREDITS
312 +
313 + # install extra documentation
314 + if use doc; then
315 + dodoc doc/*.txt
316 + dodoc doc/*.pdf
317 + fi
318 +
319 + # install logrotate snippet; bug #329281
320 + #
321 + insinto /etc/logrotate.d
322 + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk
323 +
324 + # Asterisk installs a few folders that's empty by design,
325 + # but still required. This finds them, and marks them for
326 + # portage.
327 + for d in $(find "${ED}"/var -type d -empty || die "Find failed."); do
328 + keepdir "${d#${ED}}"
329 + done
330 +}
331 +
332 +pkg_postinst() {
333 + if [ -z "${REPLACING_VERSIONS}" ]; then
334 + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
335 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
336 + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then
337 + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:"
338 + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)"
339 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
340 + fi
341 +}
342
343 diff --git a/net-misc/asterisk/asterisk-16.10.0.ebuild b/net-misc/asterisk/asterisk-16.10.0.ebuild
344 new file mode 100644
345 index 00000000000..a9d9c1eba0a
346 --- /dev/null
347 +++ b/net-misc/asterisk/asterisk-16.10.0.ebuild
348 @@ -0,0 +1,301 @@
349 +# Copyright 1999-2020 Gentoo Authors
350 +# Distributed under the terms of the GNU General Public License v2
351 +
352 +EAPI=7
353 +
354 +inherit autotools linux-info systemd
355 +
356 +DESCRIPTION="Asterisk: A Modular Open Source PBX System"
357 +HOMEPAGE="https://www.asterisk.org/"
358 +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz
359 + https://downloads.uls.co.za/gentoo/asterisk/gentoo-asterisk-patchset-4.08.tar.bz2"
360 +LICENSE="GPL-2"
361 +SLOT="0"
362 +KEYWORDS="~amd64 ~ppc ~x86"
363 +
364 +IUSE_VOICEMAIL_STORAGE="
365 + +voicemail_storage_file
366 + voicemail_storage_odbc
367 + voicemail_storage_imap
368 +"
369 +IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc osplookup oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog unbound vorbis xmpp"
370 +IUSE_EXPAND="VOICEMAIL_STORAGE"
371 +REQUIRED_USE="gtalk? ( xmpp )
372 + ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
373 + voicemail_storage_odbc? ( odbc )
374 +"
375 +
376 +PATCHES=(
377 + "${FILESDIR}/asterisk-historic-no-var-run-install.patch"
378 +)
379 +
380 +DEPEND="acct-user/asterisk
381 + acct-group/asterisk
382 + dev-db/sqlite:3
383 + dev-libs/popt
384 + >=dev-libs/jansson-2.11
385 + dev-libs/libedit
386 + dev-libs/libxml2:2
387 + dev-libs/libxslt
388 + sys-apps/util-linux
389 + sys-libs/ncurses:0=
390 + sys-libs/zlib
391 + alsa? ( media-libs/alsa-lib )
392 + bluetooth? ( net-wireless/bluez:= )
393 + calendar? (
394 + net-libs/neon:=
395 + dev-libs/libical:=
396 + dev-libs/iksemel
397 + )
398 + caps? ( sys-libs/libcap )
399 + cluster? ( sys-cluster/corosync )
400 + curl? ( net-misc/curl )
401 + dahdi? (
402 + net-libs/libpri
403 + net-misc/dahdi-tools
404 + )
405 + freetds? ( dev-db/freetds )
406 + gtalk? ( dev-libs/iksemel )
407 + http? ( dev-libs/gmime:2.6 )
408 + iconv? ( virtual/libiconv )
409 + ilbc? ( media-libs/libilbc )
410 + ldap? ( net-nds/openldap )
411 + lua? ( dev-lang/lua:* )
412 + mysql? ( dev-db/mysql-connector-c:= )
413 + newt? ( dev-libs/newt )
414 + odbc? ( dev-db/unixODBC )
415 + osplookup? ( net-libs/osptoolkit )
416 + pjproject? ( >=net-libs/pjproject-2.9 )
417 + portaudio? ( media-libs/portaudio )
418 + postgres? ( dev-db/postgresql:* )
419 + radius? ( net-dialup/freeradius-client )
420 + snmp? ( net-analyzer/net-snmp:= )
421 + span? ( media-libs/spandsp )
422 + speex? (
423 + media-libs/speex
424 + media-libs/speexdsp
425 + )
426 + srtp? ( net-libs/libsrtp:0 )
427 + ssl? (
428 + !libressl? ( dev-libs/openssl:0= )
429 + libressl? ( dev-libs/libressl:0= )
430 + )
431 + unbound? ( net-dns/unbound )
432 + vorbis? ( media-libs/libvorbis )
433 + voicemail_storage_imap? ( virtual/imap-c-client )
434 + xmpp? ( dev-libs/iksemel )
435 +"
436 +
437 +RDEPEND="${DEPEND}
438 + net-misc/asterisk-core-sounds
439 + net-misc/asterisk-extra-sounds
440 + net-misc/asterisk-moh-opsound
441 + selinux? ( sec-policy/selinux-asterisk )
442 + syslog? ( virtual/logger )"
443 +
444 +BDEPEND="virtual/pkgconfig"
445 +
446 +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
447 +
448 +pkg_setup() {
449 + CONFIG_CHECK="~!NF_CONNTRACK_SIP"
450 + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
451 + have reported that this module dropped critical SIP packets in their deployments. You
452 + may want to disable it if you see such problems."
453 + check_extra_config
454 +}
455 +
456 +src_prepare() {
457 + default
458 + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf
459 +}
460 +
461 +function menuselect() {
462 + menuselect/menuselect "$@" || die "menuselect $* failed."
463 +}
464 +
465 +src_configure() {
466 + local vmst
467 +
468 + econf \
469 + --libdir="/usr/$(get_libdir)" \
470 + --localstatedir="/var" \
471 + --with-crypto \
472 + --with-gsm=internal \
473 + --with-popt \
474 + --with-z \
475 + --with-libedit \
476 + --without-jansson-bundled \
477 + --without-pjproject-bundled \
478 + $(use_with caps cap) \
479 + $(use_with http gmime) \
480 + $(use_with newt) \
481 + $(use_with pjproject) \
482 + $(use_with portaudio) \
483 + $(use_with ssl) \
484 + $(use_with unbound)
485 +
486 + # Blank out sounds/sounds.xml file to prevent
487 + # asterisk from installing sounds files (we pull them in via
488 + # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
489 + >"${S}"/sounds/sounds.xml
490 +
491 + # That NATIVE_ARCH chatter really is quite bothersome
492 + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
493 +
494 + # Compile menuselect binary for optional components
495 + emake NOISY_BUILD=yes menuselect.makeopts
496 +
497 + # Disable BUILD_NATIVE (bug #667498)
498 + menuselect --disable build_native menuselect.makeopts
499 +
500 + # Broken functionality is forcibly disabled (bug #360143)
501 + menuselect --disable chan_misdn menuselect.makeopts
502 + menuselect --disable chan_ooh323 menuselect.makeopts
503 +
504 + # Utility set is forcibly enabled (bug #358001)
505 + menuselect --enable smsq menuselect.makeopts
506 + menuselect --enable streamplayer menuselect.makeopts
507 + menuselect --enable aelparse menuselect.makeopts
508 + menuselect --enable astman menuselect.makeopts
509 +
510 + # this is connected, otherwise it would not find
511 + # ast_pktccops_gate_alloc symbol
512 + menuselect --enable chan_mgcp menuselect.makeopts
513 + menuselect --enable res_pktccops menuselect.makeopts
514 +
515 + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
516 + menuselect --enable pbx_dundi menuselect.makeopts
517 + menuselect --enable func_aes menuselect.makeopts
518 + menuselect --enable chan_iax2 menuselect.makeopts
519 +
520 + # SQlite3 is now the main database backend, enable related features
521 + menuselect --enable cdr_sqlite3_custom menuselect.makeopts
522 + menuselect --enable cel_sqlite3_custom menuselect.makeopts
523 +
524 + # The others are based on USE-flag settings
525 + use_select() {
526 + local state=$(use "$1" && echo enable || echo disable)
527 + shift # remove use from parameters
528 +
529 + while [[ -n $1 ]]; do
530 + menuselect --${state} "$1" menuselect.makeopts
531 + shift
532 + done
533 + }
534 +
535 + use_select alsa chan_alsa
536 + use_select bluetooth chan_mobile
537 + use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
538 + use_select cluster res_corosync
539 + use_select curl func_curl res_config_curl res_curl
540 + use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
541 + use_select freetds {cdr,cel}_tds
542 + use_select gtalk chan_motif
543 + use_select http res_http_post
544 + use_select iconv func_iconv
545 + use_select ilbc codec_ilbc format_ilbc
546 + use_select ldap res_config_ldap
547 + use_select lua pbx_lua
548 + use_select mysql app_mysql cdr_mysql res_config_mysql
549 + use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
550 + use_select osplookup app_osplookup
551 + use_select oss chan_oss
552 + use_select postgres {cdr,cel}_pgsql res_config_pgsql
553 + use_select radius {cdr,cel}_radius
554 + use_select snmp res_snmp
555 + use_select span res_fax_spandsp
556 + use_select speex {codec,func}_speex
557 + use_select srtp res_srtp
558 + use_select statsd res_statsd res_{endpoint,chan}_stats
559 + use_select syslog cdr_syslog
560 + use_select vorbis format_ogg_vorbis
561 + use_select xmpp res_xmpp
562 +
563 + # Voicemail storage ...
564 + for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
565 + if use ${vmst}; then
566 + menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
567 + fi
568 + done
569 +
570 + if use debug; then
571 + for o in DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES; do
572 + menuselect --enable "${o}" menuselect.makeopts
573 + done
574 + fi
575 +}
576 +
577 +src_compile() {
578 + emake ASTCFLAGS="${CFLAGS}" ASTLDFLAGS="${LDFLAGS}" NOISY_BUILD=yes
579 +}
580 +
581 +src_install() {
582 + local d
583 +
584 + mkdir -p "${ED}/usr/$(get_libdir)/pkgconfig" || die
585 + emake DESTDIR="${ED}" NOISY_BUILD=yes install
586 +
587 + if use radius; then
588 + insinto /etc/radiusclient/
589 + doins contrib/dictionary.digium
590 + fi
591 + diropts -m 0750 -o root -g asterisk
592 + keepdir /etc/asterisk
593 + emake NOISY_BUILD=yes DESTDIR="${ED}" CONFIG_SRC=configs/samples CONFIG_EXTEN=.sample install-configs
594 + for conffile in "${ED}/etc/asterisk/"*
595 + do
596 + fowners root:root "${conffile#${ED}}"
597 + fperms 0644 "${conffile#${ED}}"
598 + done
599 +
600 + # keep directories
601 + diropts -m 0750 -o asterisk -g root
602 + keepdir /var/lib/asterisk
603 + keepdir /var/spool/asterisk
604 + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording}
605 + diropts -m 0750 -o asterisk -g asterisk
606 + keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
607 +
608 + newinitd "${FILESDIR}"/initd-13.32.0-r1 asterisk
609 + newconfd "${FILESDIR}"/confd-13.32.0 asterisk
610 +
611 + systemd_dounit "${FILESDIR}"/asterisk.service
612 + systemd_newtmpfilesd "${FILESDIR}"/asterisk.tmpfiles.conf asterisk.conf
613 + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf
614 +
615 + # Reset diropts else dodoc uses it for doc installations.
616 + diropts -m0755
617 +
618 + # install the upgrade documentation
619 + dodoc UPGRADE* BUGS CREDITS
620 +
621 + # install extra documentation
622 + if use doc; then
623 + dodoc doc/*.txt
624 + dodoc doc/*.pdf
625 + fi
626 +
627 + # install logrotate snippet; bug #329281
628 + #
629 + insinto /etc/logrotate.d
630 + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk
631 +
632 + # Asterisk installs a few folders that's empty by design,
633 + # but still required. This finds them, and marks them for
634 + # portage.
635 + for d in $(find "${ED}"/var -type d -empty || die "Find failed."); do
636 + keepdir "${d#${ED}}"
637 + done
638 +}
639 +
640 +pkg_postinst() {
641 + if [ -z "${REPLACING_VERSIONS}" ]; then
642 + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
643 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
644 + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then
645 + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:"
646 + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)"
647 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
648 + fi
649 +}