commit 8418e71a850bd40b1091e1d313cd2c6100371aa6da55aecc7db37142258167ca Author: Jan Engelhardt Date: Mon Mar 26 02:03:54 2012 +0000 Initial package OBS-URL: https://build.opensuse.org/package/show/network:telephony/asterisk-sounds-devel?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/asterisk-sounds-devel.changes b/asterisk-sounds-devel.changes new file mode 100644 index 0000000..68c5059 --- /dev/null +++ b/asterisk-sounds-devel.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Mon Mar 26 01:19:53 UTC 2012 - jengelh@medozas.de + +- Initial package for build.opensuse.org diff --git a/asterisk-sounds-devel.spec b/asterisk-sounds-devel.spec new file mode 100644 index 0000000..2d04ebb --- /dev/null +++ b/asterisk-sounds-devel.spec @@ -0,0 +1,46 @@ +# +# spec file for package asterisk-sounds-devel +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# +Name: asterisk-sounds-devel +Version: 0 +Release: 0 +Summary: Build helpers for Asterisk sound packages +Group: Development/Tools/Building +License: Public Domain + +Source1: macros.asterisk-sounds +BuildRoot: %_tmppath/%name-%version-build +BuildArch: noarch + +%description +This package contains additional RPM macros to help build Asterisk +sound packages. + +%prep + +%build + +%install +c="%buildroot/%_sysconfdir/rpm"; +mkdir -p "$c"; +install -pm0644 "%{S:1}" "$c/"; + +%files +%defattr(-,root,root) +%dir %_sysconfdir/rpm +%config %_sysconfdir/rpm/macros.* + +%changelog diff --git a/macros.asterisk-sounds b/macros.asterisk-sounds new file mode 100644 index 0000000..fe4a5a3 --- /dev/null +++ b/macros.asterisk-sounds @@ -0,0 +1,71 @@ +# -*- spec -*- +# Helper macros for creating manifold Asterisk sound packages +# written by Jan Engelhardt +# released into the Public Domain + + +# +# -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 "./%sdir/$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 %sdir" >>"$fldir/sounds-$pkg.files"; \ + echo "%%lang($lang) %%dir %sdir/$lang" >>"$fldir/sounds-$pkg.files"; \ +\ + find "./%sdir/$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";