3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE_URL:=http://files.freeswitch.org/
16 PKG_MD5SUM:=388effee587887a81fe7f411b7350590
103 spidermonkey-core-db \
106 spidermonkey-socket \
107 spidermonkey-teletone \
123 PKG_CONFIG_DEPENDS:= \
124 $(patsubst %,CONFIG_PACKAGE_freeswitch-mod-%,$(FS_MOD_AVAILABLE)) \
126 include $(INCLUDE_DIR)/package.mk
128 define Package/freeswitch/Default
131 URL:=http://www.freeswitch.org/
132 MAINTAINER:=Daniel Dickinson <ddickinson@vertical.com>
136 define Package/freeswitch
137 $(call Package/freeswitch/Default)
138 TITLE:=FreeSWITCH open source telephony platform
139 DEPENDS:= +libopenssl +libreadline +libncurses +libpthread +libstdcpp
143 define Package/freeswitch/description
144 FreeSWITCH is an open source telephony platform designed to
145 facilitate the creation of voice and chat driven products scaling
146 from a soft-phone up to a soft-switch.
151 define Package/freeswitch-default
152 $(call Package/freeswitch/Default)
153 TITLE:=FreeSWITCH default config
154 DEPENDS:= freeswitch \
155 +freeswitch-mod-commands \
156 +freeswitch-mod-conference \
157 +freeswitch-mod-console \
158 +freeswitch-mod-curl \
159 +freeswitch-mod-dialplan-xml \
160 +freeswitch-mod-dptools \
161 +freeswitch-mod-event-socket \
162 +freeswitch-mod-g723-1 \
163 +freeswitch-mod-ilbc \
164 +freeswitch-mod-local-stream \
165 +freeswitch-mod-logfile \
166 +freeswitch-mod-lua \
167 +freeswitch-mod-native-file \
168 +freeswitch-mod-sndfile \
169 +freeswitch-mod-sofia \
170 +freeswitch-mod-speex \
171 +freeswitch-mod-tone-stream \
172 +freeswitch-mod-voipcodecs \
173 +freeswitch-mod-xml-curl \
174 +freeswitch-mod-xml-rpc
177 define Package/freeswitch-minimal
178 $(call Package/freeswitch/Default)
179 TITLE:=FreeSWITCH minimal config
180 DEPENDS:= freeswitch \
181 +freeswitch-mod-commands \
182 +freeswitch-mod-console \
183 +freeswitch-mod-curl \
184 +freeswitch-mod-dialplan-xml \
185 +freeswitch-mod-dptools \
186 +freeswitch-mod-local-stream \
187 +freeswitch-mod-sndfile \
188 +freeswitch-mod-sofia \
189 +freeswitch-mod-tone-stream \
190 +freeswitch-mod-voipcodecs
193 define Package/freeswitch-sounds-en
194 $(call Package/freeswitch/Default)
195 TITLE:=FreeSWITCH english sounds
200 define Package/freeswitch-sounds-moh
201 $(call Package/freeswitch/Default)
202 TITLE:=FreeSWITCH music-on-hold sounds
207 define Package/freeswitch-tools
208 $(call Package/freeswitch/Default)
209 TITLE:=FreeSWITCH control tools
214 define Download/files
217 URL:=http://files.freeswitch.org/$(4)
221 $(CP) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(5)
223 $$(eval $$(call Download,$(1)))
226 MAKE_INSTALL_TARGETS:=install
228 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-celt),)
229 $(eval $(call Download/files,celt,celt-0.6.1.tar.gz,2961ffb6fadb5f905d20de9f0d86e44c,downloads/libs/,libs/))
232 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-curl),)
233 $(eval $(call Download/files,json-c,json-c-0.8.tar.gz,9c7b90dff16eec3063084829c382ebac,downloads/libs/,libs/))
236 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-flite),)
237 $(eval $(call Download/files,flite,flite-1.3.99.tar.gz,,downloads/libs/,libs/))
240 ifneq ($(CONFIG_PACKAGE_freeswitch-sounds-en),)
241 $(eval $(call Download/files,sounds-en,freeswitch-sounds-en-us-callie-8000-1.0.10.tar.gz,f7f85aaf3763673c884ec3451f1c1c3e,,))
242 MAKE_INSTALL_TARGETS+= sounds-install
245 ifneq ($(CONFIG_PACKAGE_freeswitch-sounds-moh),)
246 $(eval $(call Download/files,sounds-moh,freeswitch-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,))
247 MAKE_INSTALL_TARGETS+= moh-install
250 FS_TARGET_CFLAGS = ${TARGET_CFLAGS} -DLUA_USE_LINUX $(FPIC) -std=gnu99
251 FS_TARGET_CXXFLAGS = ${TARGET_CXXFLAGS} -DLUA_USE_LINUX $(FPIC)
252 FS_TARGET_CPPFLAGS = -I. -I./lua ${TARGET_CPPFLAGS}
254 ifneq ($(CONFIG_USE_EGLIBC),)
255 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
256 TARGET_CFLAGS += -DNO_GETLOGIN
261 --prefix="/usr/freeswitch" \
262 --bindir="/usr/bin" \
263 --libdir="/usr/lib" \
264 --sysconfdir="/etc/freeswitch" \
265 --with-modinstdir="/usr/lib/freeswitch" \
268 --with-libcurl="$(STAGING_DIR)/usr" \
269 --with-openssl="$(STAGING_DIR)/usr" \
270 --with-random="/dev/urandom" \
279 config_TARGET_CC="${TARGET_CC}" \
280 config_TARGET_CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \
281 config_TARGET_CXX="${TARGET_CXX}" \
282 config_TARGET_CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \
283 config_TARGET_CPPFLAGS="${FS_TARGET_CPPFLAGS}" \
284 config_BUILD_CC="${HOSTCC}" \
285 config_TARGET_READLINE_INC="${FS_TARGET_CPPFLAGS}" \
286 config_TARGET_READLINE_LIBS="${TARGET_LDFLAGS} -lreadline -lncurses" \
287 config_TARGET_LIBS="${TARGET_LDFLAGS} -lpthread" \
288 CC_FOR_BUILD="${HOSTCC}" \
289 LDFLAGS_FOR_BUILD="${HOST_LDFLAGS}" \
291 CXX="${TARGET_CXX}" \
292 CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \
293 CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \
294 CPPFLAGS="${FS_TARGET_CPPFLAGS}" \
295 LDFLAGS="${TARGET_LDFLAGS} -Wl,-rpath-link=\"${STAGING_DIR}/usr/lib\"" \
296 ac_cv_dev_urandom="yes" \
297 ac_cv_file_dbd_apr_dbd_mysql_c="no" \
298 ac_cv_file__dev_random="no" \
299 ac_cv_file__dev_urandom="yes" \
300 ac_cv_file___dev_urandom_="yes" \
301 ac_cv_func_mmap_fixed_mapped="yes" \
302 ac_cv_func_pthread_rwlock_init="yes" \
303 ac_cv_struct_rlimit="yes" \
304 apr_cv_mutex_recursive="yes" \
305 apr_cv_process_shared_works="no" \
306 apr_cv_tcp_nodelay_with_cork="yes" \
307 apr_cv_type_rwlock_t="yes" \
308 ac_cv_path_LIBGNUTLS_CONFIG="no" \
312 $(call Build/Prepare/Default)
314 $(call Prepare/flite)
315 $(call Prepare/json-c)
316 $(call Prepare/sounds-en)
317 $(call Prepare/sounds-moh)
320 define Build/Configure
321 $(call Build/Configure/Default)
322 $(foreach m,$(FS_MOD_AVAILABLE),
323 $(if $(CONFIG_PACKAGE_freeswitch-mod-$(m)),
324 $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
326 $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
332 $(MAKE) -C $(PKG_BUILD_DIR) \
333 DESTDIR="$(PKG_INSTALL_DIR)" \
334 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
335 all $(MAKE_INSTALL_TARGETS)
338 define Build/InstallDev
339 $(INSTALL_DIR) $(1)/usr/include/freeswitch
340 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/include/* $(1)/usr/include/freeswitch/
341 $(INSTALL_DIR) $(1)/usr/lib
342 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreeswitch.{a,so*} $(1)/usr/lib/
345 define Package/freeswitch/install
346 $(INSTALL_DIR) $(1)/usr/bin
347 $(CP) $(PKG_INSTALL_DIR)/usr/bin/freeswitch $(1)/usr/bin/
348 $(INSTALL_DIR) $(1)/usr/lib
349 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreeswitch.so.* $(1)/usr/lib/
350 $(INSTALL_DIR) $(1)/usr/lib/freeswitch
351 $(INSTALL_DIR) $(1)/etc/default
352 $(INSTALL_DATA) ./files/freeswitch.default $(1)/etc/default/freeswitch
353 $(INSTALL_DIR) $(1)/etc/init.d
354 $(INSTALL_BIN) ./files/freeswitch.init $(1)/etc/init.d/freeswitch
355 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
356 $(INSTALL_DATA) ./files/freeswitch.hotplug $(1)/etc/hotplug.d/iface/90-freeswitch
357 $(INSTALL_DIR) $(1)/etc/config
358 $(INSTALL_DATA) ./files/freeswitch.config $(1)/etc/config/freeswitch
361 define Package/freeswitch-default/install
362 $(INSTALL_DIR) $(1)/etc/freeswitch
363 $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/* $(1)/etc/freeswitch/
366 define Package/freeswitch-minimal/install
367 $(INSTALL_DIR) $(1)/etc/freeswitch
368 $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/* $(1)/etc/freeswitch/
371 define Package/freeswitch-sounds-en/install
372 $(INSTALL_DIR) $(1)/usr/freeswitch/sounds
373 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/sounds/en $(1)/usr/freeswitch/sounds/
376 define Package/freeswitch-sounds-moh/install
377 $(INSTALL_DIR) $(1)/usr/freeswitch/sounds
378 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/sounds/music $(1)/usr/freeswitch/sounds/
381 define Package/freeswitch-tools/install
382 $(INSTALL_DIR) $(1)/usr/bin
383 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
392 define Package/freeswitch-mod-$(1)
393 $$(call Package/freeswitch/Default)
394 TITLE:= FS $(2) module
395 DEPENDS:= freeswitch $$(foreach m,$(4),+freeswitch-mod-$$m) $(5)
398 define Package/freeswitch-mod-$(1)/install
399 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeswitch
402 $(PKG_INSTALL_DIR)/usr/lib/freeswitch/$$$$$$$${f}.so \
403 $$(1)/usr/lib/freeswitch/ ; \
407 $$(eval $$(call BuildPackage,freeswitch-mod-$(1)))
410 $(eval $(call BuildPackage,freeswitch))
411 $(eval $(call BuildPackage,freeswitch-default))
412 $(eval $(call BuildPackage,freeswitch-minimal))
413 $(eval $(call BuildPackage,freeswitch-sounds-en))
414 $(eval $(call BuildPackage,freeswitch-sounds-moh))
415 $(eval $(call BuildPackage,freeswitch-tools))
417 #$(eval $(call BuildPlugin,Name,Title,Files,Depends))
418 $(eval $(call BuildPlugin,alsa,Alsa endpoint,mod_alsa,,+alsa-lib))
419 $(eval $(call BuildPlugin,amr,GSM-AMR codec,mod_amr,,))
420 $(eval $(call BuildPlugin,amrwb,GSM-AMRWB,mod_amrwb,,))
421 $(eval $(call BuildPlugin,bv,codec mod_bv,mod_bv,,))
422 $(eval $(call BuildPlugin,cdr-csv,CSV-CDR handler,mod_cdr_csv,,))
423 $(eval $(call BuildPlugin,celt,CELT ultra-low delay codec,mod_celt,,+libogg))
424 $(eval $(call BuildPlugin,cepstral,Cepstral interface,mod_cepstral,,@BROKEN)) # needs <swift.h>
425 $(eval $(call BuildPlugin,cidlookup,applications mod_cidlookup,mod_cidlookup,,))
426 $(eval $(call BuildPlugin,cluechoo,Framework Demo,mod_cluechoo,,))
427 $(eval $(call BuildPlugin,commands,API commands,mod_commands,,))
428 $(eval $(call BuildPlugin,conference,Conference room,mod_conference,,))
429 $(eval $(call BuildPlugin,console,Console logger,mod_console,,))
430 $(eval $(call BuildPlugin,curl,HTTP request,mod_curl,,+libcurl))
431 $(eval $(call BuildPlugin,dahdi-codec,DAHDI codecs,mod_dahdi_codec,,))
432 $(eval $(call BuildPlugin,dialplan-asterisk,Asterisk dialplan parser,mod_dialplan_asterisk,,))
433 $(eval $(call BuildPlugin,dialplan-directory,Dialplan-Directory interface,mod_dialplan_directory,,))
434 $(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML interface,mod_dialplan_xml,,))
435 $(eval $(call BuildPlugin,dingaling,Jabber interface,mod_dingaling,,+libgnutls-openssl))
436 $(eval $(call BuildPlugin,directory,application mod_directory,mod_directory,,))
437 $(eval $(call BuildPlugin,distributor,application mod_distributor,mod_distributor,,))
438 $(eval $(call BuildPlugin,dptools,Dialplan tools,mod_dptools,,))
439 $(eval $(call BuildPlugin,easyroute,DID routing,mod_easyroute,,))
440 $(eval $(call BuildPlugin,enum,ENUM routing,mod_enum,,))
441 $(eval $(call BuildPlugin,erlang-event,Erlang event handler,mod_erlang_event,,@BROKEN)) # needs <ei.h>
442 $(eval $(call BuildPlugin,esf,Extra SIP Functionality,mod_esf,,))
443 $(eval $(call BuildPlugin,event-multicast,Multicast event handler,mod_event_multicast,,))
444 $(eval $(call BuildPlugin,event-socket,Socket event handler,mod_event_socket,,))
445 $(eval $(call BuildPlugin,expr,Expression evaluation,mod_expr,,))
446 $(eval $(call BuildPlugin,fax,Fax,mod_fax,,@BROKEN +libjpeg)) # fails in spandsp
447 $(eval $(call BuildPlugin,fifo,FIFO,mod_fifo,,))
448 $(eval $(call BuildPlugin,file-string,File streaming,mod_file_string,,))
449 $(eval $(call BuildPlugin,flite,Festival TTS,mod_flite,,))
450 $(eval $(call BuildPlugin,fsv,Video,mod_fsv,,))
451 $(eval $(call BuildPlugin,g723-1,G.723.1 codec,mod_g723_1,,))
452 $(eval $(call BuildPlugin,g729,G.729 codec,mod_g729,,))
453 $(eval $(call BuildPlugin,h26x,H26X linear codec,mod_h26x,,))
454 $(eval $(call BuildPlugin,h323,h323 endpoint,mod_h323,,@BROKEN)) # missing header files (other packages needed)
455 $(eval $(call BuildPlugin,java,Java language interface,mod_java,,@BROKEN)) # needs java
456 $(eval $(call BuildPlugin,ilbc,ILBC codec,mod_ilbc,,))
457 $(eval $(call BuildPlugin,lcr,Least Cost Routing,mod_lcr,,))
458 $(eval $(call BuildPlugin,ldap,LDAP interface,mod_ldap,,@BROKEN)) # fails in openldap
459 $(eval $(call BuildPlugin,limit,Resource limitation,mod_limit,,))
460 $(eval $(call BuildPlugin,local-stream,Local streaming,mod_local_stream,,))
461 $(eval $(call BuildPlugin,logfile,File logger,mod_logfile,,))
462 $(eval $(call BuildPlugin,loopback,Loopback endpoint,mod_loopback,,))
463 $(eval $(call BuildPlugin,lua,Lua language interface,mod_lua,,+libstdcpp))
464 $(eval $(call BuildPlugin,managed,language mod_managed,mod_managed,,@BROKEN)) # needs Mono
465 $(eval $(call BuildPlugin,memcache,MemCached interface,mod_memcache,,@BROKEN)) # fails in libmemcached
466 $(eval $(call BuildPlugin,native-file,Native files,mod_native_file,,))
467 $(eval $(call BuildPlugin,nibblebill,Billing,mod_nibblebill,,))
468 $(eval $(call BuildPlugin,opal,Multi-Protocol endpoint,mod_opal,,@BROKEN)) # needs Opal
469 $(eval $(call BuildPlugin,openzap,Zaptel hardware interface,mod_openzap ozmod_analog ozmod_analog_em ozmod_isdn ozmod_skel ozmod_ss7_boost ozmod_zt,,+libpcap))
470 $(eval $(call BuildPlugin,perl,Perl language interface,mod_perl,,+perl @BROKEN)) # needs Perl
471 $(eval $(call BuildPlugin,pocketsphinx,PocketSphinx SR,mod_pocketsphinx,,@BROKEN)) # fails in sphinxbase
472 $(eval $(call BuildPlugin,portaudio,Local audio endpoint,mod_portaudio,,+alsa-lib))
473 $(eval $(call BuildPlugin,portaudio-stream,format mod_portaudio_stream,mod_portaudio_stream,,))
474 $(eval $(call BuildPlugin,python,Python language interface,mod_python,,+python @BROKEN)) # needs Python
475 $(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,mod_radius_cdr,,@BROKEN)) # fails in freeradius-client
476 $(eval $(call BuildPlugin,rss,RRS feeds via TTS,mod_rss,,))
477 $(eval $(call BuildPlugin,say-de,German say,mod_say_de,,))
478 $(eval $(call BuildPlugin,say-en,English say,mod_say_en,,))
479 $(eval $(call BuildPlugin,say-es,Spanish say,mod_say_es,,))
480 $(eval $(call BuildPlugin,say-fr,French say,mod_say_fr,,))
481 $(eval $(call BuildPlugin,say-it,Italian say,mod_say_it,,))
482 $(eval $(call BuildPlugin,say-nl,Dutch say,mod_say_nl,,))
483 $(eval $(call BuildPlugin,say-ru,Russian say,mod_say_ru,,))
484 $(eval $(call BuildPlugin,say-th,mod_th say,mod_say_th,,))
485 $(eval $(call BuildPlugin,say-zh,Chineese say,mod_say_zh,,))
486 $(eval $(call BuildPlugin,shell-stream,,mod_shell_stream,,))
487 $(eval $(call BuildPlugin,shout,MP3 and Shoutcast stream,mod_shout,,@BROKEN)) # needs Ogg/Vorbis
488 $(eval $(call BuildPlugin,silk,codec mod_silk,mod_silk,,))
489 $(eval $(call BuildPlugin,siren,G.722.1 codec,mod_siren,,@BROKEN)) # fails in libg722_1 - attempts to execute cross-compiled binary on host
490 $(eval $(call BuildPlugin,skinny,endpoint mod_skinny,mod_skinny,,))
491 $(eval $(call BuildPlugin,skypopen,Skype compatible endpoint,mod_skypopen,,@BROKEN)) # needs <X11/Xlib.h>
492 $(eval $(call BuildPlugin,sangoma-codec,codec sangoma-codec,mod_sangoma_codec,,@BROKEN)) # Untested
493 $(eval $(call BuildPlugin,snapshot,application mod_snapshot,mod_snapshot,,))
494 $(eval $(call BuildPlugin,snipe-hunt,application mod_snipe_hunt,mod_snipe_hunt,,))
495 $(eval $(call BuildPlugin,sndfile,Multi-Format file transcoder,mod_sndfile,,))
496 $(eval $(call BuildPlugin,snom,SNOM specific features,mod_snom,,))
497 $(eval $(call BuildPlugin,sofia,SIP,mod_sofia,,))
498 $(eval $(call BuildPlugin,soundtouch,Sound effects,mod_soundtouch,,@BROKEN)) # fails in soundtouch
499 $(eval $(call BuildPlugin,speex,Speex codec,mod_speex,,))
500 $(eval $(call BuildPlugin,spidermonkey,JavaScript,mod_spidermonkey,,@BROKEN)) # fails in js
501 $(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,mod_spidermonkey_core_db,,@BROKEN))
502 $(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,mod_spidermonkey_curl,,@BROKEN))
503 $(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,mod_spidermonkey_odbc,,@BROKEN))
504 $(eval $(call BuildPlugin,spidermonkey-socket,JavaScript socket,mod_spidermonkey_socket,,@BROKEN))
505 $(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript teletone,mod_spidermonkey_teletone,,@BROKEN))
506 $(eval $(call BuildPlugin,spy,User spy,mod_spy,,))
507 $(eval $(call BuildPlugin,stress,application mod_stress,mod_stress,,))
508 $(eval $(call BuildPlugin,syslog,SysLog logger,mod_syslog,,))
509 $(eval $(call BuildPlugin,tone-stream,Tone generation stream,mod_tone_stream,,))
510 $(eval $(call BuildPlugin,unimrcp,MRCP interface,mod_unimrcp,,))
511 $(eval $(call BuildPlugin,valet-parking,application mod_valet_parking,mod_valet_parking,,))
512 $(eval $(call BuildPlugin,vmd,VoiceMail beep detection,mod_vmd,,))
513 $(eval $(call BuildPlugin,voicemail,VoiceMail,mod_voicemail,,))
514 $(eval $(call BuildPlugin,voipcodecs,VoIP codecs,mod_voipcodecs,,))
515 $(eval $(call BuildPlugin,xml-cdr,XML-CDR handler,mod_xml_cdr,,+libcurl))
516 $(eval $(call BuildPlugin,xml-curl,XML-Curl gateway,mod_xml_curl,,+libcurl))
517 $(eval $(call BuildPlugin,xml-ldap,LDAP-XML gateway,mod_xml_ldap,,@BROKEN)) # fails in openldap
518 $(eval $(call BuildPlugin,xml-rpc,XML-RPC interface,mod_xml_rpc,,))
519 $(eval $(call BuildPlugin,yaml,YAML dialplans,mod_yaml,,))