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