From d908be5a608130efeca2d8d2c52923c4b95e94ab Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 7 Oct 2009 16:17:09 +0000 Subject: [PATCH] [packages] add preliminary freeswitch v1.0.4 package (closes: #4891) git-svn-id: svn://svn.openwrt.org/openwrt/packages@17984 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/freeswitch/Makefile | 121 +++++++++++++++++++++++ net/freeswitch/files/freeswitch.default | 7 ++ net/freeswitch/files/freeswitch.init | 18 ++++ net/freeswitch/patches/101-trim.patch | 10 ++ net/freeswitch/patches/201-odbc.patch | 25 +++++ net/freeswitch/patches/202-pthread.patch | 22 +++++ 6 files changed, 203 insertions(+) create mode 100644 net/freeswitch/Makefile create mode 100644 net/freeswitch/files/freeswitch.default create mode 100644 net/freeswitch/files/freeswitch.init create mode 100644 net/freeswitch/patches/101-trim.patch create mode 100644 net/freeswitch/patches/201-odbc.patch create mode 100644 net/freeswitch/patches/202-pthread.patch diff --git a/net/freeswitch/Makefile b/net/freeswitch/Makefile new file mode 100644 index 000000000..95278a27b --- /dev/null +++ b/net/freeswitch/Makefile @@ -0,0 +1,121 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=freeswitch +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://files.freeswitch.org/ +PKG_MD5SUM:=86e34bdd8cc027d71772cb0dc51388da + +include $(INCLUDE_DIR)/package.mk + +define Package/freeswitch + SECTION:=net + CATEGORY:=Network + TITLE:=FreeSWITCH open source telephony platform + URL:=http://www.freeswitch.org/ + DEPENDS:=+libopenssl +libcurl +libreadline +libncurses +libpthread +endef + +define Package/freeswitch/description + FreeSWITCH is an open source telephony platform designed to + facilitate the creation of voice and chat driven products scaling + from a soft-phone up to a soft-switch. +endef + +FS_MODULES_DISABLED:= \ + applications/mod_cluechoo \ + codecs/mod_amr \ + codecs/mod_ilbc \ + codecs/mod_siren \ + languages/mod_lua \ + languages/mod_spidermonkey \ + languages/mod_spidermonkey_curl \ + languages/mod_spidermonkey_teletone \ + languages/mod_spidermonkey_core_db \ + languages/mod_spidermonkey_socket \ + say/mod_say_ru \ + +CONFIGURE_ARGS+= \ + --sysconfdir="/etc/freeswitch" \ + --with-modinstdir="/usr/lib/freeswitch" \ + --enable-ipv6 \ + \ + --with-libcurl="$(STAGING_DIR)/usr" \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-random="/dev/urandom" \ + --without-erlang \ + --without-java \ + --without-odbc \ + --without-mysql \ + --without-pgsql \ + --without-python \ + --disable-zrtp \ + +CONFIGURE_VARS+= \ + config_BUILD_CC="$(HOSTCC)" \ + config_BUILD_CFLAGS="$(HOST_CFLAGS)" \ + config_TARGET_CC="$(TARGET_CC)" \ + config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \ + config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \ + config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread" \ + CC_FOR_BUILD="$(HOSTCC)" \ + CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \ + LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \ + LIBS="-lpthread" \ + ac_cv_file_dbd_apr_dbd_mysql_c="no" \ + apr_cv_process_shared_works="no" \ + apr_cv_tcp_nodelay_with_cork="yes" \ + +# apr_cv_gai_addrconfig="yes" +# apr_cv_mutex_recursive="no" +# apr_cv_mutex_robust_shared="no" +# apr_cv_pthreads_lib="-lpthread" + +# SWITCH_CONF_DIR="/etc/freeswitch" +# ac_cv_file_dbd_apr_dbd_mysql_c="no" +# ac_cv_cflags_warn_all_ansi=no + +define Build/Configure + ( cd $(PKG_BUILD_DIR); ./rebootstrap.sh; ) +$(call Build/Configure/Default) + $(foreach m,$(FS_MODULES_DISABLED), \ + $(SED) 's|^\($(m)\)$$$$|# \1|g' $(PKG_BUILD_DIR)/modules.conf; \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \ + all install +endef + +define Package/freeswitch/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/db + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/log + $(CP) $(PKG_INSTALL_DIR)/usr/log/* $(1)/usr/log/ + $(INSTALL_DIR) $(1)/usr/lib/freeswitch + $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeswitch/*.so $(1)/usr/lib/freeswitch/ + $(INSTALL_DIR) $(1)/etc/freeswitch + $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/ $(1)/etc/freeswitch/ + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/freeswitch.default $(1)/etc/default/freeswitch + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/freeswitch.init $(1)/etc/init.d/freeswitch +endef + +$(eval $(call BuildPackage,freeswitch)) diff --git a/net/freeswitch/files/freeswitch.default b/net/freeswitch/files/freeswitch.default new file mode 100644 index 000000000..c7af99252 --- /dev/null +++ b/net/freeswitch/files/freeswitch.default @@ -0,0 +1,7 @@ +#FS_DIR="/opt" +FS_DIR_ETC="$FS_DIR/etc/freeswitch" +FS_DIR_MOD="$FS_DIR/usr/lib/freeswitch" +FS_DIR_LOG="$FS_DIR/tmp/freeswitch/log" +FS_DIR_DB="$FS_DIR/tmp/freeswitch/db" + +OPTIONS="-conf $FS_DIR_ETC -log $FS_DIR_LOG -db $FS_DIR_DB -mod $FS_DIR_MOD" diff --git a/net/freeswitch/files/freeswitch.init b/net/freeswitch/files/freeswitch.init new file mode 100644 index 000000000..08aa425ec --- /dev/null +++ b/net/freeswitch/files/freeswitch.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=90 + +DEFAULT=/etc/default/freeswitch +OPTIONS="" + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $FS_DIR_LOG + mkdir -p $FS_DIR_DB + $FS_DIR/usr/bin/freeswitch $OPTIONS -c +} + +stop() { + [ -f $DEFAULT ] && . $DEFAULT + $FS_DIR/usr/bin/freeswitch $OPTIONS -stop +} diff --git a/net/freeswitch/patches/101-trim.patch b/net/freeswitch/patches/101-trim.patch new file mode 100644 index 000000000..598269a06 --- /dev/null +++ b/net/freeswitch/patches/101-trim.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -107,7 +107,6 @@ src/switch_config.c\ + src/switch_time.c\ + src/switch_odbc.c \ + libs/stfu/stfu.c\ +-src/switch_cpp.cpp\ + src/g711.c\ + src/switch_pcm.c\ + libs/libteletone/src/libteletone_detect.c\ diff --git a/net/freeswitch/patches/201-odbc.patch b/net/freeswitch/patches/201-odbc.patch new file mode 100644 index 000000000..de51a00c1 --- /dev/null +++ b/net/freeswitch/patches/201-odbc.patch @@ -0,0 +1,25 @@ +--- a/build/config/odbc.m4 ++++ b/build/config/odbc.m4 +@@ -112,12 +112,13 @@ AC_ARG_WITH(odbc-include, + fi]) + + if test "X$with_odbc" != "X"; then +- if test "$with_odbc" != "yes"; then +- ac_cv_odbc_where_lib=$with_odbc ++ if test "$with_odbc" != "yes" -o "$with_odbc" != "no"; then ++ ac_cv_odbc_where_lib=$with_odbc/lib + ac_cv_odbc_where_inc=$with_odbc/include + fi + fi + ++ if test "$with_odbc" != "no"; then + if test "X$with_odbc_include" != "X"; then + ac_cv_odbc_where_inc=$with_odbc_include + fi +@@ -159,5 +160,6 @@ AC_ARG_WITH(odbc-include, + AC_SUBST(ODBC_LIB_FLAGS) + AC_DEFINE([HAVE_ODBC],[1],[libodbc]) + fi ++ fi ## test "$with_odbc" != "no" ## + ]) + diff --git a/net/freeswitch/patches/202-pthread.patch b/net/freeswitch/patches/202-pthread.patch new file mode 100644 index 000000000..49d04e8ba --- /dev/null +++ b/net/freeswitch/patches/202-pthread.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -196,7 +196,7 @@ fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread + fs_ivrd_CFLAGS = $(AM_CFLAGS) -Ilibs/esl/src/include + fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) + freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS) +-freeswitch_LDFLAGS = $(AM_LDFLAGS) -rpath $(libdir) ++freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir) + freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la + if ADD_LIBEDIT + fs_cli_CFLAGS += -DHAVE_EDITLINE -Ilibs/libedit/src +--- a/Makefile.in ++++ b/Makefile.in +@@ -578,7 +578,7 @@ fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread + fs_ivrd_CFLAGS = $(AM_CFLAGS) -Ilibs/esl/src/include + fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) + freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS) $(am__append_2) +-freeswitch_LDFLAGS = $(AM_LDFLAGS) -rpath $(libdir) ++freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir) + freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la \ + $(am__append_3) + @ADD_LIBEDIT_TRUE@fs_cli_LDADD = libs/libedit/src/.libs/libedit.a