Index: configure =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: configure.ac =================================================================== --- configure.ac (revision 263636) +++ configure.ac (working copy) @@ -211,6 +211,7 @@ fi fi AC_SUBST(DOWNLOAD) +AC_SUBST(SOUNDS_CACHE_DIR) AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [ if test "x$BISON" != "x:" ; then Index: sounds/Makefile =================================================================== --- sounds/Makefile (revision 263636) +++ sounds/Makefile (working copy) @@ -15,7 +15,9 @@ -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts +CMD_PREFIX?=@ SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds +SOUNDS_CACHE_DIR?= MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh CORE_SOUNDS_VERSION:=1.4.19 EXTRA_SOUNDS_VERSION:=1.4.11 @@ -66,8 +68,65 @@ WGET_ARGS:=--continue $(WGET_EXTRA_ARGS) endif -all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH) +EMPTY:= +BS:=$(EMPTY)\$(EMPTY) +ifneq ($(SOUNDS_CACHE_DIR),) + +define sound_format_lang_rule +$$($(1))/.asterisk-$(2)$(if $(3),-$(3),)-%: have_download + $(CMD_PREFIX)PACKAGE=$$(subst $$($(1))/.asterisk,asterisk,$$@).tar.gz; $(BS) + if test ! -f $$$${PACKAGE}; then $(BS) + if test ! -f $$(SOUNDS_CACHE_DIR)/$$$${PACKAGE}; then $(BS) + (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$$${PACKAGE} $$(SOUNDS_URL)/$$$${PACKAGE}.sha1 $(BS) + && sha1sum -c --status $$$${PACKAGE}.sha1) || $(BS) + (echo "Bad checksum: $$$${PACKAGE}" 1>&2; exit 1)); $(BS) + fi; $(BS) + cp -p $$(SOUNDS_CACHE_DIR)/$$$${PACKAGE} .; $(BS) + fi; $(BS) +$(if $($(4)_VERSION),\ +$(EMPTY) rm -f $$(subst -$$($(4)_VERSION),,$$@)-* && $(BS) +,) (cd $$($(1))$(if $(3),/$(3),); cat $$(CURDIR)/$$$${PACKAGE} | gzip -d | tar xof -) && $(BS) + touch $$@ +endef + +define sound_download_rule +asterisk-$(1)-%.tar.gz: have_download + $(CMD_PREFIX)if test ! -f $$@ && test ! -f $$(SOUNDS_DIR)/.$$(subst .tar.gz,,$/$@); then $(BS) + if test ! -f $$(SOUNDS_CACHE_DIR)/$$@; then $(BS) + (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$@ $$(SOUNDS_URL)/$$@.sha1 $(BS) + && sha1sum -c --status $$@.sha1) || $(BS) + (echo "Bad checksum: $$@" 1>&2; exit 1)); $(BS) + fi; $(BS) + cp -p $$(SOUNDS_CACHE_DIR)/$$@ .; $(BS) + fi +endef + +else + +define sound_format_lang_rule +$$($(1))/.asterisk-$(2)$(if $(3),-$(3),)-%: have_download + $(CMD_PREFIX)PACKAGE=$$(subst $$($(1))/.asterisk,asterisk,$$@).tar.gz; $(BS) + if test ! -f $$$${PACKAGE}; then $(BS) + ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$$${PACKAGE} || exit 1); $(BS) + fi; $(BS) +$(if $($(4)_VERSION),\ +$(EMPTY) rm -f $$(subst -$$($(4)_VERSION),,$$@)-* && $(BS) +,) (cd $$($(1))$(if $(3),/$(3),); cat $$(CURDIR)/$$$${PACKAGE} | gzip -d | tar xof -) && $(BS) + touch $$@ +endef + +define sound_download_rule +asterisk-$(1)-%.tar.gz: have_download + $(CMD_PREFIX)if test ! -f $$@ && test ! -f $$(SOUNDS_DIR)/.$$(subst .tar.gz,,$$@); then $(BS) + $$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$@; $(BS) + fi +endef + +endif + +all: $(SOUNDS_CACHE_DIR) $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH) + have_download: @if test "$(DOWNLOAD)" = ":" ; then \ echo "**************************************************"; \ @@ -84,78 +143,33 @@ exit 1; \ fi -$(SOUNDS_DIR)/.asterisk-core-sounds-en-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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)/en; cat $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,core-sounds,en,CORE_SOUNDS)) -$(SOUNDS_DIR)/.asterisk-core-sounds-es-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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 $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,core-sounds,es,CORE_SOUNDS)) -$(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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 $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,core-sounds,fr,CORE_SOUNDS)) -$(SOUNDS_DIR)/.asterisk-extra-sounds-en-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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)/en; cat $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,extra-sounds,en,EXTRA_SOUNDS)) -$(SOUNDS_DIR)/.asterisk-extra-sounds-es-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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 $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,extra-sounds,es,EXTRA_SOUNDS)) -$(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%: have_download - @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ - 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 $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,SOUNDS_DIR,extra-sounds,fr,EXTRA_SOUNDS)) -$(MOH_DIR)/.asterisk-moh-%: have_download - @PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \ - if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ - if test ! -f $${PACKAGE}; then exit 1; fi; \ - rm -f $(subst -$(MOH_VERSION),,$@)-* && \ - (cd $(MOH_DIR); cat $(CURDIR)/$${PACKAGE} | gzip -d | tar xof -) && \ - touch $@ +$(eval $(call sound_format_lang_rule,MOH_DIR,moh,,MOH)) -asterisk-core-%.tar.gz: have_download - @if test ! -f $@ && test ! -f $(SOUNDS_DIR)/.$(subst .tar.gz,,$@) ; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@;fi +$(eval $(call sound_download_rule,core)) -asterisk-extra-%.tar.gz: have_download - @if test ! -f $@ && test ! -f $(SOUNDS_DIR)/.$(subst .tar.gz,,$@) ; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@;fi +$(eval $(call sound_download_rule,extra)) -asterisk-moh-%.tar.gz: have_download - @if test ! -f $@ && test ! -f $(MOH_DIR)/.$(subst .tar.gz,,$@) ; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@;fi +$(eval $(call sound_download_rule,moh)) dist-clean: rm -f *.tar.gz -$(SOUNDS_DIR)/en $(MOH_DIR) $(SOUNDS_DIR)/es $(SOUNDS_DIR)/fr: +$(SOUNDS_DIR)/en $(MOH_DIR) $(SOUNDS_DIR)/es $(SOUNDS_DIR)/fr $(SOUNDS_CACHE_DIR): mkdir -p $@ -install: $(SOUNDS_DIR)/en $(SOUNDS_DIR)/es $(SOUNDS_DIR)/fr $(MOH_DIR) $(CORE_SOUND_TAGS) $(EXTRA_SOUND_TAGS) $(MOH_TAGS) +install: $(SOUNDS_DIR)/en $(SOUNDS_DIR)/es $(SOUNDS_DIR)/fr $(MOH_DIR) $(CORE_SOUND_TAGS) $(EXTRA_SOUND_TAGS) $(MOH_TAGS) $(SOUNDS_CACHE_DIR) uninstall: rm -rf $(SOUNDS_DIR) Index: include/asterisk/autoconfig.h.in =================================================================== --- include/asterisk/autoconfig.h.in (revision 263636) +++ include/asterisk/autoconfig.h.in (working copy) @@ -555,9 +555,6 @@ /* Define to 1 if you have the ISDN PRI subaddressing library. */ #undef HAVE_PRI_SUBADDR -/* Define to 1 if you have the ISDN PRI get_version library. */ -#undef HAVE_PRI_VERSION - /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD @@ -1041,9 +1038,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE @@ -1063,11 +1057,6 @@ /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 -/* Define to 1 if the `setvbuf' function takes the buffering type as its - second argument and the buffer pointer as the third, as on System V before - release 3. */ -#undef SETVBUF_REVERSED - /* The size of `char *', as computed by sizeof. */ #undef SIZEOF_CHAR_P @@ -1097,21 +1086,31 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ +/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE @@ -1128,20 +1127,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif - -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES - /* Define to empty if `const' does not conform to ANSI C. */ #undef const Index: makeopts.in =================================================================== --- makeopts.in (revision 263636) +++ makeopts.in (working copy) @@ -23,6 +23,7 @@ WGET=@WGET@ FETCH=@FETCH@ DOWNLOAD=@DOWNLOAD@ +SOUNDS_CACHE_DIR=@SOUNDS_CACHE_DIR@ RUBBER=@RUBBER@ CATDVI=@CATDVI@ KPATHSEA=@KPATHSEA@