59c9d25f56179d56c1670da957c48c313fee3f95
[packages.git] / net / asterisk-1.4.x / Makefile
1 #
2 # Copyright (C) 2007-2009 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:=asterisk
11 PKG_VERSION:=1.4.24.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=2b74744350f420b3a94d5323c489426f
17
18 PKG_BUILD_DEPENDS:= libopenh323 pwlib
19
20 include $(INCLUDE_DIR)/package.mk
21
22 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar, \
23         CONFIG_PACKAGE_asterisk14 CONFIG_PACKAGE_asterisk14-mini \
24         CONFIG_PACKAGE_asterisk14-chan-alsa CONFIG_PACKAGE_asterisk14-chan-gtalk \
25         CONFIG_PACKAGE_asterisk14-chan-h323 CONFIG_PACKAGE_asterisk14-chan-mgcp \
26         CONFIG_PACKAGE_asterisk14-chan-skinny CONFIG_PACKAGE_asterisk14-codec-ilbc \
27         CONFIG_PACKAGE_asterisk14-codec-lpc10 CONFIG_PACKAGE_asterisk14-codec-speex \
28         CONFIG_PACKAGE_asterisk14-pbx-dundi CONFIG_PACKAGE_asterisk14-res-agi \
29         CONFIG_PACKAGE_asterisk14-res-crypto CONFIG_PACKAGE_asterisk14-pgsql \
30         CONFIG_PACKAGE_asterisk14-sqlite CONFIG_PACKAGE_asterisk14-voicemail \
31         CONFIG_PACKAGE_asterisk14-sounds \
32 )
33
34 define Package/asterisk14/Default
35   SUBMENU:=asterisk14 (Complete Open Source PBX), v1.4.x
36   SECTION:=net
37   CATEGORY:=Network
38   URL:=http://www.asterisk.org/
39 endef
40
41 define Package/asterisk14/Default/description
42  Asterisk is a complete PBX in software. It provides all of the features
43  you would expect from a PBX and more. Asterisk does voice over IP in three
44  protocols, and can interoperate with almost all standards-based telephony
45  equipment using relatively inexpensive hardware.
46 endef
47
48
49 define Package/asterisk14
50 $(call Package/asterisk14/Default)
51   TITLE:=Complete open source PBX
52   DEPENDS:= +libncurses +libpopt +libpthread @!TARGET_avr32
53 endef
54
55 define Package/asterisk14/description
56 $(call Package/asterisk14/Default/description)
57 endef
58
59
60 define Package/asterisk14-mini
61 $(call Package/asterisk14/Default)
62   TITLE:=Minimal open source PBX
63   DEPENDS:=+libncurses +libpthread @!TARGET_avr32
64 endef
65
66 define Package/asterisk14-mini/description
67 $(call Package/asterisk14/Default/description)
68  This package contains only the following modules:
69  - app_dial
70  - chan_iax2
71  - chan_local
72  - chan_sip
73  - codec_gsm
74  - codec_ulaw
75  - format_gsm
76  - format_pcm
77  - format_wav
78  - format_wav_gsm
79  - pbx_config
80  - res_features
81  - res_musiconhold
82 endef
83
84
85 define Package/asterisk14-app-meetme
86 $(call Package/asterisk14/Default)
87   TITLE:=conferencing support
88   DEPENDS:= +asterisk14 +zaptel14-libtonezone
89 endef
90
91 define Package/asterisk14-app-meetme/description
92 $(call Package/asterisk14/Default/description)
93  This package provides the MeetMe application driver Conferencing support to 
94  Asterisk.
95 endef
96
97
98 define Package/asterisk14-chan-oss
99 $(call Package/asterisk14/Default)
100   TITLE:=OSS soundcards support
101   DEPENDS:= +asterisk14
102 endef
103
104 define Package/asterisk14-chan-oss/description
105 $(call Package/asterisk14/Default/description)
106  This package provides the channel driver for OSS sound cards support to 
107  Asterisk.
108 endef
109
110
111 define Package/asterisk14-app-meetme
112 $(call Package/asterisk14/Default)
113   TITLE:=conferencing support
114   DEPENDS:= +asterisk14 +zaptel14-libtonezone
115 endef
116
117 define Package/asterisk14-app-meetme/description
118 $(call Package/asterisk14/Default/description)
119  This package provides the MeetMe application driver Conferencing support to 
120  Asterisk.
121 endef
122
123
124 define Package/asterisk14-chan-oss
125 $(call Package/asterisk14/Default)
126   TITLE:=OSS soundcards support
127   DEPENDS:= +asterisk14
128 endef
129
130 define Package/asterisk14-chan-oss/description
131 $(call Package/asterisk14/Default/description)
132  This package provides the channel driver for OSS sound cards support to 
133  Asterisk.
134 endef
135
136
137 define Package/asterisk14-chan-alsa
138 $(call Package/asterisk14/Default)
139   TITLE:=ALSA soundcards support
140   DEPENDS:= +asterisk14 +alsa-lib
141 endef
142
143 define Package/asterisk14-chan-alsa/description
144 $(call Package/asterisk14/Default/description)
145  This package provides the channel driver for ALSA sound cards support to 
146  Asterisk.
147 endef
148
149
150 define Package/asterisk14-chan-gtalk
151 $(call Package/asterisk14/Default)
152   TITLE:=GTalk support
153   DEPENDS:= +asterisk14 +libiksemel
154 endef
155
156 define Package/asterisk14-chan-gtalk/description
157 $(call Package/asterisk14/Default/description)
158  This package provides the channel chan_gtalk and res_jabber for GTalk 
159  support to Asterisk.
160 endef
161
162
163 define Package/asterisk14-chan-h323
164 $(call Package/asterisk14/Default)
165   TITLE:=H.323 support for Asterisk
166   DEPENDS:= +asterisk14 +uclibcxx
167 endef
168
169 define Package/asterisk14-chan-h323/description
170 $(call Package/asterisk14/Default/description)
171  This package provides H.323 support to Asterisk.
172 endef
173
174
175 define Package/asterisk14-chan-mgcp
176 $(call Package/asterisk14/Default)
177   TITLE:=MGCP support
178   DEPENDS:= +asterisk14
179 endef
180
181 define Package/asterisk14-chan-mgcp/description
182 $(call Package/asterisk14/Default/description)
183  This package provides MGCP (Media Gateway Control Protocol) support \\\
184  to Asterisk.
185 endef
186
187
188 define Package/asterisk14-chan-skinny
189 $(call Package/asterisk14/Default)
190   TITLE:=Skinny Client Control Protocol support
191   DEPENDS:= +asterisk14
192 endef
193
194 define Package/asterisk14-chan-skinny/description
195 $(call Package/asterisk14/Default/description)
196  This package provided Skinny Client Control Protocol support to \\\
197  Asterisk.
198 endef
199
200
201 #define Package/asterisk14-codec-ilbc
202 #$(call Package/asterisk14/Default)
203 #  TITLE:=ILBC Translator
204 #  DEPENDS:= +asterisk14
205 #endef
206
207 #define Package/asterisk14-codec-ilbc/description
208 #$(call Package/asterisk14/Default/description)
209 # This package contains the ILBC (Internet Low Bitrate Codec) translator 
210 # for Asterisk.
211 #endef
212
213
214 define Package/asterisk14-codec-lpc10
215 $(call Package/asterisk14/Default)
216   TITLE:=LPC10 2.4kbps voice codec Translator
217   DEPENDS:= +asterisk14
218 endef
219
220 define Package/asterisk14-chan-lpc10/description
221 $(call Package/asterisk14/Default/description)
222  This package contains the LPC10 (Linear Predictor Code) 2.4kbps voice 
223  codec translator for Asterisk.
224 endef
225
226
227 define Package/asterisk14-codec-speex
228 $(call Package/asterisk14/Default)
229   TITLE:=Speex/PCM16 Codec Translator
230   DEPENDS:= +asterisk14 +libspeex +libspeexdsp
231 endef
232
233 define Package/asterisk14-chan-speex/description
234 $(call Package/asterisk14/Default/description)
235  This package contains the Speex speech compression codec translator for 
236  Asterisk.
237 endef
238
239
240 define Package/asterisk14-pbx-dundi
241 $(call Package/asterisk14/Default)
242   TITLE:=DUNDi support
243   DEPENDS:= +asterisk14
244 endef
245
246 define Package/asterisk14-pbx-dundi/description
247 $(call Package/asterisk14/Default/description)
248  This package provides DUNDi (Distributed Universal Number Discovery) 
249  support to Asterisk.
250 endef
251
252
253 define Package/asterisk14-res-agi
254 $(call Package/asterisk14/Default)
255   TITLE:=AGI support
256   DEPENDS:= +asterisk14
257 endef
258
259 define Package/asterisk14-res-agi/description
260 $(call Package/asterisk14/Default/description)
261  This package provides AGI (Asterisk Gateway Interface) support to 
262  Asterisk.
263 endef
264
265
266 define Package/asterisk14-res-crypto
267 $(call Package/asterisk14/Default)
268   TITLE:=Cryptographic Digital Signatures support
269   DEPENDS:= +asterisk14 +libopenssl
270 endef
271
272 define Package/asterisk14-res-crypto/description
273 $(call Package/asterisk14/Default/description)
274  This package provides Cryptographic Digital Signatures support to 
275  Asterisk.
276 endef
277
278
279 define Package/asterisk14-pgsql
280 $(call Package/asterisk14/Default)
281   TITLE:=PostgreSQL support
282   DEPENDS:= +asterisk14 +libpq
283 endef
284
285 define Package/asterisk14-pgsql/description
286 $(call Package/asterisk14/Default/description)
287  This package contains PostgreSQL support modules for Asterisk.
288 endef
289
290
291 define Package/asterisk14-sqlite
292 $(call Package/asterisk14/Default)
293   TITLE:=SQLite modules
294   DEPENDS:= +asterisk14 +libsqlite2
295 endef
296
297 define Package/asterisk14-sqlite/description
298 $(call Package/asterisk14/Default/description)
299  This package contains SQLite support modules for Asterisk.
300 endef
301
302
303 define Package/asterisk14-sounds
304 $(call Package/asterisk14/Default)
305   TITLE:=Sound files
306   DEPENDS:= +asterisk14
307 endef
308
309 define Package/asterisk14-sounds/description
310 $(call Package/asterisk14/Default/description)
311  This package contains sound files for Asterisk.
312 endef
313
314
315 define Package/asterisk14-voicemail
316 $(call Package/asterisk14/Default)
317   TITLE:=Voicemail support
318   DEPENDS:= +asterisk14
319 endef
320
321 define Package/asterisk14-voicemail/description
322 $(call Package/asterisk14/Default/description)
323  This package contains voicemail related modules for Asterisk.
324 endef
325
326 define Package/asterisk14-rawplayer
327 $(call Package/asterisk14/Default)
328   TITLE:=Play raw files for asterisk
329 endef
330
331 define Package/asterisk14-rawplayer/description
332  Contains the rawplayer utility for asterisk
333 endef
334
335
336 #       --with-ltdl="$(STAGING_DIR)/usr" \
337 CONFIGURE_ARGS+= \
338         --without-curl \
339         --without-curses \
340         --with-gsm="internal" \
341         --without-imap \
342         --without-isdnnet \
343         --without-kde \
344         --without-misdn \
345         --without-nbs \
346         --with-ncurses="$(STAGING_DIR)/usr" \
347         --without-netsnmp \
348         --without-newt \
349         --without-odbc \
350         --without-ogg \
351         --without-osptk \
352         --with-popt="$(STAGING_DIR)/usr" \
353         --without-pri \
354         --without-qt \
355         --without-radius \
356         --without-spandsp \
357         --without-suppserv \
358         --without-tds \
359         --without-termcap \
360         --without-tinfo \
361         --without-vorbis \
362         --without-vpb \
363         --with-z="$(STAGING_DIR)/usr" \
364
365 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
366 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
367
368 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-app-meetme),)
369   CONFIGURE_ARGS+= \
370         --with-tonezone="$(STAGING_DIR)/usr" --with-zaptel="$(STAGING_DIR)/usr"
371 else
372   CONFIGURE_ARGS+= \
373         --without-tonezone --without-zaptel
374 endif
375
376 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-chan-alsa),)
377   CONFIGURE_ARGS+= \
378         --with-asound="$(STAGING_DIR)/usr"
379 else
380   CONFIGURE_ARGS+= \
381         --without-asound
382 endif
383
384 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-chan-oss),)
385   CONFIGURE_ARGS+= \
386         --with-oss
387 else
388   CONFIGURE_ARGS+= \
389         --without-oss
390 endif
391
392 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-chan-gtalk),)
393   CONFIGURE_ARGS+= \
394         --with-gnutls="$(STAGING_DIR)/usr" \
395         --with-iksemel="$(STAGING_DIR)/usr"
396   SITE_VARS+= \
397         ac_cv_lib_iksemel_iks_start_sasl=yes \
398         ac_cv_lib_gnutls_gnutls_bye=yes
399 else
400   CONFIGURE_ARGS+= \
401         --without-gnutls \
402         --without-iksemel
403 endif
404
405 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-chan-h323),)
406   CONFIGURE_ARGS+= \
407         --with-h323="$(BUILD_DIR)/openh323" \
408         --with-pwlib="$(BUILD_DIR)/pwlib"
409   CONFIGURE_VARS+= \
410         LIBS="$$$$LIBS -luClibc++ -ldl -lpthread"
411
412   define Build/Compile/chan-h323
413         $(MAKE) -C "$(PKG_BUILD_DIR)/channels/h323" \
414                 $(TARGET_CONFIGURE_OPTS) \
415                 CXXLIBS="-nodefaultlibs -luClibc++" \
416                 optnoshared
417   endef
418 else
419   CONFIGURE_ARGS+= \
420         --without-h323 \
421         --without-pwlib
422 endif
423
424 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-codec-speex),)
425   CONFIGURE_ARGS+= \
426         --with-speex="$(STAGING_DIR)/usr"
427   SITE_VARS+= \
428         ac_cv_lib_speex_speex_encode=yes
429   EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/speex
430 else
431   CONFIGURE_ARGS+= \
432         --without-speex
433 endif
434
435 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-res-crypto),)
436   CONFIGURE_ARGS+= \
437         --with-ssl="$(STAGING_DIR)/usr"
438 else
439   CONFIGURE_ARGS+= \
440         --without-ssl
441 endif
442
443 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-pgsql),)
444   CONFIGURE_ARGS+= \
445         --with-postgres="$(STAGING_DIR)/usr"
446 else
447   CONFIGURE_ARGS+= \
448         --without-postgres
449 endif
450
451 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-sqlite),)
452   CONFIGURE_ARGS+= \
453         --with-sqlite="$(STAGING_DIR)/usr"
454 else
455   CONFIGURE_ARGS+= \
456         --without-sqlite
457 endif
458
459
460 define Build/Configure
461         -rm $(PKG_BUILD_DIR)/menuselect.makeopts
462         ( cd $(PKG_BUILD_DIR); ./bootstrap.sh )
463         $(call Build/Configure/Default,,$(SITE_VARS))
464 endef
465
466 define Build/Compile
467         $(MAKE) -C "$(PKG_BUILD_DIR)" \
468                 include/asterisk/version.h \
469                 include/asterisk/buildopts.h defaults.h \
470                 makeopts.embed_rules
471         $(call Build/Compile/chan-h323)
472         ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
473         ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
474         $(MAKE) -C "$(PKG_BUILD_DIR)" \
475                 ASTVARLIBDIR="/usr/lib/asterisk" \
476                 NOISY_BUILD="1" \
477                 DEBUG="" \
478                 OPTIMIZE="" \
479                 DESTDIR="$(PKG_INSTALL_DIR)" \
480                 all install samples
481         $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
482
483         $(TARGET_CC) -O2 $(PKG_BUILD_DIR)/contrib/utils/rawplayer.c -o $(PKG_BUILD_DIR)/rawplayer
484 endef
485
486 define Build/InstallDev
487         mkdir -p $(1)/usr/include/asterisk/
488         $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
489         $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
490 endef
491
492
493 define Package/asterisk14/conffiles
494 /etc/asterisk/agents.conf
495 /etc/asterisk/alarmreceiver.conf
496 /etc/asterisk/amd.conf
497 /etc/asterisk/asterisk.conf
498 /etc/asterisk/cdr.conf
499 /etc/asterisk/cdr_custom.conf
500 /etc/asterisk/cdr_manager.conf
501 /etc/asterisk/codecs.conf
502 /etc/asterisk/dnsmgr.conf
503 /etc/asterisk/enum.conf
504 /etc/asterisk/extconfig.conf
505 /etc/asterisk/extensions.ael
506 /etc/asterisk/extensions.conf
507 /etc/asterisk/features.conf
508 /etc/asterisk/followme.conf
509 /etc/asterisk/http.conf
510 /etc/asterisk/iax.conf
511 /etc/asterisk/iaxprov.conf
512 /etc/asterisk/indications.conf
513 /etc/asterisk/logger.conf
514 /etc/asterisk/manager.conf
515 /etc/asterisk/misdn.conf
516 /etc/asterisk/modules.conf
517 /etc/asterisk/musiconhold.conf
518 /etc/asterisk/muted.conf
519 /etc/asterisk/osp.conf
520 /etc/asterisk/privacy.conf
521 /etc/asterisk/queues.conf
522 /etc/asterisk/rtp.conf
523 /etc/asterisk/say.conf
524 /etc/asterisk/sip.conf
525 /etc/asterisk/sip_notify.conf
526 /etc/asterisk/sla.conf
527 /etc/asterisk/smdi.conf
528 /etc/asterisk/udptl.conf
529 /etc/asterisk/users.conf
530 endef
531
532 #define Package/asterisk14/postinst
533 ##!/bin/sh
534 #ROOT=`echo $${PKG_ROOT} | sed 's:[\/]:\\\&:g' -`
535 #/bin/sed -i 's/\ \/etc/\ '$${ROOT}'etc/g' $${PKG_ROOT}/etc/asterisk/asterisk.conf
536 #/bin/sed -i 's/\ \/var/\ '$${ROOT}'var/g' $${PKG_ROOT}/etc/asterisk/asterisk.conf
537 #/bin/sed -i 's/\ \/usr/\ '$${ROOT}'usr/g' $${PKG_ROOT}/etc/asterisk/asterisk.conf
538 #/bin/sed -i 's/^DEST=/DEST='$${ROOT}'/g' $${PKG_ROOT}/etc/init.d/asterisk
539 #/bin/sed -i 's/OPTIONS=\"\"/OPTIONS=\"-C\ '$${ROOT}'etc\/asterisk\/asterisk.conf\"/g' $${PKG_ROOT}/etc/default/asterisk
540 #endef
541
542 define Package/asterisk14/install
543         $(CP) $(PKG_INSTALL_DIR)/* $(1)
544         rm -rf $(1)/usr/sbin/astgenkey
545         rm -rf $(1)/usr/sbin/aelparse
546         rm -rf $(1)/usr/sbin/autosupport
547         rm -rf $(1)/usr/sbin/muted
548         rm -rf $(1)/usr/sbin/stereorize
549         rm -rf $(1)/usr/bin
550         rm -rf $(1)/usr/man
551         rm -rf $(1)/usr/include
552         rm -rf $(1)/var/spool/asterisk/meetme
553         rm -rf $(1)/var/spool/asterisk/voicemail
554         (cd $(1)/usr/lib/asterisk; \
555                 rm -rf agi-bin; \
556                 rm -rf images; \
557                 rm -rf keys/*; \
558                 rm -rf moh/*.wav; \
559                 rm -rf sounds/*; \
560                 cd modules; \
561                 rm -rf  *adsi* *festival* *modem* *oss* *phone* *intercom* \
562                         *mp3* *nbscat* *sqlite* *mysql* *postgres* *pgsql* \
563                         *voicemail* *speex* *flash* *page* *meetme* *zap* *jpeg* \
564                         *snmp* \
565                         chan_alsa.so \
566                         chan_oss.so \
567                         chan_gtalk.so \
568                         chan_h323.so \
569                         chan_mgcp.so \
570                         chan_skinny.so \
571                         {codec,format}_ilbc.so \
572                         codec_lpc10.so \
573                         pbx_dundi.so \
574                         res_agi.so \
575                         res_crypto.so \
576                         res_jabber.so \
577         )
578         (cd $(1)/etc/asterisk; \
579                 rm -f   *odbc* *mysql* *postgres* *pgsql* *voicemail* \
580                         *adsi* *oss* *alsa* *festival* *modem* *phone* \
581                         *tds* *vofr* *rpt* *vpb* *snmp* \
582                         *zapata* \
583                         alsa.conf \
584                         dundi.conf \
585                         gtalk.conf \
586                         h323.conf \
587                         jabber.conf \
588                         mgcp.conf \
589                         skinny.conf \
590         )
591         $(INSTALL_DATA) ./files/modules.conf $(1)/etc/asterisk/
592         $(INSTALL_DIR) $(1)/etc/default
593         $(INSTALL_DATA)  ./files/asterisk.default $(1)/etc/default/asterisk
594         $(INSTALL_DIR) $(1)/etc/init.d
595         $(INSTALL_BIN)  ./files/asterisk.init $(1)/etc/init.d/asterisk
596 endef
597
598
599 define Package/asterisk14-mini/conffiles
600 /etc/asterisk/asterisk.conf
601 /etc/asterisk/enum.conf
602 /etc/asterisk/extconfig.conf
603 /etc/asterisk/extensions.conf
604 /etc/asterisk/features.conf
605 /etc/asterisk/http.conf
606 /etc/asterisk/iax.conf
607 /etc/asterisk/iaxprov.conf
608 /etc/asterisk/logger.conf
609 /etc/asterisk/manager.conf
610 /etc/asterisk/modules.conf
611 /etc/asterisk/musiconhold.conf
612 /etc/asterisk/rtp.conf
613 /etc/asterisk/sip.conf
614 /etc/asterisk/sip_notify.conf
615 /etc/asterisk/users.conf
616 endef
617
618 define Package/asterisk14-mini/install
619         $(INSTALL_DIR) $(1)/etc/asterisk
620         for f in asterisk enum extconfig extensions features http \
621                 iax iaxprov logger manager modules musiconhold rtp \
622                 sip sip_notify users; do \
623           $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
624         done
625         $(INSTALL_DATA) ./files/modules.conf $(1)/etc/asterisk/
626         $(INSTALL_DIR) $(1)/usr/lib/asterisk
627         $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/firmware $(1)/usr/lib/asterisk/
628         $(INSTALL_DIR) $(1)/usr/lib/asterisk/keys
629         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
630         for f in app_dial chan_iax2 chan_local chan_sip codec_gsm \
631                 codec_ulaw format_gsm format_pcm format_wav format_wav_gsm \
632                 pbx_config res_features res_musiconhold; do \
633           $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
634         done
635         $(INSTALL_DIR) $(1)/usr/lib/asterisk/moh
636         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds
637         $(INSTALL_DIR) $(1)/usr/sbin
638         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
639         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/safe_asterisk $(1)/usr/sbin/
640         $(INSTALL_DIR) $(1)/etc/default
641         $(INSTALL_DATA)  ./files/asterisk.default $(1)/etc/default/asterisk
642         $(INSTALL_DIR) $(1)/etc/init.d
643         $(INSTALL_BIN)  ./files/asterisk.init $(1)/etc/init.d/asterisk
644 endef
645
646
647 define Package/asterisk14-app-meetme/conffiles
648 /etc/asterisk/meetme.conf
649 endef
650
651 define Package/asterisk14-app-meetme/install
652         $(INSTALL_DIR) $(1)/etc/asterisk
653         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
654         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
655         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
656 endef
657
658
659 define Package/asterisk14-chan-oss/conffiles
660 /etc/asterisk/oss.conf
661 endef
662
663 define Package/asterisk14-chan-oss/install
664         $(INSTALL_DIR) $(1)/etc/asterisk
665         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/oss.conf $(1)/etc/asterisk/
666         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
667         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_oss.so $(1)/usr/lib/asterisk/modules/
668 endef
669
670
671 define Package/asterisk14-app-meetme/conffiles
672 /etc/asterisk/meetme.conf
673 endef
674
675 define Package/asterisk14-app-meetme/install
676         $(INSTALL_DIR) $(1)/etc/asterisk
677         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
678         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
679         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
680 endef
681
682
683 define Package/asterisk14-chan-oss/conffiles
684 /etc/asterisk/oss.conf
685 endef
686
687 define Package/asterisk14-chan-oss/install
688         $(INSTALL_DIR) $(1)/etc/asterisk
689         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/oss.conf $(1)/etc/asterisk/
690         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
691         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_oss.so $(1)/usr/lib/asterisk/modules/
692 endef
693
694
695 define Package/asterisk14-chan-alsa/conffiles
696 /etc/asterisk/alsa.conf
697 endef
698
699 define Package/asterisk14-chan-alsa/install
700         $(INSTALL_DIR) $(1)/etc/asterisk
701         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/alsa.conf $(1)/etc/asterisk/
702         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
703         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_alsa.so $(1)/usr/lib/asterisk/modules/
704 endef
705
706
707 define Package/asterisk14-chan-gtalk/conffiles
708 /etc/asterisk/gtalk.conf
709 /etc/asterisk/jabber.conf
710 endef
711
712 define Package/asterisk14-chan-gtalk/install
713         $(INSTALL_DIR) $(1)/etc/asterisk
714         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
715         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
716         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
717         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
718         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
719 endef
720
721
722 define Package/asterisk14-chan-h323/conffiles
723 /etc/asterisk/h323.conf
724 endef
725
726 define Package/asterisk14-chan-h323/install
727         $(INSTALL_DIR) $(1)/etc/asterisk
728         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/h323.conf $(1)/etc/asterisk/
729         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
730         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_h323.so $(1)/usr/lib/asterisk/modules/
731 endef
732
733
734 define Package/asterisk14-chan-mgcp/install
735 /etc/asterisk/mgcp.conf
736 endef
737
738 define Package/asterisk14-chan-mgcp/install
739         $(INSTALL_DIR) $(1)/etc/asterisk
740         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mgcp.conf $(1)/etc/asterisk/
741         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
742         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mgcp.so $(1)/usr/lib/asterisk/modules/
743 endef
744
745
746 define Package/asterisk14-chan-skinny/conffiles
747 /etc/asterisk/skinny.conf
748 endef
749
750 define Package/asterisk14-chan-skinny/install
751         $(INSTALL_DIR) $(1)/etc/asterisk
752         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/skinny.conf $(1)/etc/asterisk/
753         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
754         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_skinny.so $(1)/usr/lib/asterisk/modules/
755 endef
756
757
758 #define Package/asterisk14-codec-ilbc/install
759 #       $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
760 #       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_ilbc.so $(1)/usr/lib/asterisk/modules/
761 #       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_ilbc.so $(1)/usr/lib/asterisk/modules/
762 #endef
763
764
765 define Package/asterisk14-codec-lpc10/install
766         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
767         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_lpc10.so $(1)/usr/lib/asterisk/modules/
768 endef
769
770
771 define Package/asterisk14-codec-speex/install
772         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
773         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_speex.so $(1)/usr/lib/asterisk/modules/
774 endef
775
776
777 define Package/asterisk14-pbx-dundi/conffiles
778 /etc/asterisk/dundi.conf
779 endef
780
781 define Package/asterisk14-pbx-dundi/install
782         $(INSTALL_DIR) $(1)/etc/asterisk
783         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/dundi.conf $(1)/etc/asterisk/
784         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
785         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/pbx_dundi.so $(1)/usr/lib/asterisk/modules/
786 endef
787
788
789 define Package/asterisk14-res-agi/install
790         $(INSTALL_DIR) $(1)/usr/lib/asterisk/agi-bin
791         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
792         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_agi.so $(1)/usr/lib/asterisk/modules/
793 endef
794
795
796 define Package/asterisk14-res-crypto/install
797         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
798         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_crypto.so $(1)/usr/lib/asterisk/modules/
799 endef
800
801
802 define Package/asterisk14-pgsql/conffiles
803 /etc/asterisk/cdr_pgsql.conf
804 /etc/asterisk/res_pgsql.conf
805 endef
806
807 define Package/asterisk14-pgsql/install
808         $(INSTALL_DIR) $(1)/etc/asterisk
809         install -m0600 $(PKG_INSTALL_DIR)/etc/asterisk/cdr_pgsql.conf $(1)/etc/asterisk/
810         install -m0600 $(PKG_INSTALL_DIR)/etc/asterisk/res_pgsql.conf $(1)/etc/asterisk/
811         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
812         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_pgsql.so $(1)/usr/lib/asterisk/modules/
813         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_pgsql.so $(1)/usr/lib/asterisk/modules/
814 endef
815
816
817 define Package/asterisk14-sqlite/install
818         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
819         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_sqlite.so $(1)/usr/lib/asterisk/modules/
820 endef
821
822
823 define Package/asterisk14-sounds/install
824         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds
825         $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/* $(1)/usr/lib/asterisk/sounds/
826         rm -f $(1)/usr/lib/asterisk/sounds/vm-*
827         rm -f $(1)/usr/lib/asterisk/sounds/x
828 endef
829
830
831 define Package/asterisk14-voicemail/conffiles
832 /etc/asterisk/voicemail.conf
833 endef
834
835 define Package/asterisk14-voicemail/install
836         $(INSTALL_DIR) $(1)/etc/asterisk
837         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
838         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
839         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
840         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
841         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds
842         $(CP) $(PKG_INSTALL_DIR)//usr/lib/asterisk/sounds/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
843 endef
844
845 define Package/asterisk14-rawplayer/install
846         $(INSTALL_DIR) $(1)/usr/bin
847         $(INSTALL_BIN)  $(PKG_BUILD_DIR)/rawplayer \
848                         $(1)/usr/bin
849 endef
850
851
852 $(eval $(call BuildPackage,asterisk14))
853 $(eval $(call BuildPackage,asterisk14-mini))
854 $(eval $(call BuildPackage,asterisk14-app-meetme))
855 $(eval $(call BuildPackage,asterisk14-chan-oss))
856 $(eval $(call BuildPackage,asterisk14-chan-alsa))
857 $(eval $(call BuildPackage,asterisk14-chan-gtalk))
858 $(eval $(call BuildPackage,asterisk14-chan-h323))
859 $(eval $(call BuildPackage,asterisk14-chan-mgcp))
860 $(eval $(call BuildPackage,asterisk14-chan-skinny))
861 #$(eval $(call BuildPackage,asterisk14-codec-ilbc))
862 $(eval $(call BuildPackage,asterisk14-codec-lpc10))
863 $(eval $(call BuildPackage,asterisk14-codec-speex))
864 $(eval $(call BuildPackage,asterisk14-pbx-dundi))
865 $(eval $(call BuildPackage,asterisk14-res-agi))
866 $(eval $(call BuildPackage,asterisk14-res-crypto))
867 $(eval $(call BuildPackage,asterisk14-pgsql))
868 $(eval $(call BuildPackage,asterisk14-sqlite))
869 $(eval $(call BuildPackage,asterisk14-voicemail))
870 $(eval $(call BuildPackage,asterisk14-sounds))
871 $(eval $(call BuildPackage,asterisk14-rawplayer))