aboutsummaryrefslogtreecommitdiffstats
path: root/sounds/Makefile
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-01 23:16:28 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-01 23:16:28 +0000
commit88d37514dada9e00c0aa0604cd962f6e8c865d6c (patch)
tree7ac1f3a16b91b26b4947cf14f2499989fa424c47 /sounds/Makefile
parent1a21925e9bf26521a510b27548b26f343d37f585 (diff)
FreeBSD 6.1 does not include wget by default. However, it has fetch which will
work just fine for our purposes of downloading the sounds packages. So, check for both wget and fetch and the configure script and use what was found to download them. If neither one was found, and sound packages are selected that must be downloaded, the install process will print out an informative error message indicating the situation. Also, fix a couple places where "make" was hard coded into some output messages by replacing them with the $(MAKE) variable. (issue #8451, initial patch by pabelanger, with additional modifications by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48190 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'sounds/Makefile')
-rw-r--r--sounds/Makefile60
1 files changed, 38 insertions, 22 deletions
diff --git a/sounds/Makefile b/sounds/Makefile
index 720e1166f..ca9015c8b 100644
--- a/sounds/Makefile
+++ b/sounds/Makefile
@@ -11,9 +11,9 @@
# the GNU General Public License
#
-.PHONY: dist-clean all uninstall
+.PHONY: dist-clean all uninstall have_download install
--include $(ASTTOPDIR)/menuselect.makeopts
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts
PWD:=$(shell pwd)
SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
@@ -56,69 +56,85 @@ WGET_ARGS:=--continue
all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
-$(SOUNDS_DIR)/.asterisk-core-sounds-en-%:
+have_download:
+ @if test "$(DOWNLOAD)" = ":" ; then \
+ echo "**************************************************"; \
+ echo "*** ***"; \
+ echo "*** You must have either wget or fetch to be ***"; \
+ echo "*** able to automatically download and install ***"; \
+ echo "*** the requested sound packages. ***"; \
+ echo "*** ***"; \
+ echo "*** Please install one of these, or remove any ***"; \
+ echo "*** extra sound package selections in ***"; \
+ echo "*** menuselecct before installing Asterisk. ***"; \
+ echo "*** ***"; \
+ echo "**************************************************"; \
+ exit 1; \
+ fi
+
+$(SOUNDS_DIR)/.asterisk-core-sounds-en-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(SOUNDS_DIR)/.asterisk-core-sounds-es-%:
+$(SOUNDS_DIR)/.asterisk-core-sounds-es-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(SOUNDS_DIR)/.asterisk-core-sounds-fr-%:
+$(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(SOUNDS_DIR)/.asterisk-extra-sounds-en-%:
+$(SOUNDS_DIR)/.asterisk-extra-sounds-en-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(SOUNDS_DIR)/.asterisk-extra-sounds-es-%:
+$(SOUNDS_DIR)/.asterisk-extra-sounds-es-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%:
+$(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-$(MOH_DIR)/.asterisk-moh-%:
+$(MOH_DIR)/.asterisk-moh-%: have_download
@PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \
- if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
+ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
(cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@
-asterisk-core-%.tar.gz:
- @wget $(WGET_ARGS) $(SOUNDS_URL)/$@
+asterisk-core-%.tar.gz: have_download
+ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
-asterisk-extra-%.tar.gz:
- @wget $(WGET_ARGS) $(SOUNDS_URL)/$@
+asterisk-extra-%.tar.gz: have_download
+ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
-asterisk-moh-%.tar.gz:
- @wget $(WGET_ARGS) $(SOUNDS_URL)/$@
+asterisk-moh-%.tar.gz: have_download
+ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
dist-clean:
rm -f *.tar.gz