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