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