forked from pool/asterisk-sounds-devel
Jan Engelhardt
c03294305d
OBS-URL: https://build.opensuse.org/package/show/network:telephony/asterisk-sounds-devel?expand=0&rev=2
74 lines
3.1 KiB
Plaintext
74 lines
3.1 KiB
Plaintext
# -*- spec -*-
|
||
# Helper macros for creating manifold Asterisk sound packages
|
||
# written by Jan Engelhardt <jengelh@medozas.de>
|
||
# released into the Public Domain
|
||
|
||
|
||
%asterisk_sounds_dir %_datadir/asterisk/sounds
|
||
|
||
#
|
||
# -l code ISO 639-1/-3 language code
|
||
# -L name Descriptive language name (no U+0020 spaces allowed)
|
||
# -f code Per-format extension
|
||
# -F name Descriptive format text
|
||
#
|
||
%asterisk_snd_generic(l:f:L:F:) %{expand: \
|
||
%%package %{-l*}-%{-f*} \
|
||
Summary: Asterisk PBX sound files - %{-L*}, %{-F*} \
|
||
Group: Productivity/Telephony/Servers \
|
||
\
|
||
%%description %{-l*}-%{-f*} \
|
||
Asterisk includes a set of standard sound files in various formats. \
|
||
This package contains the core part of that collection in \
|
||
%{-L*} in %{-F*} coding. \
|
||
\
|
||
%%files %{-l*}-%{-f*} -f asterisk-sounds-%{-l*}-%{-f*}.files \
|
||
%%defattr(-,root,root) \
|
||
}
|
||
|
||
%asterisk_snd_alaw(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f alaw -F 8 kHz A-law}
|
||
%asterisk_snd_g722(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f g722 -F G.722}
|
||
%asterisk_snd_g729(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f g729 -F G.729}
|
||
%asterisk_snd_gsm(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f gsm -F GSM}
|
||
%asterisk_snd_siren7(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f siren7 -F Siren7}
|
||
%asterisk_snd_siren14(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f siren14 -F Siren14}
|
||
%asterisk_snd_sln16(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f sln16 -F 16 kHz LPCM}
|
||
%asterisk_snd_ulaw(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f ulaw -F 8 kHz µ-law}
|
||
%asterisk_snd_wav(l:L:) %{expand:%%asterisk_snd_generic %{-l*} %{-L*} -f wav -F 8 kHz LPCM}
|
||
|
||
%asterisk_lng_en(f:) %{expand:%%asterisk_snd_%{-f*} -l en -L English (US)}
|
||
%asterisk_lng_en_AU(f:) %{expand:%%asterisk_snd_%{-f*} -l en_AU -L English (Australian)}
|
||
%asterisk_lng_es(f:) %{expand:%%asterisk_snd_%{-f*} -l es -L Spanish}
|
||
%asterisk_lng_fr(f:) %{expand:%%asterisk_snd_%{-f*} -l fr -L French}
|
||
%asterisk_lng_ru(f:) %{expand:%%asterisk_snd_%{-f*} -l ru -L Russian}
|
||
|
||
%asterisk_sound_package(Z) %{expand:%(
|
||
for i in %*; do
|
||
lang="${i%%%%-*}";
|
||
fmt="${i##*-}";
|
||
echo "%%asterisk_lng_$lang -f $fmt";
|
||
done;
|
||
)}
|
||
|
||
%asterisk_collect_sndfiles(Z) \
|
||
for pkg in %*; do \
|
||
pushd "$b"; \
|
||
find "./%asterisk_sounds_dir/$lang" -type f -iname "*.$ext" >"$fldir/tmp.files"; \
|
||
perl -pe 's{^\./+}{%%lang('$lang') /}g' \
|
||
<"$fldir/tmp.files" >"$fldir/sounds-$pkg.files"; \
|
||
perl -pe 's{^\./*(/.*)/.+$}{%%lang('$lang') %%dir $1}g;' \
|
||
<"$fldir/tmp.files" | sort -u >>"$fldir/sounds-$pkg.files"; \
|
||
echo "%%lang($lang) %%dir %_datadir/asterisk" >>"$fldir/sounds-$pkg.files"; \
|
||
echo "%%lang($lang) %%dir %asterisk_sounds_dir" >>"$fldir/sounds-$pkg.files"; \
|
||
echo "%%lang($lang) %%dir %asterisk_sounds_dir/$lang" >>"$fldir/sounds-$pkg.files"; \
|
||
\
|
||
find "./%asterisk_sounds_dir/$lang" -type f "(" -iname "*.txt" \
|
||
-o -name "[A-Z]*" ")" >>"$fldir/rest1.files"; \
|
||
\
|
||
popd; \
|
||
done; \
|
||
\
|
||
perl -ne 's{^\./*(/.*)/.+$}{%%dir $1}g;' <"rest1.files" >"rest.dirs"; \
|
||
perl -pe 's{^\./+}{/}g;' <"rest1.files" | sort -u >"rest.files"; \
|
||
cat <"rest.dirs" >>"rest.files";
|