2 # Asterisk -- A telephony toolkit for Linux.
4 # Makefile for sound files
6 # Copyright (C) 2006, Digium, Inc.
8 # Kevin P. Fleming <kpfleming@digium.com>
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
14 .PHONY
: dist-clean
all uninstall have_download
install
16 -include $(ASTTOPDIR
)/menuselect.makeopts
$(ASTTOPDIR
)/makeopts
19 SOUNDS_DIR
:=$(DESTDIR
)$(ASTDATADIR
)/sounds
20 MOH_DIR
:=$(DESTDIR
)$(ASTDATADIR
)/moh
21 CORE_SOUNDS_VERSION
:=1.4.9
22 EXTRA_SOUNDS_VERSION
:=1.4.7
23 SOUNDS_URL
:=http
://downloads.digium.com
/pub
/telephony
/sounds
/releases
24 MCS
:=$(subst -EN-
,-en-
,$(MENUSELECT_CORE_SOUNDS
))
25 MCS
:=$(subst -FR-
,-fr-
,$(MCS
))
26 MCS
:=$(subst -ES-
,-es-
,$(MCS
))
27 MCS
:=$(subst -WAV
,-wav
,$(MCS
))
28 MCS
:=$(subst -ULAW
,-ulaw
,$(MCS
))
29 MCS
:=$(subst -ALAW
,-alaw
,$(MCS
))
30 MCS
:=$(subst -GSM
,-gsm
,$(MCS
))
31 MCS
:=$(subst -G729
,-g729
,$(MCS
))
32 MCS
:=$(subst -G722
,-g722
,$(MCS
))
33 CORE_SOUNDS
:=$(MCS
:CORE-SOUNDS-
%=asterisk-core-sounds-
%-$(CORE_SOUNDS_VERSION
).
tar.gz
)
34 CORE_SOUND_TAGS
:=$(MCS
:CORE-SOUNDS-
%=$(SOUNDS_DIR
)/.asterisk-core-sounds-
%-$(CORE_SOUNDS_VERSION
))
35 MES
:=$(subst -EN-
,-en-
,$(MENUSELECT_EXTRA_SOUNDS
))
36 MES
:=$(subst -FR-
,-fr-
,$(MES
))
37 MES
:=$(subst -ES-
,-es-
,$(MES
))
38 MES
:=$(subst -WAV
,-wav
,$(MES
))
39 MES
:=$(subst -ULAW
,-ulaw
,$(MES
))
40 MES
:=$(subst -ALAW
,-alaw
,$(MES
))
41 MES
:=$(subst -GSM
,-gsm
,$(MES
))
42 MES
:=$(subst -G729
,-g729
,$(MES
))
43 MES
:=$(subst -G722
,-g722
,$(MES
))
44 EXTRA_SOUNDS
:=$(MES
:EXTRA-SOUNDS-
%=asterisk-extra-sounds-
%-$(EXTRA_SOUNDS_VERSION
).
tar.gz
)
45 EXTRA_SOUND_TAGS
:=$(MES
:EXTRA-SOUNDS-
%=$(SOUNDS_DIR
)/.asterisk-extra-sounds-
%-$(EXTRA_SOUNDS_VERSION
))
46 MM
:=$(subst -FREEPLAY-
,-freeplay-
,$(MENUSELECT_MOH
))
47 MM
:=$(subst -WAV
,-wav
,$(MM
))
48 MM
:=$(subst -ULAW
,-ulaw
,$(MM
))
49 MM
:=$(subst -ALAW
,-alaw
,$(MM
))
50 MM
:=$(subst -GSM
,-gsm
,$(MM
))
51 MM
:=$(subst -G729
,-g729
,$(MM
))
52 MM
:=$(subst -G722
,-g722
,$(MM
))
53 MOH
:=$(MM
:MOH-
%=asterisk-moh-
%.
tar.gz
)
54 MOH_TAGS
:=$(MM
:MOH-
%=$(MOH_DIR
)/.asterisk-moh-
%)
55 # If "fetch" is used, --continue is not a valid option.
60 all: $(CORE_SOUNDS
) $(EXTRA_SOUNDS
) $(MOH
)
63 @if
test "$(DOWNLOAD)" = ":" ; then \
64 echo
"**************************************************"; \
66 echo
"*** You must have either wget or fetch to be ***"; \
67 echo
"*** able to automatically download and install ***"; \
68 echo
"*** the requested sound packages. ***"; \
70 echo
"*** Please install one of these, or remove any ***"; \
71 echo
"*** extra sound package selections in ***"; \
72 echo
"*** menuselecct before installing Asterisk. ***"; \
74 echo
"**************************************************"; \
78 $(SOUNDS_DIR
)/.asterisk-core-sounds-en-
%: have_download
79 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
80 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
81 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
82 rm -f
$(subst -$(CORE_SOUNDS_VERSION
),,$@
)-* && \
83 (cd
$(SOUNDS_DIR
); cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
86 $(SOUNDS_DIR
)/.asterisk-core-sounds-es-
%: have_download
87 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
88 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
89 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
90 rm -f
$(subst -$(CORE_SOUNDS_VERSION
),,$@
)-* && \
91 (cd
$(SOUNDS_DIR
)/es
; cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
94 $(SOUNDS_DIR
)/.asterisk-core-sounds-fr-
%: have_download
95 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
96 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
97 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
98 rm -f
$(subst -$(CORE_SOUNDS_VERSION
),,$@
)-* && \
99 (cd
$(SOUNDS_DIR
)/fr
; cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
102 $(SOUNDS_DIR
)/.asterisk-extra-sounds-en-
%: have_download
103 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
104 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
105 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
106 rm -f
$(subst -$(EXTRA_SOUNDS_VERSION
),,$@
)-* && \
107 (cd
$(SOUNDS_DIR
); cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
110 $(SOUNDS_DIR
)/.asterisk-extra-sounds-es-
%: have_download
111 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
112 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
113 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
114 rm -f
$(subst -$(EXTRA_SOUNDS_VERSION
),,$@
)-* && \
115 (cd
$(SOUNDS_DIR
)/es
; cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
118 $(SOUNDS_DIR
)/.asterisk-extra-sounds-fr-
%: have_download
119 @PACKAGE
=$(subst $(SOUNDS_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
120 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
121 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
122 rm -f
$(subst -$(EXTRA_SOUNDS_VERSION
),,$@
)-* && \
123 (cd
$(SOUNDS_DIR
)/fr
; cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
126 $(MOH_DIR
)/.asterisk-moh-
%: have_download
127 @PACKAGE
=$(subst $(MOH_DIR
)/.asterisk
,asterisk
,$@
).
tar.gz
; \
128 if
test ! -f
$${PACKAGE}; then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$${PACKAGE}; fi
; \
129 if
test ! -f
$${PACKAGE}; then exit
1; fi
; \
130 (cd
$(MOH_DIR
); cat
$(PWD
)/$${PACKAGE} | gzip
-d |
tar xf
-) && \
133 asterisk-core-
%.
tar.gz
: have_download
134 @if
test ! -f
$@
;then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$@
;fi
136 asterisk-extra-
%.
tar.gz
: have_download
137 @if
test ! -f
$@
;then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$@
;fi
139 asterisk-moh-
%.
tar.gz
: have_download
140 @if
test ! -f
$@
;then
$(DOWNLOAD
) $(WGET_ARGS
) $(SOUNDS_URL
)/$@
;fi
145 $(SOUNDS_DIR
) $(MOH_DIR
) $(SOUNDS_DIR
)/es
$(SOUNDS_DIR
)/fr
:
148 install: $(SOUNDS_DIR
) $(SOUNDS_DIR
)/es
$(SOUNDS_DIR
)/fr
$(MOH_DIR
) $(CORE_SOUND_TAGS
) $(EXTRA_SOUND_TAGS
) $(MOH_TAGS
)
155 @echo
$(CORE_SOUNDS_VERSION
)
157 extra_sounds_version
:
158 @echo
$(EXTRA_SOUNDS_VERSION
)