[packages] freeswitch: Don't look for libgnutls-config. The package does not
[openwrt/svn-archive/archive.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 PKG_FIXUP:=libtool
19
20 FS_MOD_AVAILABLE:= \
21 alsa \
22 amr \
23 amrwb \
24 cdr-csv \
25 celt \
26 cepstral \
27 cluechoo \
28 commands \
29 conference \
30 console \
31 curl \
32 dahdi-codec \
33 dialplan-asterisk \
34 dialplan-directory \
35 dialplan-xml \
36 dingaling \
37 dptools \
38 easyroute \
39 enum \
40 erlang-event \
41 esf \
42 event-multicast \
43 event-socket \
44 expr \
45 fax \
46 fifo \
47 file-string \
48 flite \
49 fsv \
50 g723-1 \
51 g729 \
52 h26x \
53 iax \
54 ilbc \
55 lcr \
56 ldap \
57 limit \
58 local-stream \
59 logfile \
60 loopback \
61 lua \
62 memcache \
63 native-file \
64 nibblebill \
65 opal \
66 openzap \
67 perl \
68 pocketsphinx \
69 portaudio \
70 python \
71 radius-cdr \
72 rss \
73 say-de \
74 say-en \
75 say-es \
76 say-fr \
77 say-it \
78 say-nl \
79 say-ru \
80 say-zh \
81 shout \
82 siren \
83 skypiax \
84 sndfile \
85 snom \
86 sofia \
87 soundtouch \
88 speex \
89 spidermonkey \
90 spidermonkey-core-db \
91 spidermonkey-curl \
92 spidermonkey-odbc \
93 spidermonkey-socket \
94 spidermonkey-teletone \
95 spy \
96 syslog \
97 tone-stream \
98 unimrcp \
99 vmd \
100 voicemail \
101 voipcodecs \
102 xml-cdr \
103 xml-curl \
104 xml-ldap \
105 xml-rpc \
106 yaml \
107
108 PKG_CONFIG_DEPENDS:= \
109 $(patsubst %,CONFIG_PACKAGE_freeswitch-mod-%,$(FS_MOD_AVAILABLE)) \
110
111 include $(INCLUDE_DIR)/package.mk
112
113 define Package/freeswitch/Default
114 SECTION:=net
115 CATEGORY:=Network
116 URL:=http://www.freeswitch.org/
117 endef
118
119
120 define Package/freeswitch
121 $(call Package/freeswitch/Default)
122 TITLE:=FreeSWITCH open source telephony platform
123 DEPENDS:=+libopenssl +libreadline +libncurses +libpthread +libstdcpp
124 MENU:=1
125 endef
126
127 define Package/freeswitch/description
128 FreeSWITCH is an open source telephony platform designed to
129 facilitate the creation of voice and chat driven products scaling
130 from a soft-phone up to a soft-switch.
131 endef
132
133
134 define Package/freeswitch-default
135 $(call Package/freeswitch/Default)
136 TITLE:=FreeSWITCH default config
137 DEPENDS:=freeswitch \
138 +freeswitch-mod-commands \
139 +freeswitch-mod-conference \
140 +freeswitch-mod-console \
141 +freeswitch-mod-curl \
142 +freeswitch-mod-dialplan-xml \
143 +freeswitch-mod-dptools \
144 +freeswitch-mod-event-socket \
145 +freeswitch-mod-g723-1 \
146 +freeswitch-mod-ilbc \
147 +freeswitch-mod-local-stream \
148 +freeswitch-mod-logfile \
149 +freeswitch-mod-lua \
150 +freeswitch-mod-native-file \
151 +freeswitch-mod-sndfile \
152 +freeswitch-mod-sofia \
153 +freeswitch-mod-speex \
154 +freeswitch-mod-tone-stream \
155 +freeswitch-mod-voipcodecs \
156 +freeswitch-mod-xml-curl \
157 +freeswitch-mod-xml-rpc
158 endef
159
160 define Package/freeswitch-minimal
161 $(call Package/freeswitch/Default)
162 TITLE:=FreeSWITCH minimal config
163 DEPENDS:=freeswitch \
164 +freeswitch-mod-commands \
165 +freeswitch-mod-console \
166 +freeswitch-mod-curl \
167 +freeswitch-mod-dialplan-xml \
168 +freeswitch-mod-dptools \
169 +freeswitch-mod-local-stream \
170 +freeswitch-mod-sndfile \
171 +freeswitch-mod-sofia \
172 +freeswitch-mod-tone-stream \
173 +freeswitch-mod-voipcodecs
174 endef
175
176 define Package/freeswitch-sounds-en
177 $(call Package/freeswitch/Default)
178 TITLE:=FreeSWITCH english sounds
179 DEPENDS:=freeswitch
180 endef
181
182
183 define Package/freeswitch-sounds-moh
184 $(call Package/freeswitch/Default)
185 TITLE:=FreeSWITCH music-on-hold sounds
186 DEPENDS:=freeswitch
187 endef
188
189
190 define Package/freeswitch-tools
191 $(call Package/freeswitch/Default)
192 TITLE:=FreeSWITCH control tools
193 DEPENDS:=freeswitch
194 endef
195
196
197 define Download/files
198 define Download/$(1)
199 FILE:=$(2)
200 URL:=http://files.freeswitch.org/$(4)
201 MD5SUM:=$(3)
202 endef
203 define Prepare/$(1)
204 $(CP) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(5)
205 endef
206 $$(eval $$(call Download,$(1)))
207 endef
208
209 MAKE_INSTALL_TARGETS:=install
210
211 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-celt),)
212 $(eval $(call Download/files,celt,celt-0.6.1.tar.gz,2961ffb6fadb5f905d20de9f0d86e44c,downloads/libs/,libs/))
213 endif
214
215 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-curl),)
216 $(eval $(call Download/files,json-c,json-c-0.8.tar.gz,9c7b90dff16eec3063084829c382ebac,downloads/libs/,libs/))
217 endif
218
219 ifneq ($(CONFIG_PACKAGE_freeswitch-mod-flite),)
220 $(eval $(call Download/files,flite,flite-1.3.99-latest.tar.gz,,downloads/libs/,libs/))
221 endif
222
223 ifneq ($(CONFIG_PACKAGE_freeswitch-sounds-en),)
224 $(eval $(call Download/files,sounds-en,freeswitch-sounds-en-us-callie-8000-1.0.10.tar.gz,f7f85aaf3763673c884ec3451f1c1c3e,,))
225 MAKE_INSTALL_TARGETS+= sounds-install
226 endif
227
228 ifneq ($(CONFIG_PACKAGE_freeswitch-sounds-moh),)
229 $(eval $(call Download/files,sounds-moh,freeswitch-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,))
230 MAKE_INSTALL_TARGETS+= moh-install
231 endif
232
233
234 CONFIGURE_ARGS+= \
235 --prefix="/usr/freeswitch" \
236 --bindir="/usr/bin" \
237 --libdir="/usr/lib" \
238 --sysconfdir="/etc/freeswitch" \
239 --with-modinstdir="/usr/lib/freeswitch" \
240 --enable-ipv6 \
241 \
242 --with-libcurl="$(STAGING_DIR)/usr" \
243 --with-openssl="$(STAGING_DIR)/usr" \
244 --with-random="/dev/urandom" \
245 --without-erlang \
246 --without-java \
247 --without-odbc \
248 --without-mysql \
249 --without-pgsql \
250 --without-python \
251 --disable-zrtp \
252
253 CONFIGURE_VARS+= \
254 config_BUILD_CC="$(HOSTCC)" \
255 config_BUILD_CFLAGS="$(HOST_CFLAGS)" \
256 config_TARGET_CC="$(TARGET_CC)" \
257 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
258 config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
259 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
260 config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread" \
261 CC_FOR_BUILD="$(HOSTCC)" \
262 CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
263 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
264 LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib\"" \
265 ac_cv_dev_urandom="yes" \
266 ac_cv_file_dbd_apr_dbd_mysql_c="no" \
267 ac_cv_file__dev_random="no" \
268 ac_cv_file__dev_urandom="yes" \
269 ac_cv_file___dev_urandom_="yes" \
270 ac_cv_func_mmap_fixed_mapped="yes" \
271 ac_cv_func_pthread_rwlock_init="yes" \
272 ac_cv_struct_rlimit="yes" \
273 apr_cv_mutex_recursive="yes" \
274 apr_cv_process_shared_works="no" \
275 apr_cv_tcp_nodelay_with_cork="yes" \
276 apr_cv_type_rwlock_t="yes" \
277 ac_cv_path_LIBGNUTLS_CONFIG="no" \
278
279 define Build/Prepare
280 $(call Build/Prepare/Default)
281 $(call Prepare/celt)
282 $(call Prepare/flite)
283 $(call Prepare/json-c)
284 $(call Prepare/sounds-en)
285 $(call Prepare/sounds-moh)
286 endef
287
288 define Build/Configure
289 ( cd $(PKG_BUILD_DIR); ./rebootstrap.sh; )
290 $(call Build/Configure/Default)
291 $(foreach m,$(FS_MOD_AVAILABLE),
292 $(if $(CONFIG_PACKAGE_freeswitch-mod-$(m)),
293 $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
294 ,
295 $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
296 )
297 )
298 endef
299
300 define Build/Compile
301 $(MAKE) -C $(PKG_BUILD_DIR) \
302 DESTDIR="$(PKG_INSTALL_DIR)" \
303 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
304 all $(MAKE_INSTALL_TARGETS)
305 endef
306
307 define Build/InstallDev
308 $(INSTALL_DIR) $(1)/usr/include/freeswitch
309 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/include/* $(1)/usr/include/freeswitch/
310 $(INSTALL_DIR) $(1)/usr/lib
311 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreeswitch.{a,so*} $(1)/usr/lib/
312 endef
313
314 define Package/freeswitch/install
315 $(INSTALL_DIR) $(1)/usr/bin
316 $(CP) $(PKG_INSTALL_DIR)/usr/bin/freeswitch $(1)/usr/bin/
317 $(INSTALL_DIR) $(1)/usr/lib
318 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreeswitch.so.* $(1)/usr/lib/
319 $(INSTALL_DIR) $(1)/usr/lib/freeswitch
320 $(INSTALL_DIR) $(1)/etc/default
321 $(INSTALL_DATA) ./files/freeswitch.default $(1)/etc/default/freeswitch
322 $(INSTALL_DIR) $(1)/etc/init.d
323 $(INSTALL_BIN) ./files/freeswitch.init $(1)/etc/init.d/freeswitch
324 endef
325
326 define Package/freeswitch-default/install
327 $(INSTALL_DIR) $(1)/etc/freeswitch
328 $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/* $(1)/etc/freeswitch/
329 endef
330
331 define Package/freeswitch-minimal/install
332 $(INSTALL_DIR) $(1)/etc/freeswitch
333 $(CP) $(PKG_INSTALL_DIR)/etc/freeswitch/* $(1)/etc/freeswitch/
334 endef
335
336 define Package/freeswitch-sounds-en/install
337 $(INSTALL_DIR) $(1)/usr/freeswitch/sounds
338 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/sounds/en $(1)/usr/freeswitch/sounds/
339 endef
340
341 define Package/freeswitch-sounds-moh/install
342 $(INSTALL_DIR) $(1)/usr/freeswitch/sounds
343 $(CP) $(PKG_INSTALL_DIR)/usr/freeswitch/sounds/music $(1)/usr/freeswitch/sounds/
344 endef
345
346 define Package/freeswitch-tools/install
347 $(INSTALL_DIR) $(1)/usr/bin
348 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
349 endef
350
351 # 1. Name
352 # 2. Title
353 # 3. Files
354 # 4. Inter Depends
355 # 5. Extra Depends
356 define BuildPlugin
357 define Package/freeswitch-mod-$(1)
358 $$(call Package/freeswitch/Default)
359 TITLE:= FS $(2) module
360 DEPENDS:=freeswitch $$(foreach m,$(4),+freeswitch-mod-$$m) $(5)
361 endef
362
363 define Package/freeswitch-mod-$(1)/install
364 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeswitch
365 for f in $(3); do \
366 $(CP) \
367 $(PKG_INSTALL_DIR)/usr/lib/freeswitch/$$$$$$$${f}.so \
368 $$(1)/usr/lib/freeswitch/ ; \
369 done
370 endef
371
372 $$(eval $$(call BuildPackage,freeswitch-mod-$(1)))
373 endef
374
375 $(eval $(call BuildPackage,freeswitch))
376 $(eval $(call BuildPackage,freeswitch-default))
377 $(eval $(call BuildPackage,freeswitch-minimal))
378 $(eval $(call BuildPackage,freeswitch-sounds-en))
379 $(eval $(call BuildPackage,freeswitch-sounds-moh))
380 $(eval $(call BuildPackage,freeswitch-tools))
381
382 #$(eval $(call BuildPlugin,Name,Title,Files,Depends))
383 $(eval $(call BuildPlugin,alsa,Alsa endpoint,mod_alsa,,+alsa-lib))
384 $(eval $(call BuildPlugin,amr,GSM-AMR codec,mod_amr,,))
385 $(eval $(call BuildPlugin,amrwb,GSM-AMRWB,mod_amrwb,,))
386 $(eval $(call BuildPlugin,cdr-csv,CSV-CDR handler,mod_cdr_csv,,))
387 $(eval $(call BuildPlugin,celt,CELT ultra-low delay codec,mod_celt,,))
388 $(eval $(call BuildPlugin,cepstral,Cepstral interface,mod_cepstral,,@BROKEN)) # needs <swift.h>
389 $(eval $(call BuildPlugin,cluechoo,Framework Demo,mod_cluechoo,,))
390 $(eval $(call BuildPlugin,commands,API commands,mod_commands,,))
391 $(eval $(call BuildPlugin,conference,Conference room,mod_conference,,))
392 $(eval $(call BuildPlugin,console,Console logger,mod_console,,))
393 $(eval $(call BuildPlugin,curl,HTTP request,mod_curl,,))
394 $(eval $(call BuildPlugin,dahdi-codec,DAHDI codecs,mod_dahdi_codec,,))
395 $(eval $(call BuildPlugin,dialplan-asterisk,Asterisk dialplan parser,mod_dialplan_asterisk,,))
396 $(eval $(call BuildPlugin,dialplan-directory,Dialplan-Directory interface,mod_dialplan_directory,,))
397 $(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML interface,mod_dialplan_xml,,))
398 $(eval $(call BuildPlugin,dingaling,Jabber interface,mod_dingaling,,))
399 $(eval $(call BuildPlugin,dptools,Dialplan tools,mod_dptools,,))
400 $(eval $(call BuildPlugin,easyroute,DID routing,mod_easyroute,,))
401 $(eval $(call BuildPlugin,enum,ENUM routing,mod_enum,,))
402 $(eval $(call BuildPlugin,erlang-event,Erlang event handler,mod_erlang_event,,@BROKEN)) # needs <ei.h>
403 $(eval $(call BuildPlugin,esf,Extra SIP Functionality,mod_esf,,))
404 $(eval $(call BuildPlugin,event-multicast,Multicast event handler,mod_event_multicast,,))
405 $(eval $(call BuildPlugin,event-socket,Socket event handler,mod_event_socket,,))
406 $(eval $(call BuildPlugin,expr,Expression evaluation,mod_expr,,))
407 $(eval $(call BuildPlugin,fax,Fax,mod_fax,,@BROKEN)) # fails in spandsp
408 $(eval $(call BuildPlugin,fifo,FIFO,mod_fifo,,))
409 $(eval $(call BuildPlugin,file-string,File streaming,mod_file_string,,))
410 $(eval $(call BuildPlugin,flite,Festival TTS,mod_flite,,))
411 $(eval $(call BuildPlugin,fsv,Video,mod_fsv,,))
412 $(eval $(call BuildPlugin,g723-1,G.723.1 codec,mod_g723_1,,))
413 $(eval $(call BuildPlugin,g729,G.729 codec,mod_g729,,))
414 $(eval $(call BuildPlugin,h26x,H26X linear codec,mod_h26x,,))
415 $(eval $(call BuildPlugin,iax,IAX2 interface,mod_iax,,))
416 $(eval $(call BuildPlugin,ilbc,ILBC codec,mod_ilbc,,))
417 $(eval $(call BuildPlugin,lcr,Least Cost Routing,mod_lcr,,))
418 $(eval $(call BuildPlugin,ldap,LDAP interface,mod_ldap,,@BROKEN)) # fails in openldap
419 $(eval $(call BuildPlugin,limit,Resource limitation,mod_limit,,))
420 $(eval $(call BuildPlugin,local-stream,Local streaming,mod_local_stream,,))
421 $(eval $(call BuildPlugin,logfile,File logger,mod_logfile,,))
422 $(eval $(call BuildPlugin,loopback,Loopback endpoint,mod_loopback,,))
423 $(eval $(call BuildPlugin,lua,Lua language interface,mod_lua,,+libstdcpp)) # needs C++
424 $(eval $(call BuildPlugin,memcache,MemCached interface,mod_memcache,,@BROKEN)) # fails in libmemcached
425 $(eval $(call BuildPlugin,native-file,Native files,mod_native_file,,))
426 $(eval $(call BuildPlugin,nibblebill,Billing,mod_nibblebill,,))
427 $(eval $(call BuildPlugin,opal,Multi-Protocol endpoint,mod_opal,,@BROKEN)) # needs Opal
428 $(eval $(call BuildPlugin,openzap,Zaptel hardware interface,mod_openzap ozmod_analog ozmod_analog_em ozmod_isdn ozmod_skel ozmod_ss7_boost ozmod_zt,,+libpcap))
429 $(eval $(call BuildPlugin,perl,Perl language interface,mod_perl,,+perl @BROKEN)) # needs Perl
430 $(eval $(call BuildPlugin,pocketsphinx,PocketSphinx SR,mod_pocketsphinx,,@BROKEN)) # fails in sphinxbase
431 $(eval $(call BuildPlugin,portaudio,Local audio endpoint,mod_portaudio,,+alsa-lib))
432 $(eval $(call BuildPlugin,python,Python language interface,mod_python,,+python @BROKEN)) # needs Python
433 $(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,mod_radius_cdr,,@BROKEN)) # fails in freeradius-client
434 $(eval $(call BuildPlugin,rss,RRS feeds via TTS,mod_rss,,))
435 $(eval $(call BuildPlugin,say-de,German say,mod_say_de,,))
436 $(eval $(call BuildPlugin,say-en,English say,mod_say_en,,))
437 $(eval $(call BuildPlugin,say-es,Spanish say,mod_say_es,,))
438 $(eval $(call BuildPlugin,say-fr,French say,mod_say_fr,,))
439 $(eval $(call BuildPlugin,say-it,Italian say,mod_say_it,,))
440 $(eval $(call BuildPlugin,say-nl,Dutch say,mod_say_nl,,))
441 $(eval $(call BuildPlugin,say-ru,Russian say,mod_say_ru,,))
442 $(eval $(call BuildPlugin,say-zh,Chineese say,mod_say_zh,,))
443 $(eval $(call BuildPlugin,shout,MP3 and Shoutcast stream,mod_shout,,@BROKEN)) # needs Ogg/Vorbis
444 $(eval $(call BuildPlugin,siren,G.722.1 codec,mod_siren,,@BROKEN)) # fails in libg722_1
445 $(eval $(call BuildPlugin,skypiax,Skype compatible endpoint,mod_skypiax,,@BROKEN)) # needs <X11/Xlib.h>
446 $(eval $(call BuildPlugin,sndfile,Multi-Format file transcoder,mod_sndfile,,))
447 $(eval $(call BuildPlugin,snom,SNOM specific features,mod_snom,,))
448 $(eval $(call BuildPlugin,sofia,SIP,mod_sofia,,))
449 $(eval $(call BuildPlugin,soundtouch,Sound effects,mod_soundtouch,,@BROKEN)) # fails in soundtouch
450 $(eval $(call BuildPlugin,speex,Speex codec,mod_speex,,))
451 $(eval $(call BuildPlugin,spidermonkey,JavaScript,mod_spidermonkey,,@BROKEN)) # fails in js
452 $(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,mod_spidermonkey_core_db,,@BROKEN))
453 $(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,mod_spidermonkey_curl,,@BROKEN))
454 $(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,mod_spidermonkey_odbc,,@BROKEN))
455 $(eval $(call BuildPlugin,spidermonkey-socket,JavaScript socket,mod_spidermonkey_socket,,@BROKEN))
456 $(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript teletone,mod_spidermonkey_teletone,,@BROKEN))
457 $(eval $(call BuildPlugin,spy,User spy,mod_spy,,))
458 $(eval $(call BuildPlugin,syslog,SysLog logger,mod_syslog,,))
459 $(eval $(call BuildPlugin,tone-stream,Tone generation stream,mod_tone_stream,,))
460 $(eval $(call BuildPlugin,unimrcp,MRCP interface,mod_unimrcp,,))
461 $(eval $(call BuildPlugin,vmd,VoiceMail beep detection,mod_vmd,,))
462 $(eval $(call BuildPlugin,voicemail,VoiceMail,mod_voicemail,,))
463 $(eval $(call BuildPlugin,voipcodecs,VoIP codecs,mod_voipcodecs,,))
464 $(eval $(call BuildPlugin,xml-cdr,XML-CDR handler,mod_xml_cdr,,+libcurl))
465 $(eval $(call BuildPlugin,xml-curl,XML-Curl gateway,mod_xml_curl,,+libcurl))
466 $(eval $(call BuildPlugin,xml-ldap,LDAP-XML gateway,mod_xml_ldap,,@BROKEN)) # fails in openldap
467 $(eval $(call BuildPlugin,xml-rpc,XML-RPC interface,mod_xml_rpc,,))
468 $(eval $(call BuildPlugin,yaml,YAML dialplans,mod_yaml,,))