[packages] add preliminary freeswitch v1.0.4 package (closes: #4891)
[packages.git] / net / freeswitch / Makefile
1 #
2 # Copyright (C) 2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=freeswitch
11 PKG_VERSION:=1.0.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://files.freeswitch.org/
16 PKG_MD5SUM:=86e34bdd8cc027d71772cb0dc51388da
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/freeswitch
21   SECTION:=net
22   CATEGORY:=Network
23   TITLE:=FreeSWITCH open source telephony platform
24   URL:=http://www.freeswitch.org/
25   DEPENDS:=+libopenssl +libcurl +libreadline +libncurses +libpthread
26 endef
27
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.
32 endef
33
34 FS_MODULES_DISABLED:= \
35         applications/mod_cluechoo \
36         codecs/mod_amr \
37         codecs/mod_ilbc \
38         codecs/mod_siren \
39         languages/mod_lua \
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 \
45         say/mod_say_ru \
46
47 CONFIGURE_ARGS+= \
48         --sysconfdir="/etc/freeswitch" \
49         --with-modinstdir="/usr/lib/freeswitch" \
50         --enable-ipv6 \
51         \
52         --with-libcurl="$(STAGING_DIR)/usr" \
53         --with-openssl="$(STAGING_DIR)/usr" \
54         --with-random="/dev/urandom" \
55         --without-erlang \
56         --without-java \
57         --without-odbc \
58         --without-mysql \
59         --without-pgsql \
60         --without-python \
61         --disable-zrtp \
62
63 CONFIGURE_VARS+= \
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)" \
74         LIBS="-lpthread" \
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" \
78
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"
83         
84 #       SWITCH_CONF_DIR="/etc/freeswitch"
85 #       ac_cv_file_dbd_apr_dbd_mysql_c="no"
86 #       ac_cv_cflags_warn_all_ansi=no
87
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; \
93         )
94 endef
95
96 define Build/Compile
97         $(MAKE) -C $(PKG_BUILD_DIR) \
98                 DESTDIR="$(PKG_INSTALL_DIR)" \
99                 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
100                 all install
101 endef
102
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
119 endef
120
121 $(eval $(call BuildPackage,freeswitch))