dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-misc / asterisk-extra-sounds / asterisk-extra-sounds-1.5.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 DESCRIPTION="Extra sounds for asterisk"
7 HOMEPAGE="https://www.asterisk.org/"
8 MY_L10N="^en en_GB fr" # ^ is used to indicate to the loops below to NOT set this as an optional
9 CODECS="alaw g722 g729 +gsm siren7 siren14 sln16 ulaw wav"
10
11 SRC_URI=""
12 IUSE="${CODECS}"
13 for l in ${MY_L10N}; do
14         [[ "${l}" != ^* ]] && IUSE+=" l10n_${l//_/-}" && SRC_URI+=" l10n_${l//_/-}? ("
15         for c in ${CODECS}; do
16                 SRC_URI+=" ${c#+}? ( https://downloads.asterisk.org/pub/telephony/sounds/releases/${PN}-${l#^}-${c#+}-${PV}.tar.gz )"
17         done
18         [[ "${l}" = ^* ]] || SRC_URI+=" )"
19 done
20
21 REQUIRED_USE="|| ( ${CODECS//+/} )"
22
23 LICENSE="CC-BY-SA-3.0"
24 SLOT="0"
25 KEYWORDS="amd64 ppc ~ppc64 x86"
26
27 BLACKLIST=("astcc-followed-by-the-pound-key")
28
29 S="${WORKDIR}"
30
31 src_unpack() {
32         local ar
33         local l c b
34
35         for ar in ${A}; do
36                 l="${ar#${PN}-}"
37                 l=${l%%-*}
38                 c="${ar#${PN}-*-}"
39                 c=${c%%-*}
40                 ebegin "Unpacking ${c} audio files for \"${l}\""
41                 [ -d "${WORKDIR}/${l}" ] || mkdir "${WORKDIR}/${l}" || die "Error creating unpack directory"
42                 tar xf "${DISTDIR}/${ar}" -C "${WORKDIR}/${l}" || die "Error unpacking ${ar}"
43                 eend $?
44
45                 for b in "${BLACKLIST[@]}"; do
46                         [ -r "${WORKDIR}/${l}/${b}.${c}" ] && rm "${WORKDIR}/${l}/${b}.${c}"
47                 done
48         done
49 }
50
51 src_install() {
52         local l
53         local pf
54         for l in ${MY_L10N}; do
55                 if [[ "${l}" = ^* ]] || use l10n_${l//_/-}; then
56                         l="${l#^}"
57                         dodoc ${l}/${PN#asterisk-}-${l}.txt
58                         rm ${l}/${PN#asterisk-}-${l}.txt
59                         for pf in CHANGES CREDITS LICENSE; do
60                                 dodoc ${l}/${pf}-${PN%-sounds}-${l}-${PV}
61                                 rm ${l}/${pf}-${PN%-sounds}-${l}-${PV}
62                         done
63                 fi
64         done
65
66         diropts -m 0755 -o root -g root
67         insopts -m 0644 -o root -g root
68
69         insinto /var/lib/asterisk/sounds
70         doins -r .
71 }