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