Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/asterisk/
Date: Thu, 14 Oct 2021 08:01:30
Message-Id: 1634198460.f484371fbf2440816686dcf7de4e345268b71a48.sam@gentoo
1 commit: f484371fbf2440816686dcf7de4e345268b71a48
2 Author: Jaco Kroon <jaco <AT> uls <DOT> co <DOT> za>
3 AuthorDate: Wed Oct 13 05:03:04 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 14 08:01:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f484371f
7
8 net-misc/asterisk: v16.21.1
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Jaco Kroon <jaco <AT> uls.co.za>
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 net-misc/asterisk/Manifest | 1 +
15 net-misc/asterisk/asterisk-16.21.1.ebuild | 365 ++++++++++++++++++++++++++++++
16 2 files changed, 366 insertions(+)
17
18 diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
19 index 746847a0738..6424dc6e1c0 100644
20 --- a/net-misc/asterisk/Manifest
21 +++ b/net-misc/asterisk/Manifest
22 @@ -1,5 +1,6 @@
23 DIST asterisk-13.38.3.tar.gz 33711458 BLAKE2B a1f37c210e7e95962665310b542d9a3b682ecc5e90188e8272a0cd6e22ebfa963ed5af46f0f85c2074bc0bbe34d72473343ff3437d80b58e5383eb80385d0b89 SHA512 dd67f73704f1c68639313852ba1508165c7b525f0f4156c776258e27ee19a0ee87293ae7805178b0f37188fca91b861c52b5206cbba754a6181492d0efb7e895
24 DIST asterisk-16.19.1.tar.gz 27870922 BLAKE2B e7b2ceac60f9db19802acc6c69b233556834815e1a9a3d17b2fd331d2577beb356f31a531a6d8fde70f78e9362bd8b6dbc796f906557c82bcd4847a612c788a3 SHA512 7b74fedce91ac597f3cc7a03b401ae7506bc6479faf008f3ea9c0f4783d85c5ce06d71bf73333d4bc1609a2cb96511d931d79f3bc8613906f370f9b4015b30b9
25 DIST asterisk-16.20.0.tar.gz 27888074 BLAKE2B 74f7812db787e5dcb041850fc7e80229e05ef0849cf373be29f9a3ac2eb0f2244fc6f2bd2a3f411c4d37d968184dfbc140e55ad62de53e6beb0b2340179b831c SHA512 0e270c2d00eda1aea3135eba427a77ac2abe66a31c868cf700d5cc26bde65fded6f2191d5e4af361b2e055ae04f2943611ca1fa19815a4a690076a83fb899148
26 +DIST asterisk-16.21.1.tar.gz 27912610 BLAKE2B 75b93fbde52d72906bb613b1d42b7fe592fac9a6af76aabb11dab1bb15b2ad8134f8cfe0a9a58f5f72928e046b0b6111d8e899909d6baca3fd820b583c6acd35 SHA512 399875d3e70e2ebae8b27edc9d97b485d7acfe7a99c1f6e2a6212ccac9cd77fd4e720ccb1cf4d16a441fb8f894d8b9a64785c48bc606a0cfd105d2b7ab16d766
27 DIST asterisk-18.5.1.tar.gz 27953748 BLAKE2B 543f2bfbe1527f3a168dc73d3d9f20e80e95be9de9532a97ff6a5c70a548d525c39ce5251b80dbcd1c0e31c066fc48520e6c373b1404bf24a00b0a48ad134bcd SHA512 95f30c14602587827c7d7bc4652639163f4fe6338fade35d533525aa8825d7a5082c9d6fa4671a5f4f89bd90a0d657ce7e51fd4216558bd367abcb10b25aeb23
28 DIST asterisk-18.6.0.tar.gz 27970531 BLAKE2B a2eaecc962b236e6e455b8d305c05f33fab8e4d6c63eae1506b8354710d6e3e0e3c6da59600555d880520bb58a13950f830057ac03bc82628ab27b2627de52c9 SHA512 17ad7e4dc86f75d4e70f779b6fe6958ee544233b20a36847a6624a7f07b135ddb415f5dca245843ea359e9a6a7c75bfc40ce36fca1df5a7a12549ae522fa2590
29
30 diff --git a/net-misc/asterisk/asterisk-16.21.1.ebuild b/net-misc/asterisk/asterisk-16.21.1.ebuild
31 new file mode 100644
32 index 00000000000..236daff8745
33 --- /dev/null
34 +++ b/net-misc/asterisk/asterisk-16.21.1.ebuild
35 @@ -0,0 +1,365 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +LUA_COMPAT=( lua5-{1..4} )
42 +
43 +inherit autotools linux-info lua-single systemd toolchain-funcs tmpfiles
44 +
45 +DESCRIPTION="Asterisk: A Modular Open Source PBX System"
46 +HOMEPAGE="https://www.asterisk.org/"
47 +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz"
48 +LICENSE="GPL-2"
49 +SLOT="0/${PV%%.*}"
50 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
51 +
52 +IUSE_VOICEMAIL_STORAGE=(
53 + +voicemail_storage_file
54 + voicemail_storage_odbc
55 + voicemail_storage_imap
56 +)
57 +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug deprecated doc freetds gtalk http iconv ilbc ldap lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog systemd unbound vorbis xmpp"
58 +IUSE_EXPAND="VOICEMAIL_STORAGE"
59 +REQUIRED_USE="gtalk? ( xmpp )
60 + lua? ( ${LUA_REQUIRED_USE} )
61 + ^^ ( ${IUSE_VOICEMAIL_STORAGE[*]//+/} )
62 + voicemail_storage_odbc? ( odbc )
63 +"
64 +
65 +PATCHES=(
66 + "${FILESDIR}/${PN}-16.16.2-no-var-run-install.patch"
67 +)
68 +
69 +DEPEND="acct-user/asterisk
70 + acct-group/asterisk
71 + dev-db/sqlite:3
72 + dev-libs/popt
73 + >=dev-libs/jansson-2.11:=
74 + dev-libs/libedit
75 + dev-libs/libxml2:2
76 + dev-libs/libxslt
77 + sys-apps/util-linux
78 + sys-libs/zlib
79 + virtual/libcrypt:=
80 + alsa? ( media-libs/alsa-lib )
81 + bluetooth? ( net-wireless/bluez:= )
82 + calendar? (
83 + net-libs/neon:=
84 + dev-libs/libical:=
85 + dev-libs/iksemel
86 + )
87 + caps? ( sys-libs/libcap )
88 + blocks? ( sys-libs/blocksruntime )
89 + cluster? ( sys-cluster/corosync )
90 + codec2? ( media-libs/codec2:= )
91 + curl? ( net-misc/curl )
92 + dahdi? (
93 + net-libs/libpri
94 + net-misc/dahdi-tools
95 + )
96 + freetds? ( dev-db/freetds )
97 + gtalk? ( dev-libs/iksemel )
98 + http? ( dev-libs/gmime:2.6 )
99 + iconv? ( virtual/libiconv )
100 + ilbc? ( media-libs/libilbc )
101 + ldap? ( net-nds/openldap )
102 + lua? ( ${LUA_DEPS} )
103 + mysql? ( dev-db/mysql-connector-c:= )
104 + newt? ( dev-libs/newt )
105 + odbc? ( dev-db/unixODBC )
106 + pjproject? ( >=net-libs/pjproject-2.9:= )
107 + portaudio? ( media-libs/portaudio )
108 + postgres? ( dev-db/postgresql:* )
109 + radius? ( net-dialup/freeradius-client )
110 + snmp? ( net-analyzer/net-snmp:= )
111 + span? ( media-libs/spandsp )
112 + speex? (
113 + media-libs/libogg
114 + media-libs/speex
115 + media-libs/speexdsp
116 + )
117 + srtp? ( net-libs/libsrtp:0 )
118 + ssl? (
119 + dev-libs/openssl:0=
120 + )
121 + systemd? ( sys-apps/systemd )
122 + !systemd? ( !sys-apps/systemd )
123 + unbound? ( net-dns/unbound )
124 + vorbis? (
125 + media-libs/libogg
126 + media-libs/libvorbis
127 + )
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="dev-libs/libxml2:2
140 + virtual/pkgconfig"
141 +
142 +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
143 +
144 +_make_args=(
145 + "NOISY_BUILD=yes"
146 + "ASTDBDIR=\$(ASTDATADIR)/astdb"
147 + "ASTCACHEDIR=/var/cache/asterisk"
148 + "OPTIMIZE="
149 + "DEBUG="
150 + "DESTDIR=${D}"
151 + "CONFIG_SRC=configs/samples"
152 + "CONFIG_EXTEN=.sample"
153 +)
154 +
155 +pkg_pretend() {
156 + CONFIG_CHECK="~!NF_CONNTRACK_SIP"
157 + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
158 + have reported that this module dropped critical SIP packets in their deployments. You
159 + may want to disable it if you see such problems."
160 + check_extra_config
161 +
162 + [[ "${MERGE_TYPE}" == binary ]] && return
163 +
164 + if tc-is-clang; then
165 + use blocks || die "CC=clang requires USE=blocks"
166 + else
167 + use blocks && die "USE=blocks can only be used with CC=clang"
168 + fi
169 +}
170 +
171 +pkg_setup() {
172 + use lua && lua-single_pkg_setup
173 +}
174 +
175 +src_prepare() {
176 + default
177 + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf
178 +}
179 +
180 +src_configure() {
181 + local vmst
182 + local copt cstate
183 +
184 + econf \
185 + LUA_VERSION="${ELUA#lua}" \
186 + --libdir="/usr/$(get_libdir)" \
187 + --localstatedir="/var" \
188 + --with-crypto \
189 + --with-gsm=internal \
190 + --with-popt \
191 + --with-z \
192 + --with-libedit \
193 + --without-jansson-bundled \
194 + --without-pjproject-bundled \
195 + $(use_with caps cap) \
196 + $(use_with codec2) \
197 + $(use_with lua lua) \
198 + $(use_with http gmime) \
199 + $(use_with newt) \
200 + $(use_with pjproject) \
201 + $(use_with portaudio) \
202 + $(use_with ssl) \
203 + $(use_with unbound)
204 +
205 + _menuselect() {
206 + menuselect/menuselect "$@" || die "menuselect $* failed."
207 + }
208 +
209 + _use_select() {
210 + local state=$(use "$1" && echo enable || echo disable)
211 + shift # remove use from parameters
212 +
213 + while [[ -n $1 ]]; do
214 + _menuselect --${state} "$1" menuselect.makeopts
215 + shift
216 + done
217 + }
218 +
219 + # Blank out sounds/sounds.xml file to prevent
220 + # asterisk from installing sounds files (we pull them in via
221 + # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
222 + >"${S}"/sounds/sounds.xml
223 +
224 + # That NATIVE_ARCH chatter really is quite bothersome
225 + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
226 +
227 + # Compile menuselect binary for optional components
228 + emake "${_make_args[@]}" menuselect.makeopts
229 +
230 + # Disable BUILD_NATIVE (bug #667498)
231 + _menuselect --disable build_native menuselect.makeopts
232 +
233 + # Broken functionality is forcibly disabled (bug #360143)
234 + _menuselect --disable chan_misdn menuselect.makeopts
235 + _menuselect --disable chan_ooh323 menuselect.makeopts
236 +
237 + # Utility set is forcibly enabled (bug #358001)
238 + _menuselect --enable smsq menuselect.makeopts
239 + _menuselect --enable streamplayer menuselect.makeopts
240 + _menuselect --enable aelparse menuselect.makeopts
241 + _menuselect --enable astman menuselect.makeopts
242 +
243 + # this is connected, otherwise it would not find
244 + # ast_pktccops_gate_alloc symbol
245 + _menuselect --enable chan_mgcp menuselect.makeopts
246 + _menuselect --enable res_pktccops menuselect.makeopts
247 +
248 + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
249 + _menuselect --enable pbx_dundi menuselect.makeopts
250 + _menuselect --enable func_aes menuselect.makeopts
251 + _menuselect --enable chan_iax2 menuselect.makeopts
252 +
253 + # SQlite3 is now the main database backend, enable related features
254 + _menuselect --enable cdr_sqlite3_custom menuselect.makeopts
255 + _menuselect --enable cel_sqlite3_custom menuselect.makeopts
256 +
257 + # The others are based on USE-flag settings
258 + _use_select alsa chan_alsa
259 + _use_select bluetooth chan_mobile
260 + _use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
261 + _use_select cluster res_corosync
262 + _use_select codec2 codec_codec2
263 + _use_select curl func_curl res_config_curl res_curl
264 + _use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
265 + _use_select deprecated app_macro
266 + _use_select freetds {cdr,cel}_tds
267 + _use_select gtalk chan_motif
268 + _use_select http res_http_post
269 + _use_select iconv func_iconv
270 + _use_select ilbc codec_ilbc format_ilbc
271 + _use_select ldap res_config_ldap
272 + _use_select lua pbx_lua
273 + _use_select mysql app_mysql cdr_mysql res_config_mysql
274 + _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
275 + _use_select oss chan_oss
276 + _use_select postgres {cdr,cel}_pgsql res_config_pgsql
277 + _use_select radius {cdr,cel}_radius
278 + _use_select snmp res_snmp
279 + _use_select span res_fax_spandsp
280 + _use_select speex {codec,func}_speex
281 + _use_select speex format_ogg_speex
282 + _use_select srtp res_srtp
283 + _use_select statsd res_statsd res_{endpoint,chan}_stats
284 + _use_select syslog cdr_syslog
285 + _use_select vorbis format_ogg_vorbis
286 + _use_select xmpp res_xmpp
287 +
288 + # Voicemail storage ...
289 + for vmst in "${IUSE_VOICEMAIL_STORAGE[@]}"; do
290 + if use "${vmst#+}"; then
291 + _menuselect --enable "$(echo "${vmst##*_}" | tr '[:lower:]' '[:upper:]')_STORAGE" menuselect.makeopts
292 + fi
293 + done
294 +
295 + if use debug; then
296 + for o in DONT_OPTIMIZE DEBUG_FD_LEAKS MALLOC_DEBUG BETTER_BACKTRACES; do
297 + _menuselect --enable "${o}" menuselect.makeopts
298 + done
299 + fi
300 +
301 + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then
302 + for copt in ${GENTOO_ASTERISK_CUSTOM_MENUSELECT}; do
303 + cstate=--enable
304 + [[ "${copt}" == -* ]] && cstate=--disable
305 + ebegin "Custom option ${copt#[-+]} ${cstate:2}d"
306 + _menuselect ${cstate} "${copt#[-+]}"
307 + eend $?
308 + done
309 + fi
310 +}
311 +
312 +src_compile() {
313 + emake "${_make_args[@]}"
314 +}
315 +
316 +src_install() {
317 + local d
318 +
319 + dodir "/usr/$(get_libdir)/pkgconfig"
320 +
321 + diropts -m 0750 -o root -g asterisk
322 + dodir /etc/asterisk
323 +
324 + emake "${_make_args[@]}" install install-configs
325 +
326 + fowners asterisk: /var/lib/asterisk/astdb
327 +
328 + if use radius; then
329 + insinto /etc/radiusclient/
330 + doins contrib/dictionary.digium
331 + fi
332 +
333 + # keep directories
334 + diropts -m 0750 -o asterisk -g root
335 + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording,outgoing}
336 + diropts -m 0750 -o asterisk -g asterisk
337 + keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
338 +
339 + newinitd "${FILESDIR}"/initd-16.16.2-r1 asterisk
340 + newconfd "${FILESDIR}"/confd-16.16.2-r1 asterisk
341 +
342 + systemd_dounit "${FILESDIR}"/asterisk.service
343 + newtmpfiles "${FILESDIR}"/asterisk.tmpfiles3.conf asterisk.conf
344 + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf
345 +
346 + # Reset diropts else dodoc uses it for doc installations.
347 + diropts -m0755
348 +
349 + # install the upgrade documentation
350 + dodoc UPGRADE* BUGS CREDITS
351 +
352 + # install extra documentation
353 + use doc && dodoc doc/*.{txt,pdf}
354 +
355 + # install logrotate snippet; bug #329281
356 + #
357 + insinto /etc/logrotate.d
358 + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk
359 +
360 + # Asterisk installs a few folders that's empty by design,
361 + # but still required. This finds them, and marks them for
362 + # portage.
363 + while read d <&3; do
364 + keepdir "${d#${ED}}"
365 + done 3< <(find "${ED}"/var -type d -empty || die "Find failed.")
366 +}
367 +
368 +pkg_postinst() {
369 + tmpfiles_process asterisk.conf
370 +
371 + if [ -z "${REPLACING_VERSIONS}" ]; then
372 + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
373 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
374 + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then
375 + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:"
376 + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)"
377 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
378 + fi
379 +
380 + if use deprecated; then
381 + ewarn "You really aught to port whatever code you have that depends on this since these are going to go away."
382 + ewarn "Refer: https://wiki.asterisk.org/wiki/display/AST/Module+Deprecation"
383 + fi
384 +
385 + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then
386 + ewarn "You are using GENTOO_ASTERISK_CUSTOM_MENUSELECT, this should only be used"
387 + ewarn "for debugging, for anything else, please file a bug on https://bugs.gentoo.org"
388 + fi
389 +
390 + if [[ -f /var/lib/asterisk/astdb.sqlite3 ]]; then
391 + ewarn "Default astdb location has changed from /var/lib/asterisk to /var/lib/asterisk/astdb"
392 + ewarn "You still have a /var/lib/asterisk/astdb.sqlite file. You need to either set"
393 + ewarn "astdbdir in /etc/asterisk/asterisk.conf to /var/lib/asterisk or follow these"
394 + ewarn "steps to migrate:"
395 + ewarn "1. /etc/init.d/asterisk stop"
396 + ewarn "2. mv /var/lib/asterisk/astdb.sqlite /var/lib/asterisk/astdb/"
397 + ewarn "3. /etc/init.d/asterisk start"
398 + ewarn "This update was done partly for security reasons so that /var/lib/asterisk can be root owned."
399 + fi
400 +}