Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/asterisk-extra-sounds/
Date: Fri, 27 Sep 2019 15:16:49
Message-Id: 1569597378.fb8636cb17581b5f7e0ff62539d33b93f3f40306.mgorny@gentoo
1 commit: fb8636cb17581b5f7e0ff62539d33b93f3f40306
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 27 15:16:18 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 27 15:16:18 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb8636cb
7
8 net-misc/asterisk-extra-sounds: Bump to EAPI 7
9
10 Bump the ebuild to EAPI 7. Use bash arrays, and clean the code up
11 a bit. Replace postinst no-flag warning with REQUIRED_USE since
12 the package fails to build when no codec is enabled.
13
14 Bug: https://bugs.gentoo.org/688512
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 .../asterisk-extra-sounds-1.4.11-r1.ebuild | 57 ++++++++++++++++++++++
18 1 file changed, 57 insertions(+)
19
20 diff --git a/net-misc/asterisk-extra-sounds/asterisk-extra-sounds-1.4.11-r1.ebuild b/net-misc/asterisk-extra-sounds/asterisk-extra-sounds-1.4.11-r1.ebuild
21 new file mode 100644
22 index 00000000000..4ec2a9e70bc
23 --- /dev/null
24 +++ b/net-misc/asterisk-extra-sounds/asterisk-extra-sounds-1.4.11-r1.ebuild
25 @@ -0,0 +1,57 @@
26 +# Copyright 1999-2019 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +DESCRIPTION="Extra sounds for asterisk"
32 +HOMEPAGE="http://www.asterisk.org/"
33 +MY_L10N=(^en fr) # ^ is used to indicate to the loops below to NOT set this as an optional
34 +CODECS=(alaw g722 g729 +gsm siren7 siren14 sln16 ulaw wav)
35 +
36 +SRC_URI=""
37 +IUSE="${CODECS[*]}"
38 +REQUIRED_USE="|| ( ${CODECS[*]#+} )"
39 +for l in "${MY_L10N[@]}"; do
40 + [[ ${l} != ^* ]] && IUSE+=" l10n_${l}" && SRC_URI+=" l10n_${l}? ("
41 + for c in "${CODECS[@]}"; do
42 + SRC_URI+=" ${c#+}? ( http://downloads.asterisk.org/pub/telephony/sounds/releases/${PN}-${l#^}-${c#+}-${PV}.tar.gz )"
43 + done
44 + [[ ${l} == ^* ]] || SRC_URI+=" )"
45 +done
46 +
47 +LICENSE="CC-BY-SA-3.0"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~ppc ~x86"
50 +
51 +DEPEND=">=net-misc/asterisk-1.4"
52 +
53 +S="${WORKDIR}"
54 +
55 +src_unpack() {
56 + local ar
57 + for ar in ${A}; do
58 + local l="${ar#${PN}-}"
59 + l=${l%%-*}
60 + mkdir -p "${WORKDIR}/${l}" || die
61 + cd "${WORKDIR}/${l}" || die
62 + unpack "${ar}"
63 + done
64 +}
65 +
66 +src_install() {
67 + local l
68 + for l in "${MY_L10N[@]}"; do
69 + if [[ ${l} == ^* ]] || use "l10n_${l}"; then
70 + l="${l#^}"
71 + dodoc "${l}/CHANGES-${PN%-sounds}-${l}-${PV}" \
72 + "${l}/${PN#asterisk-}-${l}.txt"
73 + rm "${l}/CHANGES-${PN%-sounds}-${l}-${PV}" \
74 + "${l}/${PN#asterisk-}-${l}.txt" || die
75 + fi
76 + done
77 +
78 + diropts -m 0770 -o asterisk -g asterisk
79 + insopts -m 0660 -o asterisk -g asterisk
80 + insinto /var/lib/asterisk/sounds
81 + doins -r .
82 +}