Merge pull request #157 from micmac1/PR

freeswitch-stable: new PR
This commit is contained in:
Jiri Slachta 2017-06-11 15:49:51 +02:00 committed by GitHub
commit f297dff388
3 changed files with 87 additions and 16 deletions

View file

@ -62,8 +62,16 @@ config FS_STABLE_WITH_VPX
config FS_STABLE_WITH_ZRTP config FS_STABLE_WITH_ZRTP
bool "Compile with ZRTP support" bool "Compile with ZRTP support"
depends on @aarch64||aarch64_be||arm||armeb||i386||mips||mips64||mips64el||mipsel||powerpc||powerpc64||powerpcle||sparc||x86_64
default n default n
help help
Compile with ZRTP support. Compile with ZRTP support.
config FS_STABLE_WITH_MODCONF
bool "Include module examples"
default n
help
Some modules include examples in their source directory, e.g. xml
snippets. Select y to include them.
endmenu endmenu

View file

@ -191,11 +191,12 @@ define Package/$(PKG_NAME)/install/bin
endef endef
define Package/$(PKG_NAME)/install/dir define Package/$(PKG_NAME)/install/dir
for dir in $$$$(shell cd $(2); find -type d -print | sed 's|^./\?||'); \ if [ -d $(2) ]; then $(INSTALL_DIR) $(1); fi
for dir in $$$$(shell [ -d $(2) ] && cd $(2) && find -type d -print | sed 's|^./\?||'); \
do \ do \
$(INSTALL_DIR) $(1)/$$$$$$$$dir; \ $(INSTALL_DIR) $(1)/$$$$$$$$dir; \
done done
for file in $$$$(shell cd $(2); find -type f -print | sed 's|^./||'); \ for file in $$$$(shell [ -d $(2) ] && cd $(2) && find -type f -print | sed 's|^./||'); \
do \ do \
$(INSTALL_DATA) $(2)/$$$$$$$$file $(1)/$$$$$$$$file; \ $(INSTALL_DATA) $(2)/$$$$$$$$file $(1)/$$$$$$$$file; \
done done
@ -210,12 +211,6 @@ define Package/$(PKG_NAME)/install/mod
$(INSTALL_DIR) $(1)/usr/lib/$(PRG_NAME)/mod $(INSTALL_DIR) $(1)/usr/lib/$(PRG_NAME)/mod
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PRG_NAME)/mod/mod_$(2).so \ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PRG_NAME)/mod/mod_$(2).so \
$(1)/usr/lib/$(PRG_NAME)/mod $(1)/usr/lib/$(PRG_NAME)/mod
ifeq ($(2),python)
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/$(PRG_NAME).py \
$(1)$(PYTHON_PKG_DIR)
endif
endef endef
define Package/$(PKG_NAME)/config define Package/$(PKG_NAME)/config
@ -385,10 +380,10 @@ This package does not install any configuration for FreeSWITCH into
/etc/freeswitch. The system administrator is completely responsible /etc/freeswitch. The system administrator is completely responsible
for that directory. If you install one of the example configuration for that directory. If you install one of the example configuration
packages, it will install the corresponding sample configuration to packages, it will install the corresponding sample configuration to
/usr/share/freeswitch/conf where you can take a look at it. /usr/share/freeswitch/examples where you can take a look at it.
endef endef
define Package/$(PKG_NAME)-example-$(1)/install define Package/$(PKG_NAME)-example-$(1)/install
$(call Package/$(PKG_NAME)/install/dir,$$(1)/usr/share/$(PRG_NAME)/conf/$(1),$(PKG_BUILD_DIR)/conf/$(1)) $(call Package/$(PKG_NAME)/install/dir,$$(1)/usr/share/$(PRG_NAME)/examples/$(1),$(PKG_BUILD_DIR)/conf/$(1))
endef endef
$$(eval $$(call BuildPackage,$(PKG_NAME)-example-$(1))) $$(eval $$(call BuildPackage,$(PKG_NAME)-example-$(1)))
endef endef
@ -409,6 +404,29 @@ endef
$$(eval $$(call BuildPackage,$(PKG_NAME)-lang-$(1))) $$(eval $$(call BuildPackage,$(PKG_NAME)-lang-$(1)))
endef endef
# The next package generator is for miscellaneous files that only
# require being copied from PKG_INSTALL_DIR to the ipkg.
define Package/$(PKG_NAME)/Misc
define Package/$(PKG_NAME)-misc-$(1)
$(call Package/$(PKG_NAME)/Default)
TITLE:=$(2)
DEPENDS:=$(PKG_NAME)
endef
define Package/$(PKG_NAME)-misc-$(1)/description
$(subst \n,$(newline),$(3))
endef
define Package/$(PKG_NAME)-misc-$(1)/install
$(call Package/$(PKG_NAME)/install/dir,$$(1)$(5),$(PKG_INSTALL_DIR)$(4))
ifeq ($(1),dev)
$(INSTALL_DIR) $$(1)/usr/lib/pkgconfig
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/freeswitch.pc \
$$(1)/usr/lib/pkgconfig
endif
endef
$$(eval $$(call BuildPackage,$(PKG_NAME)-misc-$(1)))
endef
define Package/$(PKG_NAME)/Module define Package/$(PKG_NAME)/Module
define Package/$(PKG_NAME)-mod-$(1) define Package/$(PKG_NAME)-mod-$(1)
$(call Package/$(PKG_NAME)/Default) $(call Package/$(PKG_NAME)/Default)
@ -420,6 +438,15 @@ $(subst \n,$(newline),$(3))
endef endef
define Package/$(PKG_NAME)-mod-$(1)/install define Package/$(PKG_NAME)-mod-$(1)/install
$(call Package/$(PKG_NAME)/install/mod,$$(1),$(1)) $(call Package/$(PKG_NAME)/install/mod,$$(1),$(1))
ifeq ($(CONFIG_FS_STABLE_WITH_MODCONF),y)
$(call Package/$(PKG_NAME)/install/dir,$$(1)/usr/share/$(PRG_NAME)/examples/mod_$(1),$(PKG_BUILD_DIR)/src/mod/*/mod_$(1)/conf)
endif
ifeq ($(1),python)
$(INSTALL_DIR) $$(1)$(PYTHON_PKG_DIR)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/$(PRG_NAME).py \
$$(1)$(PYTHON_PKG_DIR)
endif
endef endef
$$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
endef endef
@ -567,16 +594,19 @@ define Build/Prepare
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)), $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
$(SED) '/mod_$(m)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf)) $(SED) '/mod_$(m)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf))
find $(PKG_BUILD_DIR)/libs/esl -name Makefile \
-exec $(SED) 's|swig2.0|$(STAGING_DIR_HOSTPKG)/bin/swig|' \
{} \;
find $(PKG_BUILD_DIR)/src/mod/languages -name Makefile.am \
-exec $(SED) 's|swig2.0|$(STAGING_DIR_HOSTPKG)/bin/swig|' \
{} \;
$(SED) 's|^LOCAL_CFLAGS=.*|LOCAL_CFLAGS=-I$(PYTHON_INC_DIR)|' \ $(SED) 's|^LOCAL_CFLAGS=.*|LOCAL_CFLAGS=-I$(PYTHON_INC_DIR)|' \
$(PKG_BUILD_DIR)/libs/esl/python/Makefile $(PKG_BUILD_DIR)/libs/esl/python/Makefile
$(SED) 's|^LOCAL_LDFLAGS=.*|LOCAL_LDFLAGS=$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)|' \ $(SED) 's|^LOCAL_LDFLAGS=.*|LOCAL_LDFLAGS=$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)|' \
$(PKG_BUILD_DIR)/libs/esl/python/Makefile $(PKG_BUILD_DIR)/libs/esl/python/Makefile
$(SED) 's|^SITE_DIR=.*|SITE_DIR=$$$$(DESTDIR)$(PYTHON_PKG_DIR)|' \ $(SED) 's|^SITE_DIR=.*|SITE_DIR=$$$$(DESTDIR)$(PYTHON_PKG_DIR)|' \
$(PKG_BUILD_DIR)/libs/esl/python/Makefile $(PKG_BUILD_DIR)/libs/esl/python/Makefile
$(SED) 's|swig2.0|$(STAGING_DIR_HOSTPKG)/bin/swig|' \
$(PKG_BUILD_DIR)/libs/esl/python/Makefile
$(SED) 's|swig2.0|$(STAGING_DIR_HOSTPKG)/bin/swig|' \
$(PKG_BUILD_DIR)/src/mod/languages/mod_python/Makefile.am
$(SED) 's|^PYTHON_SITE_DIR=.*|PYTHON_SITE_DIR=$(PYTHON_PKG_DIR)|' \ $(SED) 's|^PYTHON_SITE_DIR=.*|PYTHON_SITE_DIR=$(PYTHON_PKG_DIR)|' \
$(PKG_BUILD_DIR)/src/mod/languages/mod_python/Makefile.am $(PKG_BUILD_DIR)/src/mod/languages/mod_python/Makefile.am
$(SED) 's|@PYTHON_CFLAGS@|-I$(PYTHON_INC_DIR)|' \ $(SED) 's|@PYTHON_CFLAGS@|-I$(PYTHON_INC_DIR)|' \
@ -601,6 +631,7 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/src/mod/languages/mod_lua swigclean)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/src/mod/languages/mod_python swigclean) $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/src/mod/languages/mod_python swigclean)
$(call Build/Compile/Default) $(call Build/Compile/Default)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl swigclean pymod) $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl swigclean pymod)
@ -647,6 +678,21 @@ $(eval $(call Package/$(PKG_NAME)/Language,pt,Portuguese))
$(eval $(call Package/$(PKG_NAME)/Language,ru,Russian)) $(eval $(call Package/$(PKG_NAME)/Language,ru,Russian))
$(eval $(call Package/$(PKG_NAME)/Language,sv,Swedish)) $(eval $(call Package/$(PKG_NAME)/Language,sv,Swedish))
################################
# FreeSWITCH misc packages
# Params:
# 1 - Package subname
# 2 - Package title
# 3 - Package description
# 4 - Source dir relative to
# PKG_INSTALL_DIR
# 5 - Dest dir relative to ipkg
################################
$(eval $(call Package/$(PKG_NAME)/Misc,dev,Development files,This package includes the FreeSWITCH headers and pkgconfig file.,/usr/share/$(PRG_NAME)/include,/usr/include))
$(eval $(call Package/$(PKG_NAME)/Misc,fonts,Fonts,This package includes the fonts bundled with FreeSWITCH.,/usr/share/$(PRG_NAME)/fonts,/usr/share/$(PRG_NAME)/fonts))
$(eval $(call Package/$(PKG_NAME)/Misc,images,Images,This package includes the images bundled with FreeSWITCH.,/usr/share/$(PRG_NAME)/images,/usr/share/$(PRG_NAME)/images))
################################ ################################
# FreeSWITCH modules # FreeSWITCH modules
# Params: # Params:
@ -703,7 +749,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,hash,Hash,This module provides a key-va
$(eval $(call Package/$(PKG_NAME)/Module,hiredis,Redis client,This module provides a mechanism to use Redis as a datastore.,+libhiredis)) $(eval $(call Package/$(PKG_NAME)/Module,hiredis,Redis client,This module provides a mechanism to use Redis as a datastore.,+libhiredis))
$(eval $(call Package/$(PKG_NAME)/Module,httapi,HT-TAPI,This module provides an API for controlling the switch by responding\nto HTTP requests.,)) $(eval $(call Package/$(PKG_NAME)/Module,httapi,HT-TAPI,This module provides an API for controlling the switch by responding\nto HTTP requests.,))
$(eval $(call Package/$(PKG_NAME)/Module,http_cache,HTTP GET with caching,This module provides an API for making HTTP GET requests where the\nresult is cached.,)) $(eval $(call Package/$(PKG_NAME)/Module,http_cache,HTTP GET with caching,This module provides an API for making HTTP GET requests where the\nresult is cached.,))
$(eval $(call Package/$(PKG_NAME)/Module,isac,iSAC,iSAC codec support.,)) $(eval $(call Package/$(PKG_NAME)/Module,isac,iSAC,iSAC codec support.,@arm||i386||mips||mips64||mips64el||mipsel||x86_64))
$(eval $(call Package/$(PKG_NAME)/Module,json_cdr,JSON CDR,JSON-based Call Detail Record handler.,)) $(eval $(call Package/$(PKG_NAME)/Module,json_cdr,JSON CDR,JSON-based Call Detail Record handler.,))
$(eval $(call Package/$(PKG_NAME)/Module,kazoo,Kazoo,Kazoo module for FreeSWITCH.,)) $(eval $(call Package/$(PKG_NAME)/Module,kazoo,Kazoo,Kazoo module for FreeSWITCH.,))
$(eval $(call Package/$(PKG_NAME)/Module,lcr,LCR,This module adds a facility for least-cost routing.,)) $(eval $(call Package/$(PKG_NAME)/Module,lcr,LCR,This module adds a facility for least-cost routing.,))

View file

@ -0,0 +1,17 @@
--- a/src/mod/languages/mod_lua/Makefile.am
+++ b/src/mod/languages/mod_lua/Makefile.am
@@ -24,12 +24,12 @@ if SYSTEM_LUA
mod_lua_la_LDFLAGS += $(LUA_LIBS)
endif
-reswig: swigclean lua_wrap
+reswig: swigclean mod_lua_wrap.cpp
swigclean: clean
rm -f mod_lua_wrap.*
-lua_wrap: mod_lua_extra.c
+mod_lua_wrap.cpp: mod_lua_extra.c
swig2.0 -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i
echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp
patch -s -p0 -i hack.diff