1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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"
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 )"
18 [[ "${l}" = ^* ]] || SRC_URI+=" )"
21 REQUIRED_USE="|| ( ${CODECS//+/} )"
23 LICENSE="CC-BY-SA-3.0"
25 KEYWORDS="amd64 ppc ~ppc64 x86"
27 BLACKLIST=("astcc-followed-by-the-pound-key")
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}"
45 for b in "${BLACKLIST[@]}"; do
46 [ -r "${WORKDIR}/${l}/${b}.${c}" ] && rm "${WORKDIR}/${l}/${b}.${c}"
54 for l in ${MY_L10N}; do
55 if [[ "${l}" = ^* ]] || use l10n_${l//_/-}; then
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}
66 diropts -m 0755 -o root -g root
67 insopts -m 0644 -o root -g root
69 insinto /var/lib/asterisk/sounds