dd3a3a3e520015573ff368d6c2b3bcb924be2010
[asterisk/asterisk.git] / sounds / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Makefile for sound files
5 #
6 # Copyright (C) 2006, Digium, Inc.
7 #
8 # Kevin P. Fleming <kpfleming@digium.com>
9 #
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
12 #
13
14 include ../menuselect.makeopts
15
16 PWD:=$(shell pwd)
17 SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
18 MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
19 CORE_SOUNDS_VERSION:=1.4.0
20 SOUNDS_URL:=http://ftp.digium.com/pub/telephony/sounds/releases
21 MOH_URL:=http://ftp.digium.com/pub/telephony/sounds
22 MENUSELECT_CORE_SOUNDS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))
23 MENUSELECT_CORE_SOUNDS:=$(subst -FR-,-fr-,$(MENUSELECT_CORE_SOUNDS))
24 MENUSELECT_CORE_SOUNDS:=$(subst -ES-,-es-,$(MENUSELECT_CORE_SOUNDS))
25 MENUSELECT_CORE_SOUNDS:=$(subst -WAV,-wav,$(MENUSELECT_CORE_SOUNDS))
26 MENUSELECT_CORE_SOUNDS:=$(subst -ULAW,-ulaw,$(MENUSELECT_CORE_SOUNDS))
27 MENUSELECT_CORE_SOUNDS:=$(subst -ALAW,-alaw,$(MENUSELECT_CORE_SOUNDS))
28 MENUSELECT_CORE_SOUNDS:=$(subst -GSM,-gsm,$(MENUSELECT_CORE_SOUNDS))
29 MENUSELECT_CORE_SOUNDS:=$(subst -G729,-g729,$(MENUSELECT_CORE_SOUNDS))
30 CORE_SOUNDS:=$(MENUSELECT_CORE_SOUNDS:CORE-SOUNDS-%=asterisk-core-sounds-%-$(CORE_SOUNDS_VERSION).tar.gz)
31 CORE_SOUND_TAGS:=$(MENUSELECT_CORE_SOUNDS:CORE-SOUNDS-%=$(SOUNDS_DIR)/.asterisk-core-sounds-%-$(CORE_SOUNDS_VERSION))
32 MENUSELECT_EXTRA_SOUNDS:=$(subst -EN-,-en-,$(MENUSELECT_EXTRA_SOUNDS))
33 MENUSELECT_EXTRA_SOUNDS:=$(subst -FR-,-fr-,$(MENUSELECT_EXTRA_SOUNDS))
34 MENUSELECT_EXTRA_SOUNDS:=$(subst -ES-,-es-,$(MENUSELECT_EXTRA_SOUNDS))
35 MENUSELECT_EXTRA_SOUNDS:=$(subst -WAV,-wav,$(MENUSELECT_EXTRA_SOUNDS))
36 MENUSELECT_EXTRA_SOUNDS:=$(subst -ULAW,-ulaw,$(MENUSELECT_EXTRA_SOUNDS))
37 MENUSELECT_EXTRA_SOUNDS:=$(subst -ALAW,-alaw,$(MENUSELECT_EXTRA_SOUNDS))
38 MENUSELECT_EXTRA_SOUNDS:=$(subst -GSM,-gsm,$(MENUSELECT_EXTRA_SOUNDS))
39 MENUSELECT_EXTRA_SOUNDS:=$(subst -G729,-g729,$(MENUSELECT_EXTRA_SOUNDS))
40 EXTRA_SOUNDS:=$(MENUSELECT_EXTRA_SOUNDS:EXTRA-SOUNDS-%=asterisk-extra-sounds-%.tar.gz)
41 MENUSELECT_MOH:=$(subst -FREEPLAY-,-freeplay-,$(MENUSELECT_MOH))
42 MENUSELECT_MOH:=$(subst -WAV,-wav,$(MENUSELECT_MOH))
43 MENUSELECT_MOH:=$(subst -ULAW,-ulaw,$(MENUSELECT_MOH))
44 MENUSELECT_MOH:=$(subst -ALAW,-alaw,$(MENUSELECT_MOH))
45 MENUSELECT_MOH:=$(subst -GSM,-gsm,$(MENUSELECT_MOH))
46 MENUSELECT_MOH:=$(subst -G729,-g729,$(MENUSELECT_MOH))
47 MOH:=$(MENUSELECT_MOH:MOH-%=asterisk-moh-%.tar.gz)
48 MOH_TAGS:=$(MENUSELECT_MOH:MOH-%=$(MOH_DIR)/.asterisk-moh-%)
49 WGET_ARGS:=--continue
50
51 $(SOUNDS_DIR)/.asterisk-core-sounds-en-%:
52         @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
53         if ! test -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
54         if ! test -f $${PACKAGE}; then exit 1; fi; \
55         rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
56         (cd $(SOUNDS_DIR); tar xzf $(PWD)/$${PACKAGE}) && \
57         touch $@
58
59 $(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: $(SOUNDS_DIR)/fr
60         @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
61         if ! test -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
62         if ! test -f $${PACKAGE}; then exit 1; fi; \
63         rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
64         (cd $(SOUNDS_DIR)/fr; tar xzf $(PWD)/$${PACKAGE}) && \
65         touch $@
66
67 $(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: $(SOUNDS_DIR)/es
68         @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
69         if ! test -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
70         if ! test -f $${PACKAGE}; then exit 1; fi; \
71         rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
72         (cd $(SOUNDS_DIR)/es; tar xzf $(PWD)/$${PACKAGE}) && \
73         touch $@
74
75 $(MOH_DIR)/.asterisk-moh-%:
76         @PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \
77         if ! test -f $${PACKAGE}; then wget $(WGET_ARGS) $(MOH_URL)/$${PACKAGE}; fi; \
78         if ! test -f $${PACKAGE}; then exit 1; fi; \
79         (cd $(MOH_DIR); tar xzf $(PWD)/$${PACKAGE}) && \
80         touch $@
81
82 asterisk-core-%.tar.gz:
83         @wget $(WGET_ARGS) $(SOUNDS_URL)/$@
84
85 asterisk-extra-%.tar.gz:
86         @wget $(WGET_ARGS) $(MOH_URL)/$@
87
88 asterisk-moh-%.tar.gz:
89         @wget $(WGET_ARGS) $(MOH_URL)/$@
90
91 all:    $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
92
93 dist-clean:
94         rm -f *.tar.gz
95
96 $(SOUNDS_DIR) $(MOH_DIR) $(SOUNDS_DIR)/%:
97         mkdir -p $@
98
99 install: $(SOUNDS_DIR) $(MOH_DIR) $(CORE_SOUND_TAGS) $(MOH_TAGS)
100
101 uninstall:
102         rm -rf $(SOUNDS_DIR)
103         rm -rf $(MOH_DIR)