de047f3a7d0c4efc04225140610e2642eee325eb
[feed/telephony.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_SOURCE_PROTO:=git
13 PKG_DISTNAME:=$(PKG_NAME)_$(PKG_SOURCE_PROTO)
14 PKG_VERSION:=1.5.6b
15
16
17 #
18 # The latest FS git hash in PKG_SOURCE_VERSION can be obtained from
19 # http://fisheye.freeswitch.org
20 #
21 PKG_SOURCE_URL:=git://git.$(PKG_NAME).org/$(PKG_NAME).git
22 FS_DEFAULT_HEAD:=8ea0bc73a9e162504b8e0564f585cbfb5b39acfc
23 FS_LATEST_HEAD:=$(if $(DUMP),$(FS_DEFAULT_HEAD),$(shell git ls-remote $(PKG_SOURCE_URL) HEAD | cut -f1))
24 PKG_SOURCE_VERSION:=$(if $(CONFIG_FS_WITH_PULL_CURRENT),$(FS_LATEST_HEAD),$(FS_DEFAULT_HEAD))
25 PKG_SOURCE_VERSION_SHORT:=$(shell echo $(PKG_SOURCE_VERSION)|cut -b -7)
26 PKG_RELEASE:=$(PKG_SOURCE_VERSION_SHORT)
27 PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)
28 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION_SHORT).tar.bz2
29 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
30
31
32 PKG_FIXUP:=libtool autoreconf
33 PKG_BUILD_PARALLEL:=1
34
35
36 FS_MOD_AVAILABLE:= \
37 abstraction \
38 alsa \
39 amr \
40 amrwb \
41 avmd \
42 blacklist \
43 bv \
44 callcenter \
45 cdr-csv \
46 cdr-pg-csv \
47 cdr-sqlite \
48 celt \
49 cepstral \
50 cidlookup \
51 cluechoo \
52 codec2 \
53 commands \
54 conference \
55 console \
56 curl \
57 dahdi-codec \
58 db \
59 dialplan-asterisk \
60 dialplan-directory \
61 dialplan-xml \
62 dingaling \
63 directory \
64 distributor \
65 dptools \
66 easyroute \
67 enum \
68 erlang-event \
69 esf \
70 event-multicast \
71 event-socket \
72 event-zmq \
73 expr \
74 fifo \
75 file-string \
76 flite \
77 format-cdr \
78 fsk \
79 fsv \
80 g723-1 \
81 g729 \
82 gsmopen \
83 h26x \
84 h323 \
85 hash \
86 html5 \
87 httapi \
88 http-cache \
89 ilbc \
90 isac \
91 java \
92 json-cdr \
93 lcr \
94 local-stream \
95 logfile \
96 loopback \
97 lua \
98 managed \
99 mp4 \
100 mp4v \
101 native-file \
102 nibblebill \
103 openzap \
104 opus \
105 oreka \
106 portaudio \
107 portaudio-stream \
108 posix-timer \
109 radius-cdr \
110 rayo \
111 redis \
112 rss \
113 rtmp \
114 sangoma-codec \
115 say-de \
116 say-en \
117 say-es \
118 say-fa \
119 say-fr \
120 say-hu \
121 say-it \
122 say-nl \
123 say-pt \
124 say-ru \
125 say-th \
126 say-zh \
127 shell-stream \
128 silk \
129 siren \
130 skel \
131 skinny \
132 skypopen \
133 sms \
134 snapshot \
135 snipe-hunt \
136 sndfile \
137 snmp \
138 snom \
139 sofia \
140 sonar \
141 spandsp \
142 speex \
143 spidermonkey \
144 spidermonkey-core-db \
145 spidermonkey-curl \
146 spidermonkey-odbc \
147 spidermonkey-socket \
148 spidermonkey-teletone \
149 spy \
150 ssml \
151 stress \
152 syslog \
153 timerfd \
154 tone-stream \
155 tts-commandline \
156 unimrcp \
157 valet-parking \
158 vmd \
159 voicemail \
160 voicemail-ivr \
161 vp8 \
162 xml-cdr \
163 xml-curl \
164 xml-rpc \
165 xml-scgi \
166 yaml \
167
168
169 PKG_CONFIG_DEPENDS:= \
170 CONFIG_FS_WITH_ALSA \
171 CONFIG_FS_WITH_BUILTIN_ZRTP \
172 CONFIG_FS_WITH_FIXED_POINT \
173 CONFIG_FS_WITH_IPV6 \
174 CONFIG_FS_WITH_LZMA \
175 CONFIG_FS_WITH_MYSQL \
176 CONFIG_FS_WITH_ODBC \
177 CONFIG_FS_WITH_OPENSSL \
178 CONFIG_FS_WITH_OPT \
179 CONFIG_FS_WITH_POSTGRESQL \
180 CONFIG_FS_WITH_PULL_CURRENT \
181 CONFIG_FS_WITH_SQLITE3 \
182 CONFIG_FS_WITH_SCTP \
183 $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \
184
185
186 include $(INCLUDE_DIR)/package.mk
187 include $(INCLUDE_DIR)/nls.mk
188
189
190 TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR)
191
192
193 define Package/$(PKG_NAME)/Default
194 SECTION:=net
195 CATEGORY:=Network
196 SUBMENU:=Telephony
197 URL:=http://www.$(PKG_NAME).org/
198 MAINTAINER:=Mazi Lo <openwrt.mazilo@recursor.net>
199 endef
200
201
202 define Package/$(PKG_NAME)
203 $(call Package/$(PKG_NAME)/Default)
204 TITLE:=FreeSWITCH open source telephony platform ($(PKG_SOURCE_VERSION_SHORT))
205 DEPENDS:=+FS_WITH_OPENSSL:libopenssl +libcurl +libiconv-full +libjpeg +libncurses +libpthread +librt +libstdcpp +FS_WITH_POSTGRESQL:libpq +libuuid
206 MENU:=1
207 endef
208
209
210 define Package/$(PKG_NAME)/description
211 FreeSWITCH is an open source telephony platform designed to
212 facilitate the creation of voice and chat driven products scaling
213 from a soft-phone up to a soft-switch. See http://wiki.$(PKG_NAME).org
214 endef
215
216
217 define Package/$(PKG_NAME)/config
218 config FS_WITH_PULL_CURRENT
219 depends on DEVEL
220 depends on PACKAGE_$(PKG_NAME)
221 bool "Pull the latest git HEAD - $(PKG_SOURCE_VERSION_SHORT) (Press < Help > for more information)"
222 default n
223 help
224 This existing git HEAD ($(FS_DEFAULT_HEAD))
225 is probably outdated. Enable this option for the latest git HEAD
226 ($(FS_LATEST_HEAD)) ONLY if you know what
227 you are doing. It may and/or may not be cleanly compiled and may
228 require some intervension to create new patches. If you take this
229 route and come up with some patches, please contemplate to contribute
230 or send in your patches.
231
232 config FS_WITH_ALSA
233 depends on PACKAGE_$(PKG_NAME)
234 bool "Enable ALSA for sound support"
235 default n
236 help
237 Compile $(PKG_NAME) with ALSA support.
238
239 config FS_WITH_BUILTIN_ZRTP
240 depends on PACKAGE_$(PKG_NAME)
241 bool "Enable built-in ZRTP"
242 default y
243 help
244 Compile $(PKG_NAME) with ZRTP support.
245
246 config FS_WITH_IPV6
247 depends on PACKAGE_$(PKG_NAME)
248 bool "Enable IPV6 support in APR"
249 default y
250 help
251 Compile libs/apr package with IPV6 support.
252
253 config FS_WITH_LZMA
254 depends on PACKAGE_$(PKG_NAME)
255 bool "Enable liblzma usage in libtiff"
256 default y
257 select PACKAGE_liblzma
258 help
259 Compile libs/tiff package with liblzma support. This option requires
260 LZMA2 compression package called liblzma.
261
262 config FS_WITH_OPENSSL
263 depends on PACKAGE_$(PKG_NAME)
264 bool "Enable SSL support"
265 default y
266 help
267 Compile $(PKG_NAME) with SSL support.
268
269 config FS_WITH_OPT
270 depends on PACKAGE_$(PKG_NAME)
271 bool "Enable optimization"
272 default y
273 help
274 Compile $(PKG_NAME) with optimization flag enabled. This will add
275 max optimising compiler flags
276
277 config FS_WITH_SCTP
278 depends on PACKAGE_$(PKG_NAME)
279 bool "Enable SCTP (Stream Control Transfer Protocol) support in APR"
280 default y
281 select PACKAGE_sctp
282 help
283 Compile $(PKG_NAME) with SCTP support in lib APR.
284
285 config FS_WITH_MYSQL
286 depends on PACKAGE_$(PKG_NAME)
287 bool "Compile apr-util with MySQL"
288 default n
289 select PACKAGE_libmysqlclient
290 help
291 Compile libs/apr-util with MySQL.
292
293 config FS_WITH_POSTGRESQL
294 depends on PACKAGE_$(PKG_NAME)
295 bool "Compile apr-util (also enable $(PKG_NAME) core) with PostgreSQL support"
296 default n
297 help
298 Compile both libs/apr-util and $(PKG_NAME) with PostgreSQL support.
299
300 config FS_WITH_SQLITE3
301 depends on PACKAGE_$(PKG_NAME)
302 bool "Compile apr-util with SQLITE3"
303 default y
304 select PACKAGE_libsqlite3
305 help
306 Compile libs/apr-util with SQLITE3.
307
308 config FS_WITH_ODBC
309 depends on PACKAGE_$(PKG_NAME)
310 depends on PACKAGE_sqliteodbc
311 depends on PACKAGE_unixodbc_svn
312 bool "Compile with ODBC support (Requires unixodbc_svn NOT YET AVAILABLE)"
313 default n
314 help
315 Compile $(PKG_NAME) with ODBC support. Since both sqliteodbc and unixodbc_svn packages
316 are not yet available on OpenWRT, $(PKG_NAME) CAN NOT be compiled with ODBC support.
317 endef
318
319
320 define Package/$(PKG_NAME)-mod-spandsp/config
321 config FS_WITH_FIXED_POINT
322 depends on PACKAGE_$(PKG_NAME)-mod-spandsp
323 bool "Enable fixed point support for spandsp (may degrade performance)"
324 default n
325 help
326 Compile spandsp package with a fixed point support. ONLY enabled this option when
327 necessary, i.e. CPU doesn't support floating computation.
328 endef
329
330
331 define Package/$(PKG_NAME)-example-config
332 $(call Package/$(PKG_NAME)/Default)
333 TITLE:=FreeSWITCH example config (commented)
334 DEPENDS:= $(PKG_NAME)
335 endef
336
337
338 define Package/$(PKG_NAME)-example-config/description
339 The default configuration included with FreeSWITCH. It is not intended to be
340 a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to
341 be an example of how FreeSWITCH can be configured.
342 endef
343
344
345 define Package/$(PKG_NAME)-config-upstream-defaults
346 $(call Package/$(PKG_NAME)/Default)
347 TITLE:=FreeSWITCH upstream config
348 DEPENDS:= $(PKG_NAME)
349 endef
350
351
352 define Package/$(PKG_NAME)-config-upstream-defaults/description
353 The default configuration included with FreeSWITCH. It is not intended to be
354 a final product, and but is included for those who don't want to use the
355 OpenWRT configuration and/or want to try things as prepared by upstream.
356 endef
357
358
359 define Package/$(PKG_NAME)-config-minimal
360 $(call Package/$(PKG_NAME)/Default)
361 TITLE:=FreeSWITCH minimal config
362 DEPENDS:= $(PKG_NAME)
363 endef
364
365
366 define Package/$(PKG_NAME)-config-minimal/description
367 A minimal configuration of FreeSWITCH for OpenWRT devices. Is what the UCI
368 configuration began with.
369 endef
370
371
372 define Package/$(PKG_NAME)-collection-upstream-defaults
373 $(call Package/$(PKG_NAME)/Default)
374 TITLE:=FS upstream def sample conf
375 DEPENDS:= $(PKG_NAME) \
376 +$(PKG_NAME)-config-upstream-defaults \
377 +$(PKG_NAME)-mod-callcenter \
378 +$(PKG_NAME)-mod-codec2 \
379 +$(PKG_NAME)-mod-commands \
380 +$(PKG_NAME)-mod-conference \
381 +$(PKG_NAME)-mod-curl \
382 +$(PKG_NAME)-mod-dialplan-xml \
383 +$(PKG_NAME)-mod-dingaling \
384 +$(PKG_NAME)-mod-dptools \
385 +$(PKG_NAME)-mod-event-socket \
386 +$(PKG_NAME)-mod-g723-1 \
387 +$(PKG_NAME)-mod-g729 \
388 +$(PKG_NAME)-mod-hash \
389 +$(PKG_NAME)-mod-http-cache \
390 +$(PKG_NAME)-mod-ilbc \
391 +$(PKG_NAME)-mod-local-stream \
392 +$(PKG_NAME)-mod-lua \
393 +$(PKG_NAME)-mod-native-file \
394 +$(PKG_NAME)-mod-sndfile \
395 +$(PKG_NAME)-mod-sofia \
396 +$(PKG_NAME)-mod-speex \
397 +$(PKG_NAME)-mod-syslog \
398 +$(PKG_NAME)-mod-tone-stream \
399 +$(PKG_NAME)-mod-xml-curl \
400 +$(PKG_NAME)-mod-xml-rpc \
401 +$(PKG_NAME)-tools
402 endef
403
404
405 define Package/$(PKG_NAME)-collection-minimal
406 $(call Package/$(PKG_NAME)/Default)
407 TITLE:=FreeSWITCH minimal package collection
408 DEFAULT:=y
409 DEPENDS:= $(PKG_NAME) \
410 +$(PKG_NAME)-config-minimal \
411 +$(PKG_NAME)-mod-codec2 \
412 +$(PKG_NAME)-mod-commands \
413 +$(PKG_NAME)-mod-dialplan-xml \
414 +$(PKG_NAME)-mod-dptools \
415 +$(PKG_NAME)-mod-event-socket \
416 +$(PKG_NAME)-mod-hash \
417 +$(PKG_NAME)-mod-local-stream \
418 +$(PKG_NAME)-mod-sndfile \
419 +$(PKG_NAME)-mod-sofia \
420 +$(PKG_NAME)-mod-syslog \
421 +$(PKG_NAME)-mod-tone-stream \
422 +$(PKG_NAME)-tools
423 endef
424
425
426 define Package/$(PKG_NAME)-sounds-en-08KHz
427 $(call Package/$(PKG_NAME)/Default)
428 TITLE:=FreeSWITCH 8KHz english sounds
429 DEPENDS:= $(PKG_NAME)
430 endef
431
432
433 define Package/$(PKG_NAME)-sounds-en-16KHz
434 $(call Package/$(PKG_NAME)/Default)
435 TITLE:=FreeSWITCH 16KHz english sounds
436 DEPENDS:= +$(PKG_NAME)-sounds-en-08KHz
437 endef
438
439
440 define Package/$(PKG_NAME)-sounds-en-32KHz
441 $(call Package/$(PKG_NAME)/Default)
442 TITLE:=FreeSWITCH 32KHz english sounds
443 DEPENDS:= +$(PKG_NAME)-sounds-en-16KHz
444 endef
445
446
447 define Package/$(PKG_NAME)-sounds-en-48KHz
448 $(call Package/$(PKG_NAME)/Default)
449 TITLE:=FreeSWITCH 48KHz english sounds
450 DEPENDS:= +$(PKG_NAME)-sounds-en-32KHz
451 endef
452
453
454 define Package/$(PKG_NAME)-sounds-moh-08KHz
455 $(call Package/$(PKG_NAME)/Default)
456 TITLE:=FreeSWITCH 8KHz music-on-hold sounds
457 DEPENDS:= $(PKG_NAME)
458 endef
459
460
461 define Package/$(PKG_NAME)-sounds-moh-16KHz
462 $(call Package/$(PKG_NAME)/Default)
463 TITLE:=FreeSWITCH 16KHz music-on-hold sounds
464 DEPENDS:= +$(PKG_NAME)-sounds-moh-08KHz
465 endef
466
467
468 define Package/$(PKG_NAME)-sounds-moh-32KHz
469 $(call Package/$(PKG_NAME)/Default)
470 TITLE:=FreeSWITCH 32KHz music-on-hold sounds
471 DEPENDS:= +$(PKG_NAME)-sounds-moh-16KHz
472 endef
473
474
475 define Package/$(PKG_NAME)-sounds-moh-48KHz
476 $(call Package/$(PKG_NAME)/Default)
477 TITLE:=FreeSWITCH 48KHz music-on-hold sounds
478 DEPENDS:= +$(PKG_NAME)-sounds-moh-32KHz
479 endef
480
481
482 define Package/$(PKG_NAME)-tools
483 $(call Package/$(PKG_NAME)/Default)
484 TITLE:=FreeSWITCH control tools
485 DEPENDS:= $(PKG_NAME)
486 endef
487
488
489 define Download/files
490 define Download/$(1)
491 FILE:=$(2)
492 URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5)
493 MD5SUM:=$(3)
494 endef
495 define Prepare/$(1)
496 $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6)
497 endef
498 $$(eval $$(call Download,$(1)))
499 endef
500
501
502 MAKE_INSTALL_TARGETS:=install
503
504
505 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),)
506 $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/))
507 endif
508
509
510 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),)
511 $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/))
512 endif
513
514
515 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
516 $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/))
517 endif
518
519
520 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),)
521 $(eval $(call Download/files,flite,flite-1.5.4-current.tar.bz2,f3a2d88b1059f6f4ff3c20a8169bc0f4,,downloads/libs/,libs/))
522 endif
523
524
525 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),)
526 $(eval $(call Download/files,opus,opus-1.0.2.tar.gz,c503ad05a59ddb44deab96204401be03,,downloads/libs/,libs/))
527 endif
528
529
530 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),)
531 $(eval $(call Download/files,sounds-en-08KHz,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.25.tar.gz,1140efad453ed1a72259d799f7fef0fc,,,))
532 MAKE_INSTALL_TARGETS+= sounds-install
533 endif
534
535
536 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),)
537 $(eval $(call Download/files,sounds-en-16KHz,$(PKG_NAME)-sounds-en-us-callie-16000-1.0.25.tar.gz,20b9bf1b1637be2abe838113fb675c41,,,))
538 MAKE_INSTALL_TARGETS+= hd-sounds-install
539 endif
540
541
542 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),)
543 $(eval $(call Download/files,sounds-en-32KHz,$(PKG_NAME)-sounds-en-us-callie-32000-1.0.25.tar.gz,977d453d8ffa9a5b0fadee8408e84f60,,,))
544 MAKE_INSTALL_TARGETS+= uhd-sounds-install
545 endif
546
547
548 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),)
549 $(eval $(call Download/files,sounds-en-48KHz,$(PKG_NAME)-sounds-en-us-callie-48000-1.0.25.tar.gz,96ec0df908eb1c535063fdc8580626d2,,,))
550 MAKE_INSTALL_TARGETS+= cd-sounds-install
551 endif
552
553
554 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),)
555 $(eval $(call Download/files,sounds-moh-08KHz,$(PKG_NAME)-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,,))
556 MAKE_INSTALL_TARGETS+= moh-install
557 endif
558
559
560 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),)
561 $(eval $(call Download/files,sounds-moh-16KHz,$(PKG_NAME)-sounds-music-16000-1.0.8.tar.gz,7fd0ca9a9e3878783baa39b8187743bf,,,))
562 MAKE_INSTALL_TARGETS+= hd-moh-install
563 endif
564
565
566 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),)
567 $(eval $(call Download/files,sounds-moh-32KHz,$(PKG_NAME)-sounds-music-32000-1.0.8.tar.gz,7e03932ea81b8d0bf6d686f838b060b4,,,))
568 MAKE_INSTALL_TARGETS+= uhd-moh-install
569 endif
570
571
572 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),)
573 $(eval $(call Download/files,sounds-moh-48KHz,$(PKG_NAME)-sounds-music-48000-1.0.8.tar.gz,d06cd2a80379f224affab21f5180e4c6,,,))
574 MAKE_INSTALL_TARGETS+= cd-moh-install
575 endif
576
577
578 #
579 # XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues
580 #
581 ifneq ($(CONFIG_avr32),)
582 TARGET_CFLAGS += -fgnu89-inline
583 TARGET_CXXFLAGS += -fgnu89-inline
584 endif
585
586
587 ifneq ($(CONFIG_USE_EGLIBC),)
588 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
589 TARGET_CFLAGS += -DNO_GETLOGIN
590 endif
591 endif
592
593
594 FS_TARGET_CFLAGS:= $(TARGET_CFLAGS) -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format
595 FS_TARGET_CXXFLAGS:= $(TARGET_CXXFLAGS) -DLUA_USE_LINUX $(FPIC) -Wno-format
596 FS_TARGET_CPPFLAGS:= -I. -I./lua $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),-I$(STAGING_DIR_HOST)/lib/erlang/lib/erl_interface-3.7.7/include) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) $(TARGET_CPPFLAGS)
597
598
599 CONFIGURE_ARGS+= \
600 --host=$(GNU_TARGET_NAME) \
601 --build=$(GNU_HOST_NAME) \
602 --prefix="/usr/share/$(PKG_NAME)" \
603 --bindir="/usr/bin" \
604 --libdir="/usr/lib" \
605 --srcdir="$(PKG_BUILD_DIR)" \
606 --sysconfdir="/etc/$(PKG_NAME)" \
607 --with-modinstdir="/usr/lib/$(PKG_NAME)" \
608 --with-random="/dev/urandom" \
609 $(if $(CONFIG_FS_WITH_MYSQL),--with,--without)-mysql \
610 $(if $(CONFIG_FS_WITH_POSTGRESQL),--with,--without)-pgsql-support \
611 $(if $(CONFIG_FS_WITH_SQLITE3),--with,--without)-sqlite3 \
612 $(call autoconf_bool,CONFIG_FS_WITH_IPV6,ipv6) \
613 $(if $(CONFIG_FS_WITH_OPENSSL),--with,--without)-openssl \
614 $(call autoconf_bool,CONFIG_FS_WITH_OPT,optimization) \
615 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-ogg) \
616 $(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) \
617 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),--with,--without)-erlang \
618 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \
619 $(call autoconf_bool,CONFIG_FS_WITH_LZMA,lzma) \
620 $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-support) \
621 $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp && CONFIG_FS_WITH_FIXED_POINT,fixed-point) \
622 $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \
623 $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-timerfd,timerfd-wrapper) \
624 $(call autoconf_bool,CONFIG_FS_WITH_BUILTIN_ZRTP,zrtp) \
625 $(call autoconf_bool,CONFIG_FS_WITH_ODBC,core-odbc-support) \
626 $(if $(CONFIG_FS_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
627 $(if $(CONFIG_FS_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \
628
629
630 CONFIGURE_VARS+= \
631 config_TARGET_CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
632 config_TARGET_CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
633 config_TARGET_CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
634 config_TARGET_CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
635 config_TARGET_CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
636 config_TARGET_READLINE_INC="$(FS_TARGET_CPPFLAGS)" \
637 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
638 config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread -ldl" \
639 config_BUILD_CC="$(HOSTCC)" \
640 config_BUILD_CFLAGS="$(HOST_CFLAGS)" \
641 CC_FOR_BUILD="$(HOSTCC)" \
642 BUILDTOOL_CC="$(HOSTCC)" \
643 BUILDTOOL_CCLD="$(HOSTCC)" \
644 LDFLAGS="$$$$LDFLAGS" \
645 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
646 CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
647 CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
648 AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
649 RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
650 CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
651 CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
652 CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
653 LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib\"" \
654 HOST_CC="/usr/bin/cc" \
655 HOST_CXX="/usr/bin/g++" \
656 CROSS_COMPILE="1" \
657 ax_cv_c_compiler_vendor="gnu" \
658 ac_cv_cflags_warn_all_ansi='-Wall -std=c99 -Wno-unused-variable' \
659 ac_cv_dev_urandom="yes" \
660 ac_cv_file_dbd_apr_dbd_mysql_c="no" \
661 ac_cv_file__dev_random="no" \
662 ac_cv_file__dev_urandom="yes" \
663 ac_cv_file___dev_urandom_="yes" \
664 ac_cv_func_mmap_fixed_mapped="yes" \
665 ac_cv_func_pthread_rwlock_init="yes" \
666 ac_cv_struct_rlimit="yes" \
667 apr_cv_mutex_recursive="yes" \
668 apr_cv_process_shared_works="no" \
669 apr_cv_tcp_nodelay_with_cork="yes" \
670 apr_cv_type_rwlock_t="yes" \
671 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),ac_cv_path_PERL="yes",) \
672 libzmq_cv_cxx_werror_flag="" \
673
674
675 define Build/Prepare
676 $(call Build/Prepare/Default)
677 $(call Prepare/celt)
678 $(call Prepare/event-zmq)
679 $(call Prepare/flite)
680 $(call Prepare/json-cdr)
681 $(call Prepare/opus)
682 $(call Prepare/sounds-en-08KHz)
683 $(call Prepare/sounds-en-16KHz)
684 $(call Prepare/sounds-en-32KHz)
685 $(call Prepare/sounds-en-48KHz)
686 $(call Prepare/sounds-moh-08KHz)
687 $(call Prepare/sounds-moh-16KHz)
688 $(call Prepare/sounds-moh-32KHz)
689 $(call Prepare/sounds-moh-48KHz)
690 endef
691
692
693 define Build/Configure
694 if [ -d $(PKG_BUILD_DIR)/libs/libcodec2/src ]; then \
695 (cd $(PKG_BUILD_DIR)/libs/libcodec2/src; $(HOSTCC) -c generate_codebook.c; $(HOSTCC) -o generate_codebook generate_codebook.o -lm) \
696 fi
697 (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh)
698 $(call Build/Configure/Default,)
699 $(foreach m,$(FS_MOD_AVAILABLE),
700 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
701 $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
702 ,
703 $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
704 )
705 )
706 endef
707
708
709 define Build/Compile
710 $(MAKE) -C $(PKG_BUILD_DIR) \
711 AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
712 RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
713 CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
714 CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
715 DESTDIR="$(PKG_INSTALL_DIR)" \
716 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
717 all $(MAKE_INSTALL_TARGETS)
718 $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1<!-- \2"mod_console"\3 -->|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
719 $(SED) 's|^\([ \t]*\)<!-- *\(.*\)"mod_syslog"\(.*\) *-->\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
720 endef
721
722
723 define Build/InstallDev
724 $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
725 $(INSTALL_DIR) $(1)/usr/lib
726 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/include/* $(1)/usr/include/$(PKG_NAME)/
727 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/
728 endef
729
730
731 define Package/$(PKG_NAME)/install
732 $(INSTALL_DIR) $(1)/etc/config
733 $(INSTALL_DIR) $(1)/etc/default
734 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
735 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/scripts
736 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
737 $(INSTALL_DIR) $(1)/etc/init.d
738 $(INSTALL_DIR) $(1)/usr/bin
739 $(INSTALL_DIR) $(1)/usr/lib
740 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
741 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
742 $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
743 $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
744 $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME)
745 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
746 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME)* $(1)/usr/lib/
747 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc $(1)/usr/lib/pkgconfig/
748 $(if $(1)/usr/lib/lib$(PKG_NAME).la,sed -i -e "s#-lcurl -lz\(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#-L/usr/lib -lcurl -lz /usr/lib/libexpat.la\2/usr\3#g" $(1)/usr/lib/lib$(PKG_NAME).la)
749 endef
750
751
752 define Package/$(PKG_NAME)-collection-upstream-defaults/install
753 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
754 endef
755
756
757 define Package/$(PKG_NAME)-example-config/install
758 $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf
759 $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/
760 endef
761
762
763 define Package/$(PKG_NAME)-config-upstream-defaults/install
764 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
765 $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME) $(1)/etc
766 endef
767
768
769 define Package/$(PKG_NAME)-collection-minimal/install
770 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
771 endef
772
773
774 define Package/$(PKG_NAME)-collection-uci-minimal/install
775 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
776 endef
777
778
779 define Package/$(PKG_NAME)-config-minimal/install
780 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/autoload_configs
781
782 #
783 # Copying dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml
784 # fur_elise.ttml mime.types tetris.ttml tones.conf vars.xml
785 #
786 $(foreach f,dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml fur_elise.ttml mime.types tetris.ttml vars.xml,$(if $(PKG_BUILD_DIR)/conf/vanilla/$(f),$(CP) $(PKG_BUILD_DIR)/conf/vanilla/$(f) $(1)/etc/$(PKG_NAME);))
787
788 #
789 # Copying acl ivr modules post_load_modules switch timezones
790 #
791 $(foreach f,acl ivr modules post_load_modules switch timezones,$(if $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml,$(CP) $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml $(1)/etc/$(PKG_NAME)/autoload_configs;))
792 endef
793
794
795 define Package/$(PKG_NAME)-sounds-en-08KHz/install
796 #
797 # sounds-en-8KHz
798 #
799 for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
800 do \
801 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
802 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
803 done
804 endef
805
806
807 define Package/$(PKG_NAME)-sounds-en-16KHz/install
808 #
809 # sounds-en-16KHz
810 #
811 for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
812 do \
813 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
814 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
815 done
816 endef
817
818
819 define Package/$(PKG_NAME)-sounds-en-32KHz/install
820 #
821 # sounds-en-32KHz
822 #
823 for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
824 do \
825 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
826 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
827 done
828 endef
829
830
831 define Package/$(PKG_NAME)-sounds-en-48KHz/install
832 #
833 # sounds-en-48KHz
834 #
835 for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
836 do \
837 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
838 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
839 done
840 endef
841
842
843 define Package/$(PKG_NAME)-sounds-moh-08KHz/install
844 #
845 # sounds-moh-8KHz
846 #
847 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/8000;
848 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/8000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
849 endef
850
851
852 define Package/$(PKG_NAME)-sounds-moh-16KHz/install
853 #
854 # sounds-moh-16KHz
855 #
856 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/16000;
857 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/16000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
858 endef
859
860
861 define Package/$(PKG_NAME)-sounds-moh-32KHz/install
862 #
863 # sounds-moh-32KHz
864 #
865 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/32000;
866 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/32000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
867 endef
868
869
870 define Package/$(PKG_NAME)-sounds-moh-48KHz/install
871 #
872 # sounds-moh-48KHz
873 #
874 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/48000;
875 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/48000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
876 endef
877
878
879 define Package/$(PKG_NAME)-tools/install
880 $(INSTALL_DIR) $(1)/usr/bin
881 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
882 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/
883 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/
884 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/
885 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/
886 $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/
887 endef
888
889
890 # 1. Name
891 # 2. Title
892 # 3. Selection on module configuration file
893 # 4. Files (module files include different names)
894 # 5. Files (supporting files include different names)
895 # 6. Inter module depends
896 # 7. Extra depends
897 #
898 define BuildPlugin
899 define Package/$(PKG_NAME)-mod-$(1)
900 $$(call Package/$(PKG_NAME)/Default)
901 TITLE:= FS $(2) module
902 DEPENDS:= $(PKG_NAME) $(foreach m,$(6),+$(PKG_NAME)-mod-$(m)) $(7)
903 endef
904
905 define Package/$(PKG_NAME)-mod-$(1)/install
906 [ -z "mod_$(subst -,_,$(1))" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME)
907
908 for f in $$$$(realpath $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/mod_$(subst -,_,$(1)).*)) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$(4)_*); \
909 do \
910 $(CP) $$$$$$$${f} $$(1)/usr/lib/$(PKG_NAME)/; \
911 done
912
913 #
914 # mod_$(subst -,_,$(1)): $(5)
915 #
916 $(foreach f,$(5),[ -d $(dir $$(1)/usr/${f}) ] || $(INSTALL_DIR) $(dir $$(1)/usr/${f});$(CP) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/${f}*) $(dir $$(1)/usr/${f});)
917
918 #
919 # mod_$(subst -,_,$(1)): Clean installed library control files from referencig to OpenWRT PATH.
920 #
921 for f in `ls $$(1)/usr/lib/$(PKG_NAME)/*.la`; \
922 do \
923 sed -i -e "s#' \(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib /usr/lib/lib$(PKG_NAME).la /usr/lib/libexpat.la\2/usr\3#g;s#' \(.*\)/usr/lib/libintl-full/lib#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib#g;s#-L\.\.##g;s#$(PKG_BUILD_DIR)\(.*\)/usr/lib/libtiff.la\(.*\)#/usr/lib/libtiff.la\2#g" $$$$$$$${f}; \
924 done
925
926 #
927 # 1. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)))
928 #
929 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
930
931 #
932 # 2. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)))
933 #
934 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
935
936 #
937 # 3. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)))
938 #
939 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
940
941 #
942 # 4. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)))
943 #
944 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
945
946 #
947 # 5. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)))
948 #
949 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
950
951 #
952 # 6. Additional configuration files for mod_$(subst -,_,$(1)) from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))))
953 #
954 $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))),[ -d $$(1)/etc/$(PKG_NAME)/$(1) ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/$(1);$(CP) $(PKG_BUILD_DIR)/conf/$(3)/$(1) $$(1)/etc/$(PKG_NAME))
955 endef
956
957 define Package/$(PKG_NAME)-mod-$(1)/postinst
958 #!/bin/sh
959 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
960 endef
961
962 define Package/$(PKG_NAME)-mod-$(1)/prerm
963 #!/bin/sh
964 sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1<!-- \2"mod_$(subst -,_,$(1))"\3 -->|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
965 endef
966
967 $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
968 endef
969
970
971 $(eval $(call BuildPackage,$(PKG_NAME)))
972 $(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults))
973 $(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal))
974 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-08KHz))
975 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-16KHz))
976 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-32KHz))
977 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-48KHz))
978 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-08KHz))
979 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-16KHz))
980 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-32KHz))
981 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-48KHz))
982 $(eval $(call BuildPackage,$(PKG_NAME)-tools))
983 $(eval $(call BuildPackage,$(PKG_NAME)-example-config))
984 $(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults))
985 $(eval $(call BuildPackage,$(PKG_NAME)-config-minimal))
986
987
988 #
989 # $(eval $(call BuildPlugin,Name,Title,Selection on module Conf File,Files,Inter Depends,Extra Depends))
990 #
991 $(eval $(call BuildPlugin,abstraction,An Abstraction To API Call,vanilla,,,,))
992 $(eval $(call BuildPlugin,alsa,Alsa Endpoint,vanilla,,,,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA))
993 $(eval $(call BuildPlugin,amr,Adaptive Multi-Rate On Bandwidth Codec,vanilla,,,,))
994 $(eval $(call BuildPlugin,amrwb,Wide Band AMR,vanilla,,,,))
995 $(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,vanilla,,,,))
996 $(eval $(call BuildPlugin,blacklist,Blacklist,vanilla,,,,))
997 $(eval $(call BuildPlugin,bv,BroadVoice 16/32-bit Audio Codec,vanilla,,,,))
998 $(eval $(call BuildPlugin,callcenter,Call Center,vanilla,,,,))
999 $(eval $(call BuildPlugin,cdr-csv,CSV-CDR Handler,mod,,,,)) # ~/conf
1000 $(eval $(call BuildPlugin,cdr-pg-csv,PostgreSQL CDR Handler,vanilla,,,,+coreutils +FS_WITH_POSTGRESQL:libpq @FS_WITH_POSTGRESQL))
1001 $(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR Handler,vanilla,,,,@FS_WITH_SQLITE3))
1002 $(eval $(call BuildPlugin,celt,CELT Ultra-Low Delay Codec,vanilla,,,,+libogg))
1003 $(eval $(call BuildPlugin,cepstral,Cepstral Interface,vanilla,,,,@BROKEN)) # needs <swift.h>
1004 $(eval $(call BuildPlugin,cidlookup,Data Query For CID->NAME Services,mod,,,,+libcurl)) # ~/conf
1005 $(eval $(call BuildPlugin,cluechoo,Framework Demo,vanilla,,,,))
1006 $(eval $(call BuildPlugin,codec2,CoDec 2,,,,,))
1007 $(eval $(call BuildPlugin,commands,API Commands,vanilla,,,,))
1008 $(eval $(call BuildPlugin,conference,Conference Room,vanilla,,,,))
1009 $(eval $(call BuildPlugin,console,Console Logger,vanilla,,,,))
1010 $(eval $(call BuildPlugin,curl,HTTP Request,vanilla,,,,+libcurl))
1011 $(eval $(call BuildPlugin,dahdi-codec,DAHDI Codecs,vanilla,,,,))
1012 $(eval $(call BuildPlugin,db,Database Backend,vanilla,,,,))
1013 $(eval $(call BuildPlugin,dialplan-asterisk,Asterisk Dialplan Parser,vanilla,,,,))
1014 $(eval $(call BuildPlugin,dialplan-directory,Dialplan Directory,vanilla,,,,))
1015 $(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML Interface,vanilla,,,,))
1016 $(eval $(call BuildPlugin,dingaling,Jabber Interface,vanilla,,,,+libopenssl))
1017 $(eval $(call BuildPlugin,directory,Search By Name Directory IVR,vanilla,,,,))
1018 $(eval $(call BuildPlugin,distributor,Simple Robin-Round Load,vanilla,,,,))
1019 $(eval $(call BuildPlugin,dptools,Dialplan Tools,vanilla,,,,))
1020 $(eval $(call BuildPlugin,easyroute,Simple DID Routing,vanilla,,,,))
1021 $(eval $(call BuildPlugin,enum,ENUM Routing,,,,,))
1022 $(eval $(call BuildPlugin,erlang-event,Erlang Event Handler,vanilla,,,,+erlang @BROKEN))
1023 $(eval $(call BuildPlugin,esf,Extra SIP Functionality,vanilla,,,,))
1024 $(eval $(call BuildPlugin,event-multicast,Multicast Event Handler,vanilla,,,,))
1025 $(eval $(call BuildPlugin,event-socket,Socket Event Handler,vanilla,,,,))
1026 $(eval $(call BuildPlugin,event-zmq,Socket Event Handler By Zero MQ,vanilla,,,,+libuuid))
1027 $(eval $(call BuildPlugin,expr,Expression Evaluation,vanilla,,,,))
1028 $(eval $(call BuildPlugin,fifo,FIFO,vanilla,,,,))
1029 $(eval $(call BuildPlugin,file-string,Streaming Multiple Sound Files Sequentially,vanilla,,,,@OBSOLETE)) # merged into dptools
1030 $(eval $(call BuildPlugin,flite,Festival TTS,vanilla,,,,@(!(armeb||avr32)||BROKEN)))
1031 $(eval $(call BuildPlugin,format-cdr,XML CDR Module to files or curl,vanilla,,,,))
1032 $(eval $(call BuildPlugin,fsk,Bell-202 1200-Baud FSK Decoder,vanilla,,,,))
1033 $(eval $(call BuildPlugin,fsv,Video Player / Recorder,vanilla,,,,))
1034 $(eval $(call BuildPlugin,g723-1,G.723.1 Codec,vanilla,,,,))
1035 $(eval $(call BuildPlugin,g729,G.729 Codec,vanilla,,,,))
1036 $(eval $(call BuildPlugin,gsmopen,GSM Modem compatible Endpoint,mod,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA @BROKEN)) # needs gsmlib
1037 $(eval $(call BuildPlugin,h26x,H26X Linear Codec,vanilla,,,,))
1038 $(eval $(call BuildPlugin,h323,H323 Endpoint,mod,,,,@BROKEN)) # Req. H323Plus v1.24.x or newer
1039 $(eval $(call BuildPlugin,hash,API For Manipulating A Hash Table,vanilla,,,,))
1040 #$(eval $(call BuildPlugin,html5,HTML5 Endpoint Module,vanilla,,,,)) # defunct?
1041 $(eval $(call BuildPlugin,httapi,HT Telephony API and HTTP Caching,mod,,,,)) # ~/conf
1042 $(eval $(call BuildPlugin,http-cache,HTTP GET With Caching,mod,,,,+libcurl)) # ~/conf
1043 $(eval $(call BuildPlugin,ilbc,ILBC Codec,vanilla,,,,))
1044 $(eval $(call BuildPlugin,isac,iSAC Codec,vanilla,,,,))
1045 $(eval $(call BuildPlugin,java,Java Language Interface,vanilla,,,,@BROKEN)) # needs java
1046 $(eval $(call BuildPlugin,json-cdr,JSon-CDR Interface,mod,,,,+libcurl))
1047 $(eval $(call BuildPlugin,lcr,Least Cost Routing,vanilla,,,,))
1048 $(eval $(call BuildPlugin,local-stream,Multi-Channel On Same Stream,vanilla,,,,))
1049 $(eval $(call BuildPlugin,logfile,File Logger,vanilla,,,,))
1050 $(eval $(call BuildPlugin,loopback,Loopback to Dialplan Endpoint,vanilla,,,,))
1051 $(eval $(call BuildPlugin,lua,LUA Language Interface,vanilla,,,,))
1052 $(eval $(call BuildPlugin,managed,Media Switching Software Library,vanilla,,,,+glib2 @BROKEN)) # needs Mono
1053 $(eval $(call BuildPlugin,mp4,MP4 File Format Support For Video,vanilla,,,,@BROKEN)) # needs libmp4v2
1054 $(eval $(call BuildPlugin,mp4v,MP4 CoDec Support For Video,vanilla,,,,))
1055 $(eval $(call BuildPlugin,native-file,WAV Format Sound Player,vanilla,,,,))
1056 $(eval $(call BuildPlugin,nibblebill,Credit / Debit Billing,vanilla,,,,))
1057 $(eval $(call BuildPlugin,openzap,Zaptel (Superseded by FreeTDM),libs,ozmod,lib/libopenzap lib/pkgconfig/openzap,,+libpcap))
1058 $(eval $(call BuildPlugin,opus,Opus CoDec,vanilla,,,,))
1059 $(eval $(call BuildPlugin,oreka,Media Recording with Oreka,vanilla,,,,))
1060 $(eval $(call BuildPlugin,portaudio,Portaudio To Sound Card Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA))
1061 $(eval $(call BuildPlugin,portaudio-stream,Portaudio Streaming Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA))
1062 $(eval $(call BuildPlugin,posix-timer,POSIX Compliant Soft Timer,vanilla,,,,))
1063 $(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,vanilla,,,,@BROKEN)) # fails in freeradius-client
1064 $(eval $(call BuildPlugin,rayo,Rayo server & node implementation,vanilla,,,,))
1065 $(eval $(call BuildPlugin,redis,Redis Limited Backend,vanilla,,,,))
1066 $(eval $(call BuildPlugin,rss,RRS Feeds via TTS,vanilla,,,,))
1067 $(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,vanilla,,,,))
1068 $(eval $(call BuildPlugin,sangoma-codec,Sangoma Codec,vanilla,,,,@BROKEN)) # Req. Sangoma CoDec source
1069 $(eval $(call BuildPlugin,say-de,German Say,vanilla,,,,))
1070 $(eval $(call BuildPlugin,say-en,English Say,vanilla,,,,))
1071 $(eval $(call BuildPlugin,say-es,Spanish Say,vanilla,,,,))
1072 $(eval $(call BuildPlugin,say-fa,Persian Say,vanilla,,,,))
1073 $(eval $(call BuildPlugin,say-fr,French Say,vanilla,,,,))
1074 $(eval $(call BuildPlugin,say-hu,Hungarian Say,vanilla,,,,))
1075 $(eval $(call BuildPlugin,say-it,Italian Say,vanilla,,,,))
1076 $(eval $(call BuildPlugin,say-nl,Dutch Say,vanilla,,,,))
1077 $(eval $(call BuildPlugin,say-pt,Portugeese Say,vanilla,,,,))
1078 $(eval $(call BuildPlugin,say-ru,Russian Say,vanilla,,,,))
1079 $(eval $(call BuildPlugin,say-th,Thai Say,vanilla,,,,))
1080 $(eval $(call BuildPlugin,say-zh,Chineese Say,vanilla,,,,))
1081 $(eval $(call BuildPlugin,shell-stream,Streaming Audio Through CLI,vanilla,,,,))
1082 $(eval $(call BuildPlugin,silk,Skype(TM) SILK Codec Module,vanilla,,,,))
1083 $(eval $(call BuildPlugin,siren,G.722.1 Codec,vanilla,,,,))
1084 $(eval $(call BuildPlugin,skel,Template For New Module,vanilla,,,,))
1085 $(eval $(call BuildPlugin,skinny,Skinny Call Control Protocol (SCCP),vanilla,,,,))
1086 $(eval $(call BuildPlugin,skypopen,Skype Compatible Endpoint,mod,,,,@FEATURE_drawing-backend_libX11))
1087 $(eval $(call BuildPlugin,sms,SMS,vanilla,,,,))
1088 $(eval $(call BuildPlugin,snapshot,Record Audio Snapshot to File,vanilla,,,,))
1089 $(eval $(call BuildPlugin,sndfile,Multi-Format Sound File,vanilla,,,,))
1090 $(eval $(call BuildPlugin,snipe-hunt,Snipe Hunt (Simple Example Module),vanilla,,,,))
1091 $(eval $(call BuildPlugin,snmp,SNMP AgentX Subagent,vanilla,,,,+libnetsnmp))
1092 $(eval $(call BuildPlugin,snom,SNOM specific features,vanilla,,,,))
1093 $(eval $(call BuildPlugin,sofia,SOFIA SIP,mod,,,,)) # ~/conf
1094 $(eval $(call BuildPlugin,sonar,Sonar Ping Timer,vanilla,,,,))
1095 $(eval $(call BuildPlugin,spandsp,Span DSP,mod,,,,+libjpeg +FS_WITH_LZMA:liblzma @FS_WITH_LZMA)) # ~/conf
1096 $(eval $(call BuildPlugin,speex,Speex codec,mod,,,,))
1097 $(eval $(call BuildPlugin,spidermonkey,JavaScript,vanilla,,,,@BROKEN)) # fails in js
1098 $(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,vanilla,,,,@BROKEN))
1099 $(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,vanilla,,,,@BROKEN))
1100 $(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,vanilla,,,,@BROKEN))
1101 $(eval $(call BuildPlugin,spidermonkey-socket,JavaScript Socket,vanilla,,,,@BROKEN))
1102 $(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript Teletone,vanilla,,,,@BROKEN))
1103 $(eval $(call BuildPlugin,spy,User Spy,vanilla,,,,))
1104 $(eval $(call BuildPlugin,ssml,SSML audio rendering format,mod,,,rayo,))
1105 $(eval $(call BuildPlugin,stress,Voice Stress Detection,vanilla,,,,))
1106 $(eval $(call BuildPlugin,syslog,SysLog logger,vanilla,,,,))
1107 $(eval $(call BuildPlugin,timerfd,Linux Kernel timerfd API,vanilla,,,,))
1108 $(eval $(call BuildPlugin,tone-stream,Tone Generation Stream,vanilla,,,,))
1109 $(eval $(call BuildPlugin,tts-commandline,ASR TTS Command Interface,vanilla,,,,))
1110 $(eval $(call BuildPlugin,unimrcp,UniMRCP (MRCP Client),vanilla,,,,@BROKEN))
1111 $(eval $(call BuildPlugin,valet-parking,Valet Parking Application,vanilla,,,,))
1112 $(eval $(call BuildPlugin,vmd,VoiceMail Beep Detection,vanilla,,,,))
1113 $(eval $(call BuildPlugin,voicemail,VoiceMail,vanilla,,,,))
1114 $(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,vanilla,,,,))
1115 $(eval $(call BuildPlugin,vp8,VP8 Video Codec,vanilla,,,,))
1116 $(eval $(call BuildPlugin,xml-cdr,XML-CDR Handler,vanilla,,,,+libcurl))
1117 $(eval $(call BuildPlugin,xml-curl,XML-Curl Gateway,vanilla,,,,+libcurl))
1118 $(eval $(call BuildPlugin,xml-rpc,XML-RPC Interface,vanilla,,,,))
1119 $(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,vanilla,,,,))
1120 $(eval $(call BuildPlugin,yaml,YAML langunage,vanilla,,,,))