updated to FS git HEAD 5e3a6fc5e6f40be5d68c8b3cfbbfa3227fe06c2f
[openwrt/svn-archive/archive.git] / net / freeswitch / Makefile
1 #
2 # Copyright (C) 2009-2013 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
11 PKG_NAME:=freeswitch
12 PKG_DISTNAME:=$(PKG_NAME)_git
13 PKG_VERSION:=1.3.13b
14 PKG_RELEASE:=1
15
16
17 #
18 # The latest FS git hash in PKG_REV can be obtained from http://fisheye.freeswitch.org
19 #
20 PKG_REV:=5e3a6fc5e6f40be5d68c8b3cfbbfa3227fe06c2f
21 PKG_SOURCE_VERSION:=$(PKG_REV)
22 PKG_SOURCE_PROTO:=git
23 PKG_SOURCE_URL:=git://git.$(PKG_NAME).org/$(PKG_NAME).git
24 PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)
25 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(shell echo $(PKG_REV)|cut -b -7).tar.xz
26 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
27
28
29 PKG_FIXUP:=autoreconf
30 PKG_BUILD_PARALLEL:=1
31
32
33 FS_MOD_AVAILABLE:= \
34 abstraction \
35 alsa \
36 amr \
37 amrwb \
38 avmd \
39 blacklist \
40 bv \
41 callcenter \
42 cdr-csv \
43 cdr-pg-csv \
44 cdr-sqlite \
45 celt \
46 cepstral \
47 cidlookup \
48 cluechoo \
49 codec2 \
50 commands \
51 conference \
52 console \
53 curl \
54 dahdi-codec \
55 db \
56 dialplan-asterisk \
57 dialplan-directory \
58 dialplan-xml \
59 dingaling \
60 directory \
61 distributor \
62 dptools \
63 easyroute \
64 enum \
65 erlang-event \
66 esf \
67 event-multicast \
68 event-socket \
69 event-zmq \
70 expr \
71 fifo \
72 file-string \
73 flite \
74 fsk \
75 fsv \
76 g723-1 \
77 g729 \
78 gsmopen \
79 h26x \
80 h323 \
81 hash \
82 html5 \
83 httapi \
84 http-cache \
85 ilbc \
86 isac \
87 java \
88 json-cdr \
89 lcr \
90 local-stream \
91 logfile \
92 loopback \
93 lua \
94 managed \
95 mp4 \
96 mp4v \
97 native-file \
98 nibblebill \
99 openzap \
100 opus \
101 oreka \
102 portaudio \
103 portaudio-stream \
104 posix-timer \
105 radius-cdr \
106 redis \
107 rss \
108 rtmp \
109 sangoma-codec \
110 say-de \
111 say-en \
112 say-es \
113 say-fa \
114 say-fr \
115 say-hu \
116 say-it \
117 say-nl \
118 say-pt \
119 say-ru \
120 say-th \
121 say-zh \
122 shell-stream \
123 silk \
124 siren \
125 skel \
126 skinny \
127 skypopen \
128 sms \
129 snapshot \
130 snipe-hunt \
131 sndfile \
132 snmp \
133 snom \
134 sofia \
135 sonar \
136 spandsp \
137 speex \
138 spidermonkey \
139 spidermonkey-core-db \
140 spidermonkey-curl \
141 spidermonkey-odbc \
142 spidermonkey-socket \
143 spidermonkey-teletone \
144 spy \
145 stress \
146 syslog \
147 tone-stream \
148 tts-commandline \
149 unimrcp \
150 valet-parking \
151 vmd \
152 voicemail \
153 voicemail-ivr \
154 xml-cdr \
155 xml-curl \
156 xml-rpc \
157 xml-scgi \
158 yaml \
159
160
161 PKG_CONFIG_DEPENDS:= \
162 CONFIG_FS_SOFIA_WITH_IPV6 \
163 CONFIG_FS_SOFIA_WITH_MYSQL \
164 CONFIG_FS_SOFIA_WITH_ODBC \
165 CONFIG_FS_SOFIA_WITH_OPT \
166 CONFIG_FS_SOFIA_WITH_SCTP \
167 CONFIG_FS_SOFIA_WITH_ZRTP_GIT \
168 $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \
169
170
171 include $(INCLUDE_DIR)/package.mk
172 include $(INCLUDE_DIR)/nls.mk
173
174
175 TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR)
176
177
178 define Package/$(PKG_NAME)/Default
179 SECTION:=net
180 CATEGORY:=Network
181 SUBMENU:=Telephony
182 URL:=http://www.$(PKG_NAME).org/
183 MAINTAINER:=Mazilo <OpenWRT@slickdeals.endjunk.com>
184 endef
185
186
187 define Package/$(PKG_NAME)
188 $(call Package/$(PKG_NAME)/Default)
189 TITLE:=FreeSWITCH open source telephony platform
190 DEPENDS:=+libcurl +libjpeg +libncurses +libpq +libpthread +librt +libstdcpp
191 MENU:=1
192 endef
193
194
195 define Package/$(PKG_NAME)/description
196 FreeSWITCH is an open source telephony platform designed to
197 facilitate the creation of voice and chat driven products scaling
198 from a soft-phone up to a soft-switch. See http://wiki.$(PKG_NAME).org
199 endef
200
201
202 define Package/$(PKG_NAME)/config
203 config FS_SOFIA_WITH_IPV6
204 depends on PACKAGE_$(PKG_NAME)
205 bool "Compile with IPV6 support"
206 default y
207 help
208 Compile $(PKG_NAME) with IPV6 Support.
209
210 config FS_SOFIA_WITH_OPT
211 depends on PACKAGE_$(PKG_NAME)
212 bool "Compile with optimization"
213 default y
214 help
215 Compile $(PKG_NAME) with optimization enabled.
216 endef
217
218
219 define Package/$(PKG_NAME)-mod-sofia/config
220 config FS_SOFIA_WITH_MYSQL
221 depends on PACKAGE_$(PKG_NAME)-mod-sofia
222 bool "Compile with MySQL"
223 default n
224 select PACKAGE_libmysqlclient
225 help
226 Compile $(PKG_NAME) with MySQL.
227
228 config FS_SOFIA_WITH_ODBC
229 depends on PACKAGE_$(PKG_NAME)-mod-sofia
230 depends on PACKAGE_sqliteodbc
231 depends on PACKAGE_unixodbc_svn
232 bool "Compile with ODBC support (Requires unixodbc_svn NOT YET AVAILABLE)"
233 default n
234 help
235 Compile $(PKG_NAME)-mod-sofia with ODBC Support. Since both sqliteodbc and unixodbc_svn packages are not yet available on OpenWRT, $(PKG_NAME)-mod-sofia CAN NOT be compiled with ODBC support.
236
237 config FS_SOFIA_WITH_SCTP
238 depends on PACKAGE_$(PKG_NAME)-mod-sofia
239 depends on PACKAGE_sctp
240 bool "Compile with SCTP (Stream Control Transfer Protocol) support"
241 default y
242 help
243 Compile $(PKG_NAME)-mod-sofia with SCTP support.
244
245 config FS_SOFIA_WITH_ZRTP_GIT
246 depends on PACKAGE_$(PKG_NAME)-mod-sofia
247 depends on PACKAGE_libzrtpcpp
248 bool "Compile with ZRTP support (Requires libzrtpcpp NOT YET AVAILABLE)"
249 default n
250 #select PACKAGE_libzrtpcpp
251 help
252 Compile $(PKG_NAME)-mod-sofia with ZRTP Support. Since libzrtpcpp package is not yet available on OpenWRT, $(PKG_NAME)-mod-sofia CAN NOT be compiled with ZRTP support.
253 endef
254
255
256 define Package/$(PKG_NAME)-example-config
257 $(call Package/$(PKG_NAME)/Default)
258 TITLE:=FreeSWITCH example config (commented)
259 DEPENDS:= $(PKG_NAME)
260 endef
261
262
263 define Package/$(PKG_NAME)-example-config/description
264 The default configuration included with FreeSWITCH. It is not intended to be
265 a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to
266 be an example of how FreeSWITCH can be configured.
267 endef
268
269
270 define Package/$(PKG_NAME)-config-upstream-defaults
271 $(call Package/$(PKG_NAME)/Default)
272 TITLE:=FreeSWITCH upstream config
273 DEPENDS:= $(PKG_NAME)
274 endef
275
276
277 define Package/$(PKG_NAME)-config-upstream-defaults/description
278 The default configuration included with FreeSWITCH. It is not intended to be
279 a final product, and but is included for those who don't want to use the
280 OpenWRT configuration and/or want to try things as prepared by upstream.
281 endef
282
283
284 define Package/$(PKG_NAME)-config-minimal
285 $(call Package/$(PKG_NAME)/Default)
286 TITLE:=FreeSWITCH minimal config
287 DEPENDS:= $(PKG_NAME)
288 endef
289
290
291 define Package/$(PKG_NAME)-config-minimal/description
292 A minimal configuration of FreeSWITCH for OpenWRT devices. Is what the UCI
293 configuration began with.
294 endef
295
296
297 define Package/$(PKG_NAME)-collection-upstream-defaults
298 $(call Package/$(PKG_NAME)/Default)
299 TITLE:=FS upstream def sample conf
300 DEPENDS:= $(PKG_NAME) \
301 +$(PKG_NAME)-config-upstream-defaults \
302 +$(PKG_NAME)-mod-callcenter \
303 +$(PKG_NAME)-mod-codec2 \
304 +$(PKG_NAME)-mod-commands \
305 +$(PKG_NAME)-mod-conference \
306 +$(PKG_NAME)-mod-curl \
307 +$(PKG_NAME)-mod-dialplan-xml \
308 +$(PKG_NAME)-mod-dingaling \
309 +$(PKG_NAME)-mod-dptools \
310 +$(PKG_NAME)-mod-event-socket \
311 +$(PKG_NAME)-mod-g723-1 \
312 +$(PKG_NAME)-mod-g729 \
313 +$(PKG_NAME)-mod-hash \
314 +$(PKG_NAME)-mod-http-cache \
315 +$(PKG_NAME)-mod-ilbc \
316 +$(PKG_NAME)-mod-local-stream \
317 +$(PKG_NAME)-mod-lua \
318 +$(PKG_NAME)-mod-native-file \
319 +$(PKG_NAME)-mod-sndfile \
320 +$(PKG_NAME)-mod-sofia \
321 +$(PKG_NAME)-mod-spandsp \
322 +$(PKG_NAME)-mod-speex \
323 +$(PKG_NAME)-mod-syslog \
324 +$(PKG_NAME)-mod-tone-stream \
325 +$(PKG_NAME)-mod-xml-curl \
326 +$(PKG_NAME)-mod-xml-rpc \
327 +$(PKG_NAME)-tools
328 endef
329
330
331 define Package/$(PKG_NAME)-collection-minimal
332 $(call Package/$(PKG_NAME)/Default)
333 TITLE:=FreeSWITCH minimal package collection
334 DEFAULT:=y
335 DEPENDS:= $(PKG_NAME) \
336 +$(PKG_NAME)-config-minimal \
337 +$(PKG_NAME)-mod-codec2 \
338 +$(PKG_NAME)-mod-commands \
339 +$(PKG_NAME)-mod-dialplan-xml \
340 +$(PKG_NAME)-mod-dptools \
341 +$(PKG_NAME)-mod-event-socket \
342 +$(PKG_NAME)-mod-hash \
343 +$(PKG_NAME)-mod-local-stream \
344 +$(PKG_NAME)-mod-sndfile \
345 +$(PKG_NAME)-mod-sofia \
346 +$(PKG_NAME)-mod-syslog \
347 +$(PKG_NAME)-mod-tone-stream \
348 +$(PKG_NAME)-tools
349 endef
350
351
352 define Package/$(PKG_NAME)-sounds-en
353 $(call Package/$(PKG_NAME)/Default)
354 TITLE:=FreeSWITCH english sounds
355 DEPENDS:= $(PKG_NAME)
356 endef
357
358
359 define Package/$(PKG_NAME)-sounds-moh
360 $(call Package/$(PKG_NAME)/Default)
361 TITLE:=FreeSWITCH music-on-hold sounds
362 DEPENDS:= $(PKG_NAME)
363 endef
364
365
366 define Package/$(PKG_NAME)-tools
367 $(call Package/$(PKG_NAME)/Default)
368 TITLE:=FreeSWITCH control tools
369 DEPENDS:= $(PKG_NAME)
370 endef
371
372 define Package/libopenzap
373 $(call Package/$(PKG_NAME)/Default)
374 TITLE:=FreeSWITCH openzap library
375 DEPENDS:=+libpthread
376 endef
377
378
379 define Download/files
380 define Download/$(1)
381 FILE:=$(2)
382 URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5)
383 MD5SUM:=$(3)
384 endef
385 define Prepare/$(1)
386 $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6)
387 endef
388 $$(eval $$(call Download,$(1)))
389 endef
390
391
392 MAKE_INSTALL_TARGETS:=install
393
394
395 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),)
396 $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/))
397 endif
398
399
400 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),)
401 $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/))
402 endif
403
404
405 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
406 $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/))
407 endif
408
409
410 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),)
411 $(eval $(call Download/files,flite,flite-1.5.4-current.tar.bz2,f3a2d88b1059f6f4ff3c20a8169bc0f4,,downloads/libs/,libs/))
412 endif
413
414
415 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),)
416 $(eval $(call Download/files,opus,opus-1.0.2.tar.gz,ic503ad05a59ddb44deab96204401be03,,downloads/libs/,libs/))
417 endif
418
419
420 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en),)
421 $(eval $(call Download/files,sounds-en,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.22.tar.gz,cff509d878708ce5e6e7fedac7f683ef,,,))
422 MAKE_INSTALL_TARGETS+= sounds-install
423 endif
424
425
426 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh),)
427 $(eval $(call Download/files,sounds-moh,$(PKG_NAME)-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,,))
428 MAKE_INSTALL_TARGETS+= moh-install
429 endif
430
431
432 #
433 # XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues
434 #
435 ifneq ($(CONFIG_avr32),)
436 TARGET_CFLAGS += -fgnu89-inline
437 TARGET_CXXFLAGS += -fgnu89-inline
438 endif
439
440
441 ifneq ($(CONFIG_USE_EGLIBC),)
442 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
443 TARGET_CFLAGS += -DNO_GETLOGIN
444 endif
445 endif
446
447
448 FS_TARGET_CFLAGS:= ${TARGET_CFLAGS} -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format
449 FS_TARGET_CXXFLAGS:= ${TARGET_CXXFLAGS} -DLUA_USE_LINUX $(FPIC) -Wno-format
450 FS_TARGET_CPPFLAGS:= -I. -I./lua $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),-I$(STAGING_DIR_HOST)/lib/erlang/lib/erl_interface-3.6/include) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) ${TARGET_CPPFLAGS}
451
452
453 CONFIGURE_ARGS+= \
454 --host=$(GNU_TARGET_NAME) \
455 --build=$(GNU_HOST_NAME) \
456 --prefix="/usr/share/$(PKG_NAME)" \
457 --bindir="/usr/bin" \
458 --libdir="/usr/lib" \
459 --srcdir="$(PKG_BUILD_DIR)" \
460 --sysconfdir="/etc/$(PKG_NAME)" \
461 --with-modinstdir="/usr/lib/$(PKG_NAME)" \
462 --with-random="/dev/urandom" \
463 $(if $(CONFIG_FS_SOFIA_WITH_MYSQL),--with-mysql,--without-mysql) \
464 $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_IPV6,ipv6) \
465 $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_OPT,optimization) \
466 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-iogg) \
467 $(if ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-cdr)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-curl)),--with-libcurl="$(STAGING_DIR)/usr",--without-libcurl) \
468 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \
469 $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \
470 $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_ZRTP_GIT,zrtp) \
471 $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_ODBC,core-odbc-support) \
472 $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
473 $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \
474
475
476 CONFIGURE_VARS+= \
477 config_TARGET_CC="$(TOOLCHAIN_DIR)/bin/${TARGET_CC}" \
478 config_TARGET_CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \
479 config_TARGET_CXX="$(TOOLCHAIN_DIR)/bin/${TARGET_CXX}" \
480 config_TARGET_CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \
481 config_TARGET_CPPFLAGS="${FS_TARGET_CPPFLAGS}" \
482 config_TARGET_READLINE_INC="${FS_TARGET_CPPFLAGS}" \
483 config_TARGET_READLINE_LIBS="${TARGET_LDFLAGS} -lreadline -lncurses" \
484 config_TARGET_LIBS="${TARGET_LDFLAGS} -lpthread -ldl" \
485 config_BUILD_CC="${HOSTCC}" \
486 config_BUILD_CFLAGS="${HOST_CFLAGS}" \
487 CC_FOR_BUILD="${HOSTCC}" \
488 BUILDTOOL_CC="${HOSTCC}" \
489 BUILDTOOL_CCLD="${HOSTCC}" \
490 LDFLAGS="$$$$LDFLAGS" \
491 LDFLAGS_FOR_BUILD="${HOST_LDFLAGS}" \
492 CC="$(TOOLCHAIN_DIR)/bin/${TARGET_CC}" \
493 CXX="$(TOOLCHAIN_DIR)/bin/${TARGET_CXX}" \
494 CFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CFLAGS}" \
495 CXXFLAGS="${FS_TARGET_CPPFLAGS} ${FS_TARGET_CXXFLAGS}" \
496 CPPFLAGS="${FS_TARGET_CPPFLAGS}" \
497 LDFLAGS="${TARGET_LDFLAGS} -Wl,-rpath-link=\"${STAGING_DIR}/usr/lib\"" \
498 PATH="${PATH}:${STAGING_DIR}" \
499 HOST_CC="/usr/bin/cc" \
500 HOST_CXX="/usr/bin/g++" \
501 CROSS_COMPILE="1" \
502 ax_cv_c_compiler_vendor="gnu" \
503 ac_cv_dev_urandom="yes" \
504 ac_cv_file_dbd_apr_dbd_mysql_c="no" \
505 ac_cv_file__dev_random="no" \
506 ac_cv_file__dev_urandom="yes" \
507 ac_cv_file___dev_urandom_="yes" \
508 ac_cv_func_mmap_fixed_mapped="yes" \
509 ac_cv_func_pthread_rwlock_init="yes" \
510 ac_cv_struct_rlimit="yes" \
511 apr_cv_mutex_recursive="yes" \
512 apr_cv_process_shared_works="no" \
513 apr_cv_tcp_nodelay_with_cork="yes" \
514 apr_cv_type_rwlock_t="yes" \
515 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),ac_cv_path_PERL="yes",) \
516 libzmq_cv_cxx_werror_flag="" \
517 ac_cv_path_PKG_CONFIG=no \
518 ac_cv_path_LIBGNUTLS_CONFIG=no
519
520
521 define Build/Prepare
522 $(call Build/Prepare/Default)
523 $(call Prepare/celt)
524 $(call Prepare/event-zmq)
525 $(call Prepare/flite)
526 $(call Prepare/json-cdr)
527 $(call Prepare/opus)
528 $(call Prepare/sounds-en)
529 $(call Prepare/sounds-moh)
530 endef
531
532
533 define Build/Configure
534 if [ -d $(PKG_BUILD_DIR)/libs/libcodec2/src ]; then \
535 (cd $(PKG_BUILD_DIR)/libs/libcodec2/src; $(HOSTCC) -c generate_codebook.c; $(HOSTCC) -o generate_codebook generate_codebook.o -lm) \
536 fi
537 (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh)
538 $(call Build/Configure/Default,)
539 $(foreach m,$(FS_MOD_AVAILABLE),
540 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
541 $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
542 ,
543 $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
544 )
545 )
546 endef
547
548
549 define Build/Compile
550 $(MAKE) -C $(PKG_BUILD_DIR) \
551 AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
552 RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
553 CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
554 CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
555 DESTDIR="$(PKG_INSTALL_DIR)" \
556 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
557 all $(MAKE_INSTALL_TARGETS)
558 $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1<!-- \2"mod_console"\3 -->|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
559 $(SED) 's|^\([ \t]*\)<!-- *\(.*\)"mod_syslog"\(.*\) *-->\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
560 endef
561
562
563 define Build/InstallDev
564 $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
565 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/include/* $(1)/usr/include/$(PKG_NAME)/
566 $(INSTALL_DIR) $(1)/usr/lib
567 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/
568 endef
569
570
571 define Package/$(PKG_NAME)/install
572 $(INSTALL_DIR) $(1)/usr/bin
573 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
574 $(INSTALL_DIR) $(1)/usr/lib
575 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).so.* $(1)/usr/lib/
576 $(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME)
577 $(INSTALL_DIR) $(1)/etc/default
578 $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
579 $(INSTALL_DIR) $(1)/etc/init.d
580 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
581 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
582 $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME)
583 $(INSTALL_DIR) $(1)/etc/config
584 $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
585 endef
586
587
588 define Package/$(PKG_NAME)-collection-upstream-defaults/install
589 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
590 endef
591
592
593 define Package/$(PKG_NAME)-example-config/install
594 $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf
595 $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/
596 endef
597
598
599 define Package/$(PKG_NAME)-config-upstream-defaults/install
600 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
601 $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/etc/$(PKG_NAME)/
602 endef
603
604
605 define Package/$(PKG_NAME)-collection-minimal/install
606 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
607 endef
608
609
610 define Package/$(PKG_NAME)-collection-uci-minimal/install
611 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
612 endef
613
614
615 define Package/$(PKG_NAME)-config-minimal/install
616 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
617 $(CP) ./files/etc.minimal/* $(1)/etc/$(PKG_NAME)/
618 endef
619
620
621 define Package/$(PKG_NAME)-sounds-en/install
622 $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds
623 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en $(1)/usr/share/$(PKG_NAME)/sounds/
624 endef
625
626
627 define Package/$(PKG_NAME)-sounds-moh/install
628 $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds
629 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music $(1)/usr/share/$(PKG_NAME)/sounds/
630 endef
631
632 define Package/libopenzap/install
633 $(INSTALL_DIR) $(1)/usr/lib
634 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenzap.so* $(1)/usr/lib/
635 endef
636
637 define Package/$(PKG_NAME)-tools/install
638 $(INSTALL_DIR) $(1)/usr/bin
639 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
640 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/
641 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/
642 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/
643 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/
644 $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/
645 endef
646
647
648 #
649 # 1. Name
650 # 2. Title
651 # 3. Files
652 # 4. Inter Depends
653 # 5. Extra Depends
654 #
655 define BuildPlugin
656 define Package/$(PKG_NAME)-mod-$(1)
657 $$(call Package/$(PKG_NAME)/Default)
658 TITLE:= FS $(2) module
659 DEPENDS:= $(PKG_NAME) $(foreach m,$(4),+$(PKG_NAME)-mod-$(m)) $(5)
660 endef
661
662 define Package/$(PKG_NAME)-mod-$(1)/install
663 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME)
664 for f in $(3); do \
665 $(CP) \
666 $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$$$$$$$${f}.so \
667 $$(1)/usr/lib/$(PKG_NAME)/ ; \
668 done
669 if [ -d "./files/etc.packages/$(1)" ]; then \
670 $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME) ; \
671 $(CP) \
672 ./files/etc.packages/$(1)/* \
673 $$(1)/etc/$(PKG_NAME)/ ; \
674 fi
675 endef
676
677 define Package/$(PKG_NAME)-mod-$(1)/postinst
678 #!/bin/sh
679 sed -i -e 's|^\([ \t]*\)<!-- *\(.*\)"mod_$(subst -,_,$(1))"\(.*\) *-->\(.*\)$$$$|\1\2"mod_$(subst -,_,$(1))"\3\4|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
680 endef
681
682 define Package/$(PKG_NAME)-mod-$(1)/postrm
683 #!/bin/sh
684 sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1<!-- \2"mod_$(subst -,_,$(1))"\3 -->|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
685 endef
686
687 $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
688 endef
689
690
691 $(eval $(call BuildPackage,$(PKG_NAME)))
692 $(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults))
693 $(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal))
694 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en))
695 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh))
696 $(eval $(call BuildPackage,$(PKG_NAME)-tools))
697 $(eval $(call BuildPackage,$(PKG_NAME)-example-config))
698 $(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults))
699 $(eval $(call BuildPackage,$(PKG_NAME)-config-minimal))
700 $(eval $(call BuildPackage,libopenzap))
701
702
703 #
704 # $(eval $(call BuildPlugin,Name,Title,Files,Inter Depends,Extra Depends))
705 #
706 $(eval $(call BuildPlugin,abstraction,Abstraction epplication,mod_abstraction,,))
707 $(eval $(call BuildPlugin,alsa,Alsa endpoint,mod_alsa,,+alsa-lib))
708 $(eval $(call BuildPlugin,amr,GSM-AMR codec,mod_amr,,))
709 $(eval $(call BuildPlugin,amrwb,GSM-AMRWB,mod_amrwb,,))
710 $(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,mod_avmd,,))
711 $(eval $(call BuildPlugin,bv,codec mod_bv,mod_bv,,))
712 $(eval $(call BuildPlugin,blacklist,application blacklist,mod_blacklist,,))
713 $(eval $(call BuildPlugin,callcenter,Call Center,mod_callcenter,,))
714 $(eval $(call BuildPlugin,cdr-csv,CSV-CDR handler,mod_cdr_csv,,))
715 $(eval $(call BuildPlugin,cdr-pg-csv,Postgress CDR handler,mod_cdr_pg_csv,,+coreutils +libpq))
716 $(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR handler,mod_cdr_sqlite,,+libsqlite3))
717 $(eval $(call BuildPlugin,celt,CELT ultra-low delay codec,mod_celt,,+libogg))
718 $(eval $(call BuildPlugin,cepstral,Cepstral interface,mod_cepstral,,@BROKEN)) # needs <swift.h>
719 $(eval $(call BuildPlugin,cidlookup,applications mod_cidlookup,mod_cidlookup,,+libcurl))
720 $(eval $(call BuildPlugin,cluechoo,Framework Demo,mod_cluechoo,,))
721 $(eval $(call BuildPlugin,codec2,CoDec 2,mod_codec2,,))
722 $(eval $(call BuildPlugin,commands,API commands,mod_commands,,))
723 $(eval $(call BuildPlugin,conference,Conference room,mod_conference,,))
724 $(eval $(call BuildPlugin,console,Console logger,mod_console,,))
725 $(eval $(call BuildPlugin,curl,HTTP request,mod_curl,,+libcurl))
726 $(eval $(call BuildPlugin,dahdi-codec,DAHDI codecs,mod_dahdi_codec,,))
727 $(eval $(call BuildPlugin,db,Database backend,mod_db,,))
728 $(eval $(call BuildPlugin,dialplan-asterisk,Asterisk dialplan parser,mod_dialplan_asterisk,,))
729 $(eval $(call BuildPlugin,dialplan-directory,Dialplan directory,mod_dialplan_directory,,))
730 $(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML interface,mod_dialplan_xml,,))
731 $(eval $(call BuildPlugin,dingaling,Jabber interface,mod_dingaling,,))
732 $(eval $(call BuildPlugin,directory,application mod_directory,mod_directory,,))
733 $(eval $(call BuildPlugin,distributor,application mod_distributor,mod_distributor,,))
734 $(eval $(call BuildPlugin,dptools,Dialplan tools,mod_dptools,,))
735 $(eval $(call BuildPlugin,easyroute,DID routing,mod_easyroute,,))
736 $(eval $(call BuildPlugin,enum,ENUM routing,mod_enum,,))
737 $(eval $(call BuildPlugin,erlang-event,Erlang event handler,mod_erlang_event,,+erlang))
738 $(eval $(call BuildPlugin,esf,Extra SIP Functionality,mod_esf,,))
739 $(eval $(call BuildPlugin,event-multicast,Multicast event handler,mod_event_multicast,,))
740 $(eval $(call BuildPlugin,event-socket,Socket event handler,mod_event_socket,,))
741 $(eval $(call BuildPlugin,event-zmq,Socket event handler by Zero MQ,mod_event_zmq,,))
742 $(eval $(call BuildPlugin,expr,Expression evaluation,mod_expr,,))
743 $(eval $(call BuildPlugin,fifo,FIFO,mod_fifo,,))
744 $(eval $(call BuildPlugin,file-string,File streaming,mod_file_string,,@OBSOLETE)) # merged into dptools
745 $(eval $(call BuildPlugin,flite,Festival TTS,mod_flite,,@(!(armeb||avr32)||BROKEN)))
746 $(eval $(call BuildPlugin,fsk,Bell-202 1200-baud FSK decoder,mod_fsk,,))
747 $(eval $(call BuildPlugin,fsv,Video,mod_fsv,,))
748 $(eval $(call BuildPlugin,g723-1,G.723.1 codec,mod_g723_1,,))
749 $(eval $(call BuildPlugin,g729,G.729 codec,mod_g729,,))
750 $(eval $(call BuildPlugin,gsmopen,Short Message Service (SMS),mod_gsmopen,spandsp,+alsa-lib @BROKEN)) # needs gsmlib
751 $(eval $(call BuildPlugin,h26x,H26X linear codec,mod_h26x,,))
752 $(eval $(call BuildPlugin,h323,h323 endpoint,mod_h323,,@BROKEN)) # missing header files (other packages needed)
753 $(eval $(call BuildPlugin,hash,API for manipulating a hash table,mod_hash,,))
754 $(eval $(call BuildPlugin,html5,HTML5 Endpoint Module,mod_html5,,))
755 $(eval $(call BuildPlugin,httapi,HT Telephony API and HTTP caching,mod_httapi,,))
756 $(eval $(call BuildPlugin,http-cache,HTTP GET with caching,mod_http_cache,,+libcurl))
757 $(eval $(call BuildPlugin,ilbc,ILBC codec,mod_ilbc,,))
758 $(eval $(call BuildPlugin,isac,isac Codec,mod_isac,,))
759 $(eval $(call BuildPlugin,java,Java language interface,mod_java,,@BROKEN)) # needs java
760 $(eval $(call BuildPlugin,json-cdr,JSon-CDR interface,mod_json_cdr,,+libcurl))
761 $(eval $(call BuildPlugin,lcr,Least Cost Routing,mod_lcr,,))
762 $(eval $(call BuildPlugin,local-stream,Local streaming,mod_local_stream,,))
763 $(eval $(call BuildPlugin,logfile,File logger,mod_logfile,,))
764 $(eval $(call BuildPlugin,loopback,Loopback endpoint,mod_loopback,,))
765 $(eval $(call BuildPlugin,lua,Lua language interface,mod_lua,,+libstdcpp))
766 $(eval $(call BuildPlugin,managed,language mod_managed,mod_managed,,+glib2 @BROKEN)) # needs Mono
767 $(eval $(call BuildPlugin,mp4,MP4 File Format support for video apps.,mod_mp4,,@BROKEN)) # needs libmp4v2
768 $(eval $(call BuildPlugin,mp4v,MP4 CoDec support for video apps.,mod_mp4v,,))
769 $(eval $(call BuildPlugin,native-file,Native files,mod_native_file,,))
770 $(eval $(call BuildPlugin,nibblebill,Billing,mod_nibblebill,,))
771 $(eval $(call BuildPlugin,oreka,Media Recording with Oreka,mod_oreka,,))
772 $(eval $(call BuildPlugin,openzap,Zaptel hardware interface,mod_openzap ozmod_analog ozmod_analog_em ozmod_isdn ozmod_skel ozmod_zt,,+libpcap +libopenzap))
773 $(eval $(call BuildPlugin,opus,Opus CoDec,mod_opus,,))
774 $(eval $(call BuildPlugin,portaudio,Local audio endpoint,mod_portaudio,,+alsa-lib))
775 $(eval $(call BuildPlugin,portaudio-stream,portaudio stream format,mod_portaudio_stream,,+alsa-lib))
776 $(eval $(call BuildPlugin,posix-timer,POSIX compliance soft timer,mod_posix_timer,,))
777 $(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,mod_radius_cdr,,+freeradius2 @BROKEN)) # fails in freeradius-client
778 $(eval $(call BuildPlugin,redis,redis,mod_redis,,))
779 $(eval $(call BuildPlugin,rss,RRS feeds via TTS,mod_rss,,))
780 $(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,mod_rtmp,,))
781 $(eval $(call BuildPlugin,say-de,German say,mod_say_de,,))
782 $(eval $(call BuildPlugin,say-en,English say,mod_say_en,,))
783 $(eval $(call BuildPlugin,say-es,Spanish say,mod_say_es,,))
784 $(eval $(call BuildPlugin,say-fa,Persian say,mod_say_fa,,))
785 $(eval $(call BuildPlugin,say-fr,French say,mod_say_fr,,))
786 $(eval $(call BuildPlugin,say-hu,Hungarian say,mod_say_hu,,))
787 $(eval $(call BuildPlugin,say-it,Italian say,mod_say_it,,))
788 $(eval $(call BuildPlugin,say-nl,Dutch say,mod_say_nl,,))
789 $(eval $(call BuildPlugin,say-pt,Portugeese say,mod_say_pt,,))
790 $(eval $(call BuildPlugin,say-ru,Russian say,mod_say_ru,,))
791 $(eval $(call BuildPlugin,say-th,Thai say,mod_say_th,,))
792 $(eval $(call BuildPlugin,say-zh,Chineese say,mod_say_zh,,))
793 $(eval $(call BuildPlugin,shell-stream,Shell stream,mod_shell_stream,,))
794 $(eval $(call BuildPlugin,silk,codec mod_silk,mod_silk,,))
795 $(eval $(call BuildPlugin,siren,G.722.1 codec,mod_siren,,))
796 $(eval $(call BuildPlugin,skel,Application Framework Demo Module,mod_skel,,))
797 $(eval $(call BuildPlugin,skinny,endpoint mod_skinny,mod_skinny,,))
798 $(eval $(call BuildPlugin,skypopen,Skype compatible endpoint,mod_skypopen,,@FEATURE_drawing-backend_libX11))
799 $(eval $(call BuildPlugin,sms,SMS application,mod_sms,,))
800 $(eval $(call BuildPlugin,snapshot,application mod_snapshot,mod_snapshot,,))
801 $(eval $(call BuildPlugin,sndfile,Multi-Format file transcoder,mod_sndfile,,))
802 $(eval $(call BuildPlugin,snipe-hunt,application mod_snipe_hunt,mod_snipe_hunt,,))
803 $(eval $(call BuildPlugin,snmp,Simple Network Management Protocol,mod_snmp,,+libnetsnmp))
804 $(eval $(call BuildPlugin,snom,SNOM specific features,mod_snom,,))
805 $(eval $(call BuildPlugin,sofia,SIP,mod_sofia,,))
806 $(eval $(call BuildPlugin,spandsp,Span DSP,mod_spandsp,,+libjpeg))
807 $(eval $(call BuildPlugin,speex,Speex codec,mod_speex,,))
808 $(eval $(call BuildPlugin,spidermonkey,JavaScript,mod_spidermonkey,,@BROKEN)) # fails in js
809 $(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,mod_spidermonkey_core_db,,@BROKEN))
810 $(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,mod_spidermonkey_curl,,@BROKEN))
811 $(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,mod_spidermonkey_odbc,,@BROKEN))
812 $(eval $(call BuildPlugin,spidermonkey-socket,JavaScript socket,mod_spidermonkey_socket,,@BROKEN))
813 $(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript teletone,mod_spidermonkey_teletone,,@BROKEN))
814 $(eval $(call BuildPlugin,spy,User spy,mod_spy,,))
815 $(eval $(call BuildPlugin,stress,application mod_stress,mod_stress,,))
816 $(eval $(call BuildPlugin,syslog,SysLog logger,mod_syslog,,))
817 $(eval $(call BuildPlugin,tone-stream,Tone generation stream,mod_tone_stream,,))
818 $(eval $(call BuildPlugin,tts-commandline,ASR TTS cli,mod_tts_commandline,,))
819 $(eval $(call BuildPlugin,unimrcp,MRCP interface,mod_unimrcp,,@BROKEN))
820 $(eval $(call BuildPlugin,valet-parking,application mod_valet_parking,mod_valet_parking,,))
821 $(eval $(call BuildPlugin,vmd,VoiceMail beep detection,mod_vmd,,))
822 $(eval $(call BuildPlugin,voicemail,VoiceMail,mod_voicemail,,))
823 $(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,mod_voicemail_ivr,,))
824 $(eval $(call BuildPlugin,xml-cdr,XML-CDR handler,mod_xml_cdr,,+libcurl))
825 $(eval $(call BuildPlugin,xml-curl,XML-Curl gateway,mod_xml_curl,,+libcurl))
826 $(eval $(call BuildPlugin,xml-rpc,XML-RPC interface,mod_xml_rpc,,))
827 $(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,mod_xml_scgi,,))
828 $(eval $(call BuildPlugin,yaml,YAML dialplans,mod_yaml,,))
829