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