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