2006-06-07 20:54:30 +00:00
|
|
|
#
|
2012-10-14 21:56:13 +00:00
|
|
|
# Asterisk -- An open source telephony toolkit.
|
2017-12-22 14:23:22 +00:00
|
|
|
#
|
2006-06-07 20:54:30 +00:00
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2006-12-01 23:20:17 +00:00
|
|
|
.PHONY: dist-clean all uninstall have_download install
|
2006-06-22 11:27:03 +00:00
|
|
|
|
2006-12-01 23:20:17 +00:00
|
|
|
-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts
|
2006-06-07 20:54:30 +00:00
|
|
|
|
2010-05-17 23:49:15 +00:00
|
|
|
CMD_PREFIX?=@
|
2011-08-25 15:30:46 +00:00
|
|
|
SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
|
2010-05-17 23:49:15 +00:00
|
|
|
SOUNDS_CACHE_DIR?=
|
2011-08-25 15:30:46 +00:00
|
|
|
MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
|
2018-01-25 00:25:04 +00:00
|
|
|
CORE_SOUNDS_VERSION:=1.6.1
|
|
|
|
EXTRA_SOUNDS_VERSION:=1.5.2
|
2010-05-06 17:06:40 +00:00
|
|
|
MOH_VERSION:=2.03
|
2009-05-28 22:42:27 +00:00
|
|
|
SOUNDS_URL:=http://downloads.asterisk.org/pub/telephony/sounds/releases
|
2006-09-20 22:58:03 +00:00
|
|
|
MCS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))
|
2010-10-18 22:14:05 +00:00
|
|
|
MCS:=$(subst -EN_AU-,-en_AU-,$(MCS))
|
2013-10-29 23:43:58 +00:00
|
|
|
MCS:=$(subst -EN_GB-,-en_GB-,$(MCS))
|
2017-07-13 20:43:42 +00:00
|
|
|
MCS:=$(subst -EN_NZ-,-en_NZ-,$(MCS))
|
2006-09-20 22:58:03 +00:00
|
|
|
MCS:=$(subst -FR-,-fr-,$(MCS))
|
|
|
|
MCS:=$(subst -ES-,-es-,$(MCS))
|
2011-04-27 12:37:13 +00:00
|
|
|
MCS:=$(subst -RU-,-ru-,$(MCS))
|
2013-04-29 23:36:42 +00:00
|
|
|
MCS:=$(subst -IT-,-it-,$(MCS))
|
2014-09-09 20:11:10 +00:00
|
|
|
MCS:=$(subst -JA-,-ja-,$(MCS))
|
2015-05-07 22:49:07 +00:00
|
|
|
MCS:=$(subst -SV-,-sv-,$(MCS))
|
2006-09-20 22:58:03 +00:00
|
|
|
MCS:=$(subst -WAV,-wav,$(MCS))
|
|
|
|
MCS:=$(subst -ULAW,-ulaw,$(MCS))
|
|
|
|
MCS:=$(subst -ALAW,-alaw,$(MCS))
|
|
|
|
MCS:=$(subst -GSM,-gsm,$(MCS))
|
|
|
|
MCS:=$(subst -G729,-g729,$(MCS))
|
2006-10-25 17:12:59 +00:00
|
|
|
MCS:=$(subst -G722,-g722,$(MCS))
|
2008-03-06 04:45:16 +00:00
|
|
|
MCS:=$(subst -SLN16,-sln16,$(MCS))
|
2009-02-27 15:51:56 +00:00
|
|
|
MCS:=$(subst -SIREN7,-siren7,$(MCS))
|
|
|
|
MCS:=$(subst -SIREN14,-siren14,$(MCS))
|
2006-09-20 22:58:03 +00:00
|
|
|
CORE_SOUNDS:=$(MCS:CORE-SOUNDS-%=asterisk-core-sounds-%-$(CORE_SOUNDS_VERSION).tar.gz)
|
2011-08-25 15:30:46 +00:00
|
|
|
CORE_SOUND_TAGS:=$(MCS:CORE-SOUNDS-%=.asterisk-core-sounds-%-$(CORE_SOUNDS_VERSION))
|
2006-09-20 22:58:03 +00:00
|
|
|
MES:=$(subst -EN-,-en-,$(MENUSELECT_EXTRA_SOUNDS))
|
2014-04-18 17:17:25 +00:00
|
|
|
MES:=$(subst -EN_GB-,-en_GB-,$(MES))
|
2006-09-20 22:58:03 +00:00
|
|
|
MES:=$(subst -FR-,-fr-,$(MES))
|
|
|
|
MES:=$(subst -WAV,-wav,$(MES))
|
|
|
|
MES:=$(subst -ULAW,-ulaw,$(MES))
|
|
|
|
MES:=$(subst -ALAW,-alaw,$(MES))
|
|
|
|
MES:=$(subst -GSM,-gsm,$(MES))
|
|
|
|
MES:=$(subst -G729,-g729,$(MES))
|
2006-10-25 17:12:59 +00:00
|
|
|
MES:=$(subst -G722,-g722,$(MES))
|
2009-02-27 15:51:56 +00:00
|
|
|
MES:=$(subst -SLN16,-sln16,$(MES))
|
|
|
|
MES:=$(subst -SIREN7,-siren7,$(MES))
|
|
|
|
MES:=$(subst -SIREN14,-siren14,$(MES))
|
2006-09-20 22:58:03 +00:00
|
|
|
EXTRA_SOUNDS:=$(MES:EXTRA-SOUNDS-%=asterisk-extra-sounds-%-$(EXTRA_SOUNDS_VERSION).tar.gz)
|
2011-08-25 15:30:46 +00:00
|
|
|
EXTRA_SOUND_TAGS:=$(MES:EXTRA-SOUNDS-%=.asterisk-extra-sounds-%-$(EXTRA_SOUNDS_VERSION))
|
2009-08-18 20:29:37 +00:00
|
|
|
MM:=$(subst -OPSOUND-,-opsound-,$(MENUSELECT_MOH))
|
2006-09-20 22:58:03 +00:00
|
|
|
MM:=$(subst -WAV,-wav,$(MM))
|
|
|
|
MM:=$(subst -ULAW,-ulaw,$(MM))
|
|
|
|
MM:=$(subst -ALAW,-alaw,$(MM))
|
|
|
|
MM:=$(subst -GSM,-gsm,$(MM))
|
|
|
|
MM:=$(subst -G729,-g729,$(MM))
|
2006-10-25 17:12:59 +00:00
|
|
|
MM:=$(subst -G722,-g722,$(MM))
|
2008-10-09 20:00:46 +00:00
|
|
|
MM:=$(subst -SLN16,-sln16,$(MM))
|
2009-02-27 15:51:56 +00:00
|
|
|
MM:=$(subst -SIREN7,-siren7,$(MM))
|
|
|
|
MM:=$(subst -SIREN14,-siren14,$(MM))
|
2010-05-06 17:06:40 +00:00
|
|
|
MOH:=$(MM:MOH-%=asterisk-moh-%-$(MOH_VERSION).tar.gz)
|
2011-08-25 15:30:46 +00:00
|
|
|
MOH_TAGS:=$(MM:MOH-%=.asterisk-moh-%-$(MOH_VERSION))
|
2006-12-03 06:35:46 +00:00
|
|
|
# If "fetch" is used, --continue is not a valid option.
|
2010-05-18 22:49:13 +00:00
|
|
|
ifneq ($(findstring wget,$(DOWNLOAD)),)
|
|
|
|
DOWNLOAD+=--continue $(WGET_EXTRA_ARGS)
|
2006-12-03 06:35:46 +00:00
|
|
|
endif
|
2006-06-07 22:03:02 +00:00
|
|
|
|
2010-05-17 23:49:15 +00:00
|
|
|
|
|
|
|
define sound_format_lang_rule
|
2011-08-25 15:30:46 +00:00
|
|
|
.PHONY: .asterisk-$(2)$(if $(3),-$(3),)-%
|
|
|
|
|
|
|
|
.asterisk-$(2)$(if $(3),-$(3),)-%: asterisk-$(2)$(if $(3),-$(3),)-%.tar.gz
|
2010-07-28 18:25:00 +00:00
|
|
|
$(CMD_PREFIX) \
|
2011-08-25 15:30:46 +00:00
|
|
|
if test ! -f "$(1)$(if $(3),/$(3),)/$$@"; then \
|
|
|
|
PACKAGE=$$(subst .asterisk,asterisk,$$@).tar.gz; \
|
2010-07-28 18:25:00 +00:00
|
|
|
( \
|
2011-08-25 15:30:46 +00:00
|
|
|
mkdir -p "$(1)$(if $(3),/$(3),)"; \
|
|
|
|
cd "$(1)$(if $(3),/$(3),)"; \
|
|
|
|
rm -f $$(subst -$(4),,$$@)-*; \
|
|
|
|
cat $$(CURDIR)/$$$${PACKAGE} | gzip -d | tar xof - \
|
|
|
|
) && touch "$(1)$(if $(3),/$(3),)/$$@"; \
|
|
|
|
fi
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2011-08-25 15:30:46 +00:00
|
|
|
asterisk-$(2)$(if $(3),-$(3),)-%.tar.gz: have_download
|
|
|
|
ifneq ($(SOUNDS_CACHE_DIR),)
|
|
|
|
$(CMD_PREFIX) \
|
|
|
|
if test ! -f "$(1)$(if $(3),/$(3),)/.$$(subst .tar.gz,,$$@)"; then \
|
|
|
|
if test ! -d "$$(SOUNDS_CACHE_DIR)/"; then \
|
|
|
|
mkdir -p "$$(SOUNDS_CACHE_DIR)/"; \
|
|
|
|
fi; \
|
|
|
|
if test ! -f "$$(SOUNDS_CACHE_DIR)/$$@"; then \
|
|
|
|
(cd "$$(SOUNDS_CACHE_DIR)"; $$(DOWNLOAD) $$(SOUNDS_URL)/$$@); \
|
|
|
|
fi; \
|
|
|
|
if test ! -f "$$(SOUNDS_CACHE_DIR)/$$@.sha1"; then \
|
|
|
|
(cd "$$(SOUNDS_CACHE_DIR)"; $$(DOWNLOAD) $$(SOUNDS_URL)/$$@.sha1); \
|
|
|
|
fi; \
|
|
|
|
$$(LN) -sf "$$(SOUNDS_CACHE_DIR)/$$@" .; \
|
|
|
|
$$(LN) -sf "$$(SOUNDS_CACHE_DIR)/$$@.sha1" .; \
|
|
|
|
$$(SHA1SUM) -c --status $$@.sha1 || \
|
|
|
|
( \
|
|
|
|
rm -f "$$(SOUNDS_CACHE_DIR)/$$@" "$$(SOUNDS_CACHE_DIR)/$$@.sha1" $$@ $$@.sha1; \
|
|
|
|
echo "Bad checksum: $$@" 1>&2; \
|
|
|
|
exit 1; \
|
|
|
|
) || exit 1; \
|
|
|
|
fi
|
2010-05-17 23:49:15 +00:00
|
|
|
else
|
2011-08-25 15:30:46 +00:00
|
|
|
$(CMD_PREFIX) \
|
|
|
|
if test ! -f $$@ && test ! -f "$(1)$(if $(3),/$(3),)/.$$(subst .tar.gz,,$$@)"; then \
|
2010-07-26 23:06:47 +00:00
|
|
|
$$(DOWNLOAD) $$(SOUNDS_URL)/$$@; \
|
2010-05-17 23:49:15 +00:00
|
|
|
fi
|
|
|
|
endif
|
2011-08-25 15:30:46 +00:00
|
|
|
endef # sound_format_lang_rule
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2011-08-25 15:30:46 +00:00
|
|
|
all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
|
2006-06-25 08:50:14 +00:00
|
|
|
|
2006-12-01 23:20:17 +00:00
|
|
|
have_download:
|
|
|
|
@if test "$(DOWNLOAD)" = ":" ; then \
|
|
|
|
echo "**************************************************"; \
|
|
|
|
echo "*** ***"; \
|
2018-03-09 12:26:40 +00:00
|
|
|
echo "*** You must have either wget, curl, or fetch ***"; \
|
|
|
|
echo "*** to be able to automatically download and ***"; \
|
|
|
|
echo "*** install the requested sound packages. ***"; \
|
2006-12-01 23:20:17 +00:00
|
|
|
echo "*** ***"; \
|
|
|
|
echo "*** Please install one of these, or remove any ***"; \
|
|
|
|
echo "*** extra sound package selections in ***"; \
|
2010-10-18 22:14:05 +00:00
|
|
|
echo "*** menuselect before installing Asterisk. ***"; \
|
2006-12-01 23:20:17 +00:00
|
|
|
echo "*** ***"; \
|
|
|
|
echo "**************************************************"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,en,$(CORE_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2010-10-18 22:14:05 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,en_AU,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2013-10-29 23:43:58 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,en_GB,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2017-07-13 20:43:42 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,en_NZ,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,es,$(CORE_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,fr,$(CORE_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2013-04-29 23:36:42 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,it,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2011-04-27 12:37:13 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,ru,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2014-09-09 20:11:10 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,ja,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2015-05-07 22:49:07 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),core-sounds,sv,$(CORE_SOUNDS_VERSION)))
|
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),extra-sounds,en,$(EXTRA_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2014-04-18 17:17:25 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),extra-sounds,en_GB,$(EXTRA_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(SOUNDS_DIR),extra-sounds,fr,$(EXTRA_SOUNDS_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2010-07-27 16:41:19 +00:00
|
|
|
$(eval $(call sound_format_lang_rule,$(MOH_DIR),moh,,$(MOH_VERSION)))
|
2010-05-17 23:49:15 +00:00
|
|
|
|
2006-06-07 21:05:05 +00:00
|
|
|
dist-clean:
|
|
|
|
rm -f *.tar.gz
|
2006-06-07 20:54:30 +00:00
|
|
|
|
2011-08-25 15:30:46 +00:00
|
|
|
install: $(CORE_SOUND_TAGS) $(EXTRA_SOUND_TAGS) $(MOH_TAGS)
|
2006-06-07 20:54:30 +00:00
|
|
|
|
|
|
|
uninstall:
|
2011-08-25 15:30:46 +00:00
|
|
|
rm -rf "$(SOUNDS_DIR)"
|
|
|
|
rm -rf "$(MOH_DIR)"
|
2007-04-18 22:11:02 +00:00
|
|
|
|
|
|
|
core_sounds_version:
|
|
|
|
@echo $(CORE_SOUNDS_VERSION)
|
|
|
|
|
|
|
|
extra_sounds_version:
|
|
|
|
@echo $(EXTRA_SOUNDS_VERSION)
|
2010-05-06 17:06:40 +00:00
|
|
|
|
|
|
|
moh_version:
|
|
|
|
@echo $(MOH_VERSION)
|