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