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