2 # Copyright (C) 2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://files.freeswitch.org/
16 PKG_MD5SUM:=86e34bdd8cc027d71772cb0dc51388da
18 include $(INCLUDE_DIR)/package.mk
20 define Package/freeswitch
23 TITLE:=FreeSWITCH open source telephony platform
24 URL:=http://www.freeswitch.org/
25 DEPENDS:=+libopenssl +libcurl +libreadline +libncurses +libpthread
28 define Package/freeswitch/description
29 FreeSWITCH is an open source telephony platform designed to
30 facilitate the creation of voice and chat driven products scaling
31 from a soft-phone up to a soft-switch.
34 FS_MODULES_DISABLED:= \
35 applications/mod_cluechoo \
40 languages/mod_spidermonkey \
41 languages/mod_spidermonkey_curl \
42 languages/mod_spidermonkey_teletone \
43 languages/mod_spidermonkey_core_db \
44 languages/mod_spidermonkey_socket \
48 --sysconfdir="/etc/freeswitch" \
49 --with-modinstdir="/usr/lib/freeswitch" \
52 --with-libcurl="$(STAGING_DIR)/usr" \
53 --with-openssl="$(STAGING_DIR)/usr" \
54 --with-random="/dev/urandom" \
64 config_BUILD_CC="$(HOSTCC)" \
65 config_BUILD_CFLAGS="$(HOST_CFLAGS)" \
66 config_TARGET_CC="$(TARGET_CC)" \
67 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
68 config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
69 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
70 config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread" \
71 CC_FOR_BUILD="$(HOSTCC)" \
72 CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
73 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
75 ac_cv_file_dbd_apr_dbd_mysql_c="no" \
76 apr_cv_process_shared_works="no" \
77 apr_cv_tcp_nodelay_with_cork="yes" \
79 # apr_cv_gai_addrconfig="yes"
80 # apr_cv_mutex_recursive="no"
81 # apr_cv_mutex_robust_shared="no"
82 # apr_cv_pthreads_lib="-lpthread"
84 # SWITCH_CONF_DIR="/etc/freeswitch"
85 # ac_cv_file_dbd_apr_dbd_mysql_c="no"
86 # ac_cv_cflags_warn_all_ansi=no
88 define Build/Configure
89 ( cd $(PKG_BUILD_DIR); ./rebootstrap.sh; )
90 $(call Build/Configure/Default)
91 $(foreach m,$(FS_MODULES_DISABLED), \
92 $(SED) 's|^\($(m)\)$$$$|# \1|g' $(PKG_BUILD_DIR)/modules.conf; \
97 $(MAKE) -C $(PKG_BUILD_DIR) \
98 DESTDIR="$(PKG_INSTALL_DIR)" \
99 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
103 define Package/freeswitch/install
104 $(INSTALL_DIR) $(1)/usr/bin
105 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
106 $(INSTALL_DIR) $(1)/usr/db
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
109 $(INSTALL_DIR) $(1)/usr/log
110 $(CP) $(PKG_INSTALL_DIR)/usr/log/* $(1)/usr/log/
111 $(INSTALL_DIR) $(1)/usr/lib/freeswitch
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeswitch/*.so $(1)/usr/lib/freeswitch/
113 $(INSTALL_DIR) $(1)/etc/freeswitch
114 $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/ $(1)/etc/freeswitch/
115 $(INSTALL_DIR) $(1)/etc/default
116 $(INSTALL_DATA) ./files/freeswitch.default $(1)/etc/default/freeswitch
117 $(INSTALL_DIR) $(1)/etc/init.d
118 $(INSTALL_BIN) ./files/freeswitch.init $(1)/etc/init.d/freeswitch
121 $(eval $(call BuildPackage,freeswitch))