woo-hoo, now it knows how to download the sound packages... doesn't install them...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 7 Jun 2006 20:54:30 +0000 (20:54 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 7 Jun 2006 20:54:30 +0000 (20:54 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32886 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
build_tools/prep_moduledeps
build_tools/sounds.xml [deleted file]
sounds/Makefile [new file with mode: 0644]
sounds/sounds.xml [new file with mode: 0644]

index 12ba256..8767300 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,8 @@
 
 .EXPORT_ALL_VARIABLES:
 
+.PHONY: sounds
+
 # Create OPTIONS variable
 OPTIONS=
 
@@ -378,7 +380,7 @@ _all: all
        @echo " +               make install                +"  
        @echo " +-------------------------------------------+"  
 
-all: cleantest config.status menuselect.makeopts depend asterisk subdirs
+all: cleantest config.status menuselect.makeopts depend asterisk subdirs sounds
 
 config.status: configure
        @CFLAGS="" ./configure
@@ -533,52 +535,6 @@ datafiles: all
        for x in static-http/*; do \
                $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
        done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/digits
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/priv-callerintros
-       for x in sounds/digits/*.gsm; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds/digits ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/dictate
-       for x in sounds/dictate/*.gsm; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds/dictate ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/letters
-       for x in sounds/letters/*.gsm; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds/letters ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/phonetic
-       for x in sounds/phonetic/*.gsm; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds/phonetic ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/mohmp3
        mkdir -p $(DESTDIR)$(ASTDATADIR)/images
        for x in images/*.jpg; do \
                $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
@@ -640,7 +596,6 @@ bininstall: all
        if [ -n "$(OLDHEADERS)" ]; then \
                rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
        fi
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds
        mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
        mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
        mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
@@ -762,20 +717,6 @@ samples: adsi
        else \
                echo "Skipping asterisk.conf creation"; \
        fi
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds ; \
-       for x in sounds/demo-*; do \
-               if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
-                       $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/sounds ; \
-               else \
-                       echo "No description for $$x"; \
-                       exit 1; \
-               fi; \
-       done
-       mkdir -p $(DESTDIR)$(ASTDATADIR)/mohmp3 ; \
-       for x in sounds/*.mp3; do \
-               $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/mohmp3 ; \
-       done
-       rm -f $(DESTDIR)$(ASTDATADIR)/mohmp3/sample-hold.mp3
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
        :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
        for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
@@ -905,6 +846,9 @@ FORCE:
 %_env:
        $(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
 
+sounds:
+       $(MAKE) -C sounds all
+
 env:
        env
 
@@ -924,7 +868,6 @@ _uninstall:
        rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
        rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
        rm -rf $(DESTDIR)$(ASTHEADERDIR)
-       rm -rf $(DESTDIR)$(ASTDATADIR)/sounds
        rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
        rm -rf $(DESTDIR)$(ASTMANDIR)/man8
        for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done
@@ -961,6 +904,6 @@ mxml/libmxml.a:
        @cd mxml && unset CFLAGS LIBS && test -f config.h || ./configure
        $(MAKE) -C mxml libmxml.a
 
-makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(dir)/*.c) build_tools/cflags.xml build_tools/sounds.xml
+makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(dir)/*.c) build_tools/cflags.xml sounds/sounds.xml
        @echo "Generating list of available modules ..."
        @build_tools/prep_moduledeps > $@
index cc366a2..457bcb9 100755 (executable)
@@ -57,5 +57,5 @@ process_dir funcs func FUNCS "Dialplan Functions"
 process_dir pbx pbx PBX "PBX Modules"
 process_dir res res RES "Resource Modules"
 cat build_tools/cflags.xml
-cat build_tools/sounds.xml
+cat sounds/sounds.xml
 echo "</menu>"
diff --git a/build_tools/sounds.xml b/build_tools/sounds.xml
deleted file mode 100644 (file)
index 77bff7b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-       <category name="MENUSELECT_CORE_SOUNDS" displayname="Core Sound Packages" positive_output="yes">
-               <member name="CORE_SOUNDS_EN_WAV" displayname="English, WAV format">
-               </member>
-               <member name="CORE_SOUNDS_EN_ULAW" displayname="English, mu-Law format">
-               </member>
-               <member name="CORE_SOUNDS_EN_ALAW" displayname="English, a-Law format">
-               </member>
-               <member name="CORE_SOUNDS_EN_GSM" displayname="English, GSM format" >
-                       <defaultenabled>yes</defaultenabled>
-               </member>
-               <member name="CORE_SOUNDS_EN_G729" displayname="English, G.729 format">
-               </member>
-               <member name="CORE_SOUNDS_ES_WAV" displayname="Spanish, WAV format">
-               </member>
-               <member name="CORE_SOUNDS_ES_ULAW" displayname="Spanish, mu-Law format">
-               </member>
-               <member name="CORE_SOUNDS_ES_ALAW" displayname="Spanish, a-Law format">
-               </member>
-               <member name="CORE_SOUNDS_ES_GSM" displayname="Spanish, GSM format">
-               </member>
-               <member name="CORE_SOUNDS_ES_G729" displayname="Spanish, G.729 format">
-               </member>
-               <member name="CORE_SOUNDS_FR_WAV" displayname="French, WAV format">
-               </member>
-               <member name="CORE_SOUNDS_FR_ULAW" displayname="French, mu-Law format">
-               </member>
-               <member name="CORE_SOUNDS_FR_ALAW" displayname="French, a-Law format">
-               </member>
-               <member name="CORE_SOUNDS_FR_GSM" displayname="French, GSM format">
-               </member>
-               <member name="CORE_SOUNDS_FR_G729" displayname="French, G.729 format">
-               </member>
-       </category>
-       <category name="MENUSELECT_EXTRA_SOUNDS" displayname="Extras Sound Packages" positive_output="yes">
-               <member name="EXTRA_SOUNDS_EN_WAV" displayname="English, WAV format">
-               </member>
-               <member name="EXTRA_SOUNDS_EN_ULAW" displayname="English, mu-Law format">
-               </member>
-               <member name="EXTRA_SOUNDS_EN_ALAW" displayname="English, a-Law format">
-               </member>
-               <member name="EXTRA_SOUNDS_EN_GSM" displayname="English, GSM format" >
-               </member>
-               <member name="EXTRA_SOUNDS_EN_G729" displayname="English, G.729 format">
-               </member>
-       </category>
diff --git a/sounds/Makefile b/sounds/Makefile
new file mode 100644 (file)
index 0000000..aa65a87
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+# 
+# Makefile for sound files
+#
+# Copyright (C) 2006, Digium, Inc.
+#
+# Kevin P. Fleming <kpfleming@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+include ../menuselect.makeopts
+
+CORE_SOUNDS_VERSION:=1.4.0
+SOUNDS_URL:="http://cork.digium.internal/apache2-default"
+MENUSELECT_CORE_SOUNDS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -FR-,-fr-,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -ES-,-es-,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -WAV,-wav,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -ULAW,-ulaw,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -ALAW,-alaw,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -GSM,-gsm,$(MENUSELECT_CORE_SOUNDS))
+MENUSELECT_CORE_SOUNDS:=$(subst -G729,-g729,$(MENUSELECT_CORE_SOUNDS))
+CORE_SOUNDS:=$(MENUSELECT_CORE_SOUNDS:CORE-SOUNDS-%=asterisk-core-sounds-%-$(CORE_SOUNDS_VERSION).tar.gz)
+MENUSELECT_EXTRA_SOUNDS:=$(subst -EN-,-en-,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -FR-,-fr-,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -ES-,-es-,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -WAV,-wav,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -ULAW,-ulaw,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -ALAW,-alaw,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -GSM,-gsm,$(MENUSELECT_EXTRA_SOUNDS))
+MENUSELECT_EXTRA_SOUNDS:=$(subst -G729,-g729,$(MENUSELECT_EXTRA_SOUNDS))
+EXTRA_SOUNDS:=$(MENUSELECT_EXTRA_SOUNDS:EXTRA-SOUNDS-%=asterisk-extra-sounds-%.tar.gz)
+MENUSELECT_MOH:=$(subst -FREEPLAY-,-freeplay-,$(MENUSELECT_MOH))
+MENUSELECT_MOH:=$(subst -MP3,-mp3,$(MENUSELECT_MOH))
+MOH:=$(MENUSELECT_MOH:MOH-%=asterisk-moh-%.tar.gz)
+
+%.gz:
+       @wget --no-verbose --continue $(SOUNDS_URL)/$@
+
+all:   $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
+
+clean:
+
+install: all
+       mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds
+       mkdir -p $(DESTDIR)$(ASTDATADIR)/mohmp3
+
+uninstall:
+       rm -rf $(DESTDIR)$(ASTDATADIR)/sounds
+       rm -rf $(DESTDIR)$(ASTDATADIR)/mohmp3
diff --git a/sounds/sounds.xml b/sounds/sounds.xml
new file mode 100644 (file)
index 0000000..59c74a3
--- /dev/null
@@ -0,0 +1,50 @@
+       <category name="MENUSELECT_CORE_SOUNDS" displayname="Core Sound Packages" positive_output="yes">
+               <member name="CORE-SOUNDS-EN-WAV" displayname="English, WAV format">
+               </member>
+               <member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
+               </member>
+               <member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format">
+               </member>
+               <member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" >
+                       <defaultenabled>yes</defaultenabled>
+               </member>
+               <member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format">
+               </member>
+               <member name="CORE-SOUNDS-ES-WAV" displayname="Spanish, WAV format">
+               </member>
+               <member name="CORE-SOUNDS-ES-ULAW" displayname="Spanish, mu-Law format">
+               </member>
+               <member name="CORE-SOUNDS-ES-ALAW" displayname="Spanish, a-Law format">
+               </member>
+               <member name="CORE-SOUNDS-ES-GSM" displayname="Spanish, GSM format">
+               </member>
+               <member name="CORE-SOUNDS-ES-G729" displayname="Spanish, G.729 format">
+               </member>
+               <member name="CORE-SOUNDS-FR-WAV" displayname="French, WAV format">
+               </member>
+               <member name="CORE-SOUNDS-FR-ULAW" displayname="French, mu-Law format">
+               </member>
+               <member name="CORE-SOUNDS-FR-ALAW" displayname="French, a-Law format">
+               </member>
+               <member name="CORE-SOUNDS-FR-GSM" displayname="French, GSM format">
+               </member>
+               <member name="CORE-SOUNDS-FR-G729" displayname="French, G.729 format">
+               </member>
+       </category>
+       <category name="MENUSELECT_MOH" displayname="Music On Hold File Package" positive_output="yes">
+               <member name="MOH-FREEPLAY-MP3" displayname="FreePlay Music On Hold Files, MP3 format" >
+                       <defaultenabled>yes</defaultenabled>
+               </member>
+       </category>
+       <category name="MENUSELECT_EXTRA_SOUNDS" displayname="Extras Sound Packages" positive_output="yes">
+               <member name="EXTRA-SOUNDS-EN-WAV" displayname="English, WAV format">
+               </member>
+               <member name="EXTRA-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
+               </member>
+               <member name="EXTRA-SOUNDS-EN-ALAW" displayname="English, a-Law format">
+               </member>
+               <member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" >
+               </member>
+               <member name="EXTRA-SOUNDS-EN-G729" displayname="English, G.729 format">
+               </member>
+       </category>