Merged revisions 48190 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48190 | russell | 2006-12-01 18:16:28 -0500 (Fri, 01 Dec 2006) | 12 lines

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: https://origsvn.digium.com/svn/asterisk/trunk@48191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-12-01 23:20:17 +00:00
parent e3b099c12a
commit c1a36cb52f
5 changed files with 154 additions and 32 deletions

View File

@@ -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