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