From a7e10e99e57047eaff2d1e8a4e24915e1c6604ff Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:08:34 +0200 Subject: [PATCH 1/8] freeswitch-stable: add ARCH depends for ZRTP and iSAC ZRTP and iSAC only support certain arches. Updated the depends to reflect that. Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Config.in | 1 + net/freeswitch-stable/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/freeswitch-stable/Config.in b/net/freeswitch-stable/Config.in index 6f71d7b..084c698 100644 --- a/net/freeswitch-stable/Config.in +++ b/net/freeswitch-stable/Config.in @@ -62,6 +62,7 @@ config FS_STABLE_WITH_VPX config FS_STABLE_WITH_ZRTP 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 help Compile with ZRTP support. diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index dd73578..76533a0 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -703,7 +703,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,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,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,kazoo,Kazoo,Kazoo module for FreeSWITCH.,)) $(eval $(call Package/$(PKG_NAME)/Module,lcr,LCR,This module adds a facility for least-cost routing.,)) From 12f09836f7aebd41686776aa9adff6aed3a65b73 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:16:04 +0200 Subject: [PATCH 2/8] freeswitch-stable: improve install/dir define - if source dir exists install the destination dir as it might not exist yet - if source dir does not exist do nothing (not even error out) Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index 76533a0..714e948 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -191,11 +191,12 @@ define Package/$(PKG_NAME)/install/bin endef 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 \ $(INSTALL_DIR) $(1)/$$$$$$$$dir; \ 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 \ $(INSTALL_DATA) $(2)/$$$$$$$$file $(1)/$$$$$$$$file; \ done From 4d36442e229d4488c7290d3a707076f3dfcb63b4 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:24:54 +0200 Subject: [PATCH 3/8] freeswitch-stable: SWIG updates - fixed swig location in all Makefiles in libs/esl and src/mod/languages - forced a reswig for mod_lua as well, like it is already done for mod_python - added patch for mod_lua to properly do the reswig (patch sent upstream, too) Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 12 ++++++++---- .../patches/160-mod_lua-swig.patch | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 net/freeswitch-stable/patches/160-mod_lua-swig.patch diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index 714e948..d0998c1 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -568,16 +568,19 @@ define Build/Prepare $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)), $(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)|' \ $(PKG_BUILD_DIR)/libs/esl/python/Makefile $(SED) 's|^LOCAL_LDFLAGS=.*|LOCAL_LDFLAGS=$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)|' \ $(PKG_BUILD_DIR)/libs/esl/python/Makefile $(SED) 's|^SITE_DIR=.*|SITE_DIR=$$$$(DESTDIR)$(PYTHON_PKG_DIR)|' \ $(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)|' \ $(PKG_BUILD_DIR)/src/mod/languages/mod_python/Makefile.am $(SED) 's|@PYTHON_CFLAGS@|-I$(PYTHON_INC_DIR)|' \ @@ -602,6 +605,7 @@ define Build/Configure endef 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) $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl swigclean pymod) diff --git a/net/freeswitch-stable/patches/160-mod_lua-swig.patch b/net/freeswitch-stable/patches/160-mod_lua-swig.patch new file mode 100644 index 0000000..600823f --- /dev/null +++ b/net/freeswitch-stable/patches/160-mod_lua-swig.patch @@ -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 From fc0af6f29de3ca7720a34f24ab46fe04581d69e1 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:31:40 +0200 Subject: [PATCH 4/8] freeswitch-stable: move mod_python feature Moved mod_python specialty from install/dir routine to mod builder Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index d0998c1..cc79af0 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -211,12 +211,6 @@ define Package/$(PKG_NAME)/install/mod $(INSTALL_DIR) $(1)/usr/lib/$(PRG_NAME)/mod $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PRG_NAME)/mod/mod_$(2).so \ $(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 define Package/$(PKG_NAME)/config @@ -421,6 +415,12 @@ $(subst \n,$(newline),$(3)) endef define Package/$(PKG_NAME)-mod-$(1)/install $(call Package/$(PKG_NAME)/install/mod,$$(1),$(1)) +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 $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) endef From 0430373885c92205e04e9a7df41753e9ac1631b6 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:36:29 +0200 Subject: [PATCH 5/8] freeswitch-stable: whitespace fix for hotplug builder Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index cc79af0..b57f9ce 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -312,7 +312,7 @@ endef define Package/$(PKG_NAME)-hotplug/install $(INSTALL_DIR) $(1)/etc/hotplug.d/iface $(INSTALL_BIN) ./files/$(PRG_NAME).hotplug \ - $(1)/etc/hotplug.d/iface/99-$(PRG_NAME) + $(1)/etc/hotplug.d/iface/99-$(PRG_NAME) endef define Package/$(PKG_NAME)-hotplug/postinst From 6a4a965b1fff2c05e9a5ad9314cebca2a559feaa Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:42:06 +0200 Subject: [PATCH 6/8] freeswitch-stable: added misc package builder - meant for packages where one only needs to copy files from one directory to another - added three new packages using the new builder (dev, fonts, images) Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index b57f9ce..4951c53 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -404,6 +404,29 @@ endef $$(eval $$(call BuildPackage,$(PKG_NAME)-lang-$(1))) 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)-mod-$(1) $(call Package/$(PKG_NAME)/Default) @@ -652,6 +675,21 @@ $(eval $(call Package/$(PKG_NAME)/Language,pt,Portuguese)) $(eval $(call Package/$(PKG_NAME)/Language,ru,Russian)) $(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 # Params: From eea358cfed84b0dd7dc7b4e6a267870ada610c98 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:48:27 +0200 Subject: [PATCH 7/8] freeswitch-stable: add symbol to allow inclusion of module examples Some modules include example content, e.g. xml snippets, in their source directory. Added a symbol that causes these to be included in the packages. Disabled by default. Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Config.in | 7 +++++++ net/freeswitch-stable/Makefile | 3 +++ 2 files changed, 10 insertions(+) diff --git a/net/freeswitch-stable/Config.in b/net/freeswitch-stable/Config.in index 084c698..c11712b 100644 --- a/net/freeswitch-stable/Config.in +++ b/net/freeswitch-stable/Config.in @@ -67,4 +67,11 @@ config FS_STABLE_WITH_ZRTP help 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 diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index 4951c53..326f2d8 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -438,6 +438,9 @@ $(subst \n,$(newline),$(3)) endef define Package/$(PKG_NAME)-mod-$(1)/install $(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) \ From d442371a44769b09089a6e7170f9f4912a48757d Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 11 Jun 2017 14:51:05 +0200 Subject: [PATCH 8/8] freeswitch-stable: move examples location Moved location of example packages from /usr/share/freeswitch/conf to /usr/share/freeswitch/examples. It makes more sense and is also the place where the module configuration snippets go. Signed-off-by: Sebastian Kemper --- net/freeswitch-stable/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index 326f2d8..115547f 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -380,10 +380,10 @@ This package does not install any configuration for FreeSWITCH into /etc/freeswitch. The system administrator is completely responsible for that directory. If you install one of the example configuration 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 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 $$(eval $$(call BuildPackage,$(PKG_NAME)-example-$(1))) endef