asterisk-core-sounds - extra sound files of asterisk

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Mar 29 13:01:56 UTC 2010


On Sun, Mar 21, 2010 at 11:04:24AM +0100, Jonas Smedegaard wrote:
> On Sun, Mar 21, 2010 at 07:00:01AM +0200, Tzafrir Cohen wrote:
>> On Sun, Mar 21, 2010 at 03:16:33AM +0100, Jonas Smedegaard wrote:
>>> On Sat, Mar 20, 2010 at 11:55:50PM +0200, Tzafrir Cohen wrote:
>
>>>> Look at  
>>>> http://svn.debian.org/viewsvn/pkg-voip/asterisk-sounds/asterisk-core-sounds/ 
>>>> Please explain how packages from it could be used with  
>>>> update-alternatives .
>>>>
>>>> This package builds 9 different binary packages:
>>>>
>>>>  asterisk-core-sounds-{en,es,fr}-{g722,gsm,wav}
>>>>
>>>> All three asterisk-core-sounds-en-* packages install files to the  
>>>> same directory. They install the same files with a different  
>>>> extension. Thus they are not mutually exlcusive. And thus each of  
>>>> them makes that directory a sane candidate for the symlink  
>>>> /usr/share/asterisk/sounds/en . (The same applies to the two other  
>>>> languages).
>>>>
>>>> Thus I can't simply run 'update-alternatives --install' in the  
>>>> postinst and 'update-alternatives --remove' in the prerm. I should  
>>>> only add it if it was not already added (easy: just check) and  
>>>> remove it only if nobody uses it (that's the difficult part).
>>>>
>>>> I can't think of a simple and robust definition of "nobody's using  
>>>> it". Something that comes close i to keep an independent registry 
>>>> of some sort of all the candidate packages. Another way is to look 
>>>> for some specific file in the directory. But this means I have to 
>>>> run things in the postrm. Furthermore I don't like that hueristic.
>>>
>>> Ah, I understand the issue now, I believe.  Yes, update-alternatives  
>>> handle alternatives between "atomic" objects.  So the solution is  
>>> simple as I see it:
>>>
>>> Just ship the various sound formats together.  I see no problem then:
>>>
>>>   asterisk-core-sounds-{en,es,fr} (each containing g722, gsm and wav)
>>
>> I do.
>>
>> 7.7M asterisk-core-sounds-en-g722_1.4.17-1_all.deb
>> 1.8M asterisk-core-sounds-en-gsm_1.4.17-1_all.deb
>> 15M asterisk-core-sounds-en-wav_1.4.17-1_all.deb
>
> No you don't.  You ship packages containing g722, gsm *or* wav.
>
> This is what I suggested:
>
> 24.5M asterisk-core-sounds-en_1.4.17-1_all.deb
>
> ...but read below for a better suggestion.
>
>
>
>> Sometimes it makes sense to have just the gsm ones. In fact, in many  
>> cases (this is what I'll probably do inthe next live CD. This is the  
>> current default).
>
> Ah, ok.  Then ship it like this:
>
> asterisk-core-sounds-en-g722_1.4.17-1_all.deb
>   Depends: asterisk-core-sounds-en-gsm
>   Provides: asterisk-sounds-en, asterisk-sounds-en-us
>
> asterisk-core-sounds-en-gsm_1.4.17-1_all.deb
>   Register-alternatives: /usr/share/asterisk/sounds/en,
>     /usr/share/asterisk/sounds/en_US
>   Recommends: asterisk-core-sounds-en-g722,
>     asterisk-core-sounds-en-wav
>   Provides: asterisk-sounds-en, asterisk-sounds-en-us
>
> asterisk-core-sounds-en-wav_1.4.17-1_all.deb
>   Depends: asterisk-core-sounds-en-gsm
>   Provides: asterisk-sounds-en, asterisk-sounds-en-us

While I'm not happy with this solution, I've adapted the en, fr and es
packages to use it (except the package asterisk-prompt-es-co that is not
maintained by this team. Anybody from Avatar reading this?). I didn't
get to the packages of other languages yet.


A package that installs the alternatives xx and xx_YY also provides
asterisk-prompt-xx and asterisk-prompt-xx-yy . If there are different
packages for multiple formats, only one of them should provide it.
Prefferably the smallest one.

As a side note, asterisk-prompt-fr-proformatique currently has wav
files, but I see no reason why there won't be an e.g. an extra package
of gsm files for the same prompts. In that case we'll have to change the
provider of the alternatives.

This also implies that if you just install 'asterisk-prompt-xx' or
asterisk-prompt-xx-yy' you're likely to get gsm files.

Anyway, this package is acumulating more and more fixes unrelated to
those of the sound files (e.g.: a minor fix regarding the patht that is
required for the mph package).

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the Pkg-voip-maintainers mailing list