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: Sat, 05 Nov 2022 13:41:38
Message-Id: 1667655408.ab5b82368d12163dab9b3bd9d4a81d636e41b4eb.juippis@gentoo
1 commit: ab5b82368d12163dab9b3bd9d4a81d636e41b4eb
2 Author: Jaco Kroon <jaco <AT> uls <DOT> co <DOT> za>
3 AuthorDate: Sat Oct 22 09:50:32 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 5 13:36:48 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab5b8236
7
8 net-misc/asterisk: add 18.15.0
9
10 Closes: https://bugs.gentoo.org/872194
11 Signed-off-by: Jaco Kroon <jaco <AT> uls.co.za>
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 net-misc/asterisk/Manifest | 1 +
15 net-misc/asterisk/asterisk-18.15.0.ebuild | 375 ++++++++++++++++++++++++++++++
16 2 files changed, 376 insertions(+)
17
18 diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
19 index 0342cfe83532..4bac52c7e2a3 100644
20 --- a/net-misc/asterisk/Manifest
21 +++ b/net-misc/asterisk/Manifest
22 @@ -2,3 +2,4 @@ DIST asterisk-16.26.1.tar.gz 28001023 BLAKE2B d426566827bd3466720f94eed04a654eda
23 DIST asterisk-16.27.0.tar.gz 28014649 BLAKE2B 785650674bb2762ab898118cf49aa2cddde60f7e42df0a882751e36053f3cfb7de94475acf6bd484a1998c04b1edd1dca2ee4e9895bf9e411d9b09f91f7a4743 SHA512 ae016a79f8c38c5ae0069d0fa7434a564c8a72efa69135ce17dc7febf220a189ef47aba064ab39a2f49be0f7d5138b36e29f2d004ba51aa3724708efce645d1e
24 DIST asterisk-16.29.0.tar.gz 28105953 BLAKE2B a17dbbb1f717ba6d03da71f761f063a5b95e71f50378cf6bc3abdbaf1bcbac462be1b051c1fe1812a6f2c9082c9928a85ea60346dae742149f230ab8ec6c997f SHA512 7a83778c406dbb7d1e0eebc4eb9f51c841fc5fc987445014e685ade9e143bb81e2fb4870a6ddaf3e4721e75bbd5d6468c9d896616bb1411bad84ac6ca510d69b
25 DIST asterisk-18.13.0.tar.gz 28127627 BLAKE2B 24e030d5226fb3cad8e2fedce951fab047afbdf5556821bc246acc3731f25398d47eac7b7e0a97f019d9e97cc6f8990967019db62845f21f3b3459a2c3fced02 SHA512 085dfcf15f99d7d96b49a720156678c4de5a88b55375257a9a1234f9dd83f21eed1685d4177dae5978272608e690582367c6c34fdef91bbad54299594d0ce9df
26 +DIST asterisk-18.15.0.tar.gz 28219845 BLAKE2B 712e14bcc2f24b645c39fdfbae19771134e065a9f83187e6578aeb70686a19e66faef4fb700089379274b7fbe9f99cdeec92761fa734926b3bb5db2f02cad8ff SHA512 acf202246e149ddc44ffb688a834455420d6ab53989560568cdccf0da121821ee946c45085c964b52632e24109741908d3f4c00ca00d0b4a9402c128becd9e28
27
28 diff --git a/net-misc/asterisk/asterisk-18.15.0.ebuild b/net-misc/asterisk/asterisk-18.15.0.ebuild
29 new file mode 100644
30 index 000000000000..6f67640cb4aa
31 --- /dev/null
32 +++ b/net-misc/asterisk/asterisk-18.15.0.ebuild
33 @@ -0,0 +1,375 @@
34 +# Copyright 1999-2022 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 oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog 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}/${PN}-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 + syslog? ( virtual/logger )"
134 +
135 +BDEPEND="dev-libs/libxml2:2
136 + virtual/pkgconfig"
137 +
138 +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
139 +
140 +_make_args=(
141 + "NOISY_BUILD=yes"
142 + "ASTDBDIR=\$(ASTDATADIR)/astdb"
143 + "ASTVARRUNDIR=/run/asterisk"
144 + "ASTCACHEDIR=/var/cache/asterisk"
145 + "OPTIMIZE="
146 + "DEBUG="
147 + "DESTDIR=${D}"
148 + "CONFIG_SRC=configs/samples"
149 + "CONFIG_EXTEN=.sample"
150 +)
151 +
152 +pkg_pretend() {
153 + CONFIG_CHECK="~!NF_CONNTRACK_SIP"
154 + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
155 + have reported that this module dropped critical SIP packets in their deployments. You
156 + may want to disable it if you see such problems."
157 + check_extra_config
158 +
159 + [[ "${MERGE_TYPE}" == binary ]] && return
160 +
161 + if tc-is-clang; then
162 + use blocks || die "CC=clang requires USE=blocks"
163 + else
164 + use blocks && die "USE=blocks can only be used with CC=clang"
165 + fi
166 +}
167 +
168 +pkg_setup() {
169 + use lua && lua-single_pkg_setup
170 +}
171 +
172 +src_prepare() {
173 + default
174 + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" \
175 + AC_CONFIG_SUBDIRS=menuselect 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 astdb2* tools. We've been on sqlite long enough
229 + # that this should really no longer be a problem (bug #https://bugs.gentoo.org/872194)
230 + _menuselect --disable astdb2sqlite3 menuselect.makeopts
231 + _menuselect --disable astdb2bdb menuselect.makeopts
232 +
233 + # Disable BUILD_NATIVE (bug #667498)
234 + _menuselect --disable build_native menuselect.makeopts
235 +
236 + # Broken functionality is forcibly disabled (bug #360143)
237 + _menuselect --disable chan_misdn menuselect.makeopts
238 + _menuselect --disable chan_ooh323 menuselect.makeopts
239 +
240 + # Utility set is forcibly enabled (bug #358001)
241 + _menuselect --enable smsq menuselect.makeopts
242 + _menuselect --enable streamplayer menuselect.makeopts
243 + _menuselect --enable aelparse menuselect.makeopts
244 + _menuselect --enable astman menuselect.makeopts
245 +
246 + # this is connected, otherwise it would not find
247 + # ast_pktccops_gate_alloc symbol
248 + _menuselect --enable chan_mgcp menuselect.makeopts
249 + _menuselect --enable res_pktccops menuselect.makeopts
250 +
251 + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
252 + _menuselect --enable pbx_dundi menuselect.makeopts
253 + _menuselect --enable func_aes menuselect.makeopts
254 + _menuselect --enable chan_iax2 menuselect.makeopts
255 +
256 + # SQlite3 is now the main database backend, enable related features
257 + _menuselect --enable cdr_sqlite3_custom menuselect.makeopts
258 + _menuselect --enable cel_sqlite3_custom menuselect.makeopts
259 +
260 + # Disable conversion tools (which fails to compile in some cases).
261 + _menuselect --disable astdb2bdb menuselect.makeopts
262 +
263 + # The others are based on USE-flag settings
264 + _use_select alsa chan_alsa
265 + _use_select bluetooth chan_mobile
266 + _use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
267 + _use_select cluster res_corosync
268 + _use_select codec2 codec_codec2
269 + _use_select curl func_curl res_config_curl res_curl
270 + _use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
271 + _use_select deprecated app_macro
272 + _use_select freetds {cdr,cel}_tds
273 + _use_select gtalk chan_motif
274 + _use_select http res_http_post
275 + _use_select iconv func_iconv
276 + _use_select ilbc codec_ilbc format_ilbc
277 + _use_select ldap res_config_ldap
278 + _use_select lua pbx_lua
279 + _use_select mysql app_mysql cdr_mysql res_config_mysql
280 + _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
281 + _use_select oss chan_oss
282 + _use_select postgres {cdr,cel}_pgsql res_config_pgsql
283 + _use_select radius {cdr,cel}_radius
284 + _use_select snmp res_snmp
285 + _use_select span res_fax_spandsp
286 + _use_select speex {codec,func}_speex
287 + _use_select speex format_ogg_speex
288 + _use_select srtp res_srtp
289 + _use_select statsd res_statsd res_{endpoint,chan}_stats
290 + _use_select syslog cdr_syslog
291 + _use_select vorbis format_ogg_vorbis
292 + _use_select xmpp res_xmpp
293 +
294 + # Voicemail storage ...
295 + _menuselect --enable app_voicemail menuselect.makeopts
296 + for vmst in "${IUSE_VOICEMAIL_STORAGE[@]}"; do
297 + if use "${vmst#+}"; then
298 + _menuselect --enable "app_voicemail_${vmst##*_}" menuselect.makeopts
299 + fi
300 + done
301 +
302 + if use debug; then
303 + for o in DONT_OPTIMIZE DEBUG_FD_LEAKS MALLOC_DEBUG BETTER_BACKTRACES; do
304 + _menuselect --enable "${o}" menuselect.makeopts
305 + done
306 + fi
307 +
308 + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then
309 + for copt in ${GENTOO_ASTERISK_CUSTOM_MENUSELECT}; do
310 + cstate=--enable
311 + [[ "${copt}" == -* ]] && cstate=--disable
312 + ebegin "Custom option ${copt#[-+]} ${cstate:2}d"
313 + _menuselect ${cstate} "${copt#[-+]}"
314 + eend $?
315 + done
316 + fi
317 +}
318 +
319 +src_compile() {
320 + emake "${_make_args[@]}"
321 +}
322 +
323 +src_install() {
324 + local d
325 +
326 + dodir "/usr/$(get_libdir)/pkgconfig"
327 +
328 + diropts -m 0750 -o root -g asterisk
329 + dodir /etc/asterisk
330 +
331 + emake "${_make_args[@]}" install install-headers install-configs
332 +
333 + fowners asterisk: /var/lib/asterisk/astdb
334 +
335 + if use radius; then
336 + insinto /etc/radiusclient/
337 + doins contrib/dictionary.digium
338 + fi
339 +
340 + # keep directories
341 + diropts -m 0750 -o asterisk -g root
342 + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording,outgoing}
343 + diropts -m 0750 -o asterisk -g asterisk
344 + keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
345 +
346 + newsbin "${FILESDIR}/asterisk_wrapper-16.26.1-18.12.1" asterisk_wrapper
347 + newinitd "${FILESDIR}"/initd-16.26.1-18.12.1 asterisk
348 + newconfd "${FILESDIR}"/confd-16.26.1-18.12.1 asterisk
349 +
350 + systemd_dounit "${FILESDIR}"/asterisk.service
351 + newtmpfiles "${FILESDIR}"/asterisk.tmpfiles-16.22.0-18.8.0.conf asterisk.conf
352 + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf
353 +
354 + # Reset diropts else dodoc uses it for doc installations.
355 + diropts -m0755
356 +
357 + # install the upgrade documentation
358 + dodoc UPGRADE* BUGS CREDITS
359 +
360 + # install extra documentation
361 + use doc && dodoc doc/*.{txt,pdf}
362 +
363 + # install logrotate snippet; bug #329281
364 + #
365 + insinto /etc/logrotate.d
366 + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk
367 +
368 + # Asterisk installs a few folders that's empty by design,
369 + # but still required. This finds them, and marks them for
370 + # portage.
371 + while read d <&3; do
372 + keepdir "${d#${ED}}"
373 + done 3< <(find "${ED}"/var -type d -empty || die "Find failed.")
374 +}
375 +
376 +pkg_postinst() {
377 + tmpfiles_process asterisk.conf
378 +
379 + if [ -z "${REPLACING_VERSIONS}" ]; then
380 + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
381 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
382 + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then
383 + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:"
384 + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)"
385 + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
386 + fi
387 +
388 + if use deprecated; then
389 + ewarn "You really aught to port whatever code you have that depends on this since these are going to go away."
390 + ewarn "Refer: https://wiki.asterisk.org/wiki/display/AST/Module+Deprecation"
391 + fi
392 +
393 + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then
394 + ewarn "You are using GENTOO_ASTERISK_CUSTOM_MENUSELECT, this should only be used"
395 + ewarn "for debugging, for anything else, please file a bug on https://bugs.gentoo.org"
396 + fi
397 +
398 + if [[ -f /var/lib/asterisk/astdb.sqlite3 ]]; then
399 + ewarn "Default astdb location has changed from /var/lib/asterisk to /var/lib/asterisk/astdb"
400 + ewarn "You still have a /var/lib/asterisk/astdb.sqlite file. You need to either set"
401 + ewarn "astdbdir in /etc/asterisk/asterisk.conf to /var/lib/asterisk or follow these"
402 + ewarn "steps to migrate:"
403 + ewarn "1. /etc/init.d/asterisk stop"
404 + ewarn "2. mv /var/lib/asterisk/astdb.sqlite /var/lib/asterisk/astdb/"
405 + ewarn "3. /etc/init.d/asterisk start"
406 + ewarn "This update was done partly for security reasons so that /var/lib/asterisk can be root owned."
407 + fi
408 +}