2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://ftp.digium.com
/pub
/asterisk
/old-releases
/ ftp
://ftp.digium.com
/pub
/asterisk
/old-releases
/
17 PKG_MD5SUM
:=04657086791e80f319c0d728af705001
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
25 include $(INCLUDE_DIR
)/package.mk
27 define Package
/asterisk
/Default
31 Asterisk is a complete PBX in software. It provides
all of the features
\\\
32 you would expect from a PBX and more. Asterisk does voice over IP in three
\\\
33 protocols
, and can interoperate with almost
all standards-based telephony
\\\
34 equipment using relatively inexpensive hardware.
35 URL
:=http
://www.asterisk.org
/
38 define Package
/asterisk
39 $(call Package
/asterisk
/Default
)
40 DEPENDS
:=+libncurses
+libpthread
41 TITLE
:=Complete open source PBX
45 define Package
/asterisk
/conffiles
46 /etc
/asterisk
/asterisk.conf
47 /etc
/asterisk
/agents.conf
48 /etc
/asterisk
/alarmreceiver.conf
49 /etc
/asterisk
/cdr_manager.conf
50 /etc
/asterisk
/codecs.conf
51 /etc
/asterisk
/enum.conf
52 /etc
/asterisk
/extconfig.conf
53 /etc
/asterisk
/extensions.conf
54 /etc
/asterisk
/features.conf
55 /etc
/asterisk
/iax.conf
56 /etc
/asterisk
/iaxprov.conf
57 /etc
/asterisk
/indications.conf
58 /etc
/asterisk
/logger.conf
59 /etc
/asterisk
/manager.conf
60 /etc
/asterisk
/modules.conf
61 /etc
/asterisk
/musiconhold.conf
62 /etc
/asterisk
/osp.conf
63 /etc
/asterisk
/privacy.conf
64 /etc
/asterisk
/queues.conf
65 /etc
/asterisk
/rtp.conf
66 /etc
/asterisk
/sip.conf
69 define Package
/asterisk-mini
70 $(call Package
/asterisk
/Default
)
72 TITLE
:=Minimal open source PBX
75 This package contains only the following modules
: \\\
90 define Package
/asterisk-mini
/conffiles
91 /etc
/asterisk
/asterisk.conf
92 /etc
/asterisk
/enum.conf
93 /etc
/asterisk
/extconfig.conf
94 /etc
/asterisk
/extensions.conf
95 /etc
/asterisk
/features.conf
96 /etc
/asterisk
/iax.conf
97 /etc
/asterisk
/iaxprov.conf
98 /etc
/asterisk
/logger.conf
99 /etc
/asterisk
/manager.conf
100 /etc
/asterisk
/modules.conf
101 /etc
/asterisk
/musiconhold.conf
102 /etc
/asterisk
/rtp.conf
103 /etc
/asterisk
/sip.conf
106 define Package
/asterisk-chan-bluetooth
107 $(call Package
/asterisk
/Default
)
108 DEPENDS
:=asterisk
+bluez-libs
109 TITLE
:=Bluetooth HandsFreeProfile support for Asterisk
112 This package provides Bluetooth HandsFreeProfile support to Asterisk.
115 define Package
/asterisk-chan-bluetooth
/conffiles
116 /etc
/asterisk
/bluetooth.conf
119 define Package
/asterisk-chan-h323
120 $(call Package
/asterisk
/Default
)
121 DEPENDS
:=asterisk
+libopenh323
122 TITLE
:=H
.323 support for Asterisk
125 This package provides H
.323 support to Asterisk.
128 define Package
/asterisk-chan-h323
/conffiles
129 /etc
/asterisk
/h323.conf
132 define Package
/asterisk-chan-mgcp
133 $(call Package
/asterisk
/Default
)
138 This package provides MGCP
(Media Gateway Control Protocol
) support
\\\
142 define Package
/asterisk-chan-mgcp
/conffiles
143 /etc
/asterisk
/mgcp.conf
146 define Package
/asterisk-chan-skinny
147 $(call Package
/asterisk
/Default
)
149 TITLE
:=Skinny Client Control Protocol support
152 This package provided Skinny Client Control Protocol support to
\\\
156 define Package
/asterisk-chan-skinny
/conffiles
157 /etc
/asterisk
/skinny.conf
160 define Package
/asterisk-codec-ilbc
161 $(call Package
/asterisk
/Default
)
163 TITLE
:=ILBC Translator
166 This package contains the ILBC
(Internet Low Bitrate Codec
) translator
\\\
170 define Package
/asterisk-codec-lpc10
171 $(call Package
/asterisk
/Default
)
173 TITLE
:=LPC10
2.4kbps voice codec Translator
176 This package contains the LPC10
(Linear Predictor Code
) 2.4kbps voice
\\\
177 codec translator for Asterisk.
180 define Package
/asterisk-codec-speex
181 $(call Package
/asterisk
/Default
)
182 DEPENDS
:=asterisk
+libspeex
183 TITLE
:=Speex
/PCM16 Codec Translator
186 This package contains the Speex speech compression codec translator for
\\\
190 define Package
/asterisk-pbx-dundi
191 $(call Package
/asterisk
/Default
)
196 This package provides DUNDi
(Distributed Universal Number Discovery
) \\\
200 define Package
/asterisk-pbx-dundi
/conffiles
201 /etc
/asterisk
/dundi.conf
204 define Package
/asterisk-res-agi
205 $(call Package
/asterisk
/Default
)
210 This package provides AGI
(Asterisk Gateway Interface
) support to
\\\
214 define Package
/asterisk-mysql
215 $(call Package
/asterisk
/Default
)
216 DEPENDS
:=asterisk
+libmysqlclient
220 This package contains MySQL support modules for Asterisk.
223 define Package
/asterisk-mysql
/conffiles
224 /etc
/asterisk
/cdr_mysql.conf
227 define Package
/asterisk-pgsql
228 $(call Package
/asterisk
/Default
)
229 DEPENDS
:=asterisk
+libpq
230 TITLE
:=PostgreSQL support
233 This package contains PostgreSQL support modules for Asterisk.
236 define Package
/asterisk-pgsql
/conffiles
237 /etc
/asterisk
/cdr_pgsql.conf
240 define Package
/asterisk-sqlite
241 $(call Package
/asterisk
/Default
)
242 DEPENDS
:=asterisk
+libsqlite2
243 TITLE
:=SQLite modules
246 This package contains SQLite support modules for Asterisk.
249 define Package
/asterisk-sounds
250 $(call Package
/asterisk
)
256 This package contains sound files for Asterisk.
259 define Package
/asterisk-voicemail
260 $(call Package
/asterisk
/Default
)
262 TITLE
:=Voicemail support
265 This package contains voicemail related modules for Asterisk.
268 define Package
/asterisk-voicemail
/conffiles
269 /etc
/asterisk
/voicemail.conf
273 # Make sure the options below are enabled when building with the SDK
274 CONFIG_PACKAGE_asterisk-mysql
:=m
275 CONFIG_PACKAGE_asterisk-pgsql
:=m
276 CONFIG_PACKAGE_asterisk-sqlite
:=m
277 CONFIG_PACKAGE_asterisk-chan-bluetooth
:=m
278 CONFIG_PACKAGE_asterisk-chan-h323
:=m
279 CONFIG_PACKAGE_asterisk-codec-speex
:=m
282 EXTRA_CFLAGS
:= -I
$(STAGING_DIR
)/usr
/include -I
$(STAGING_DIR
)/include
283 EXTRA_LDFLAGS
:= -L
$(STAGING_DIR
)/usr
/lib
-L
$(STAGING_DIR
)/lib
285 ifneq ($(CONFIG_PACKAGE_asterisk-mysql
),)
286 EXTRA_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/mysql
287 EXTRA_LDFLAGS
+= -L
$(STAGING_DIR
)/usr
/lib
/mysql
288 EXTRA_APP_MODULES
+= app_sql_mysql.so
289 EXTRA_CDR_MODULES
+= cdr_mysql.so
290 EXTRA_RES_MODULES
+= res_config_mysql.so
292 ifneq ($(CONFIG_PACKAGE_asterisk-pgsql
),)
293 EXTRA_APP_MODULES
+= app_sql_postgres.so
294 EXTRA_CDR_MODULES
+= cdr_pgsql.so
296 ifneq ($(CONFIG_PACKAGE_asterisk-sqlite
),)
297 EXTRA_CDR_MODULES
+= cdr_sqlite.so
299 ifneq ($(CONFIG_PACKAGE_asterisk-chan-bluetooth
),)
300 EXTRA_CHAN_MODULES
+= chan_bluetooth.so
302 ifneq ($(CONFIG_PACKAGE_asterisk-chan-h323
),)
304 OPENH323DIR
="$(BUILD_DIR)/openh323" \
305 PWLIBDIR
="$(BUILD_DIR)/pwlib" \
306 CXXLIBS
="-nodefaultlibs -luClibc++ -lc -lm -lgcc"
307 EXTRA_CHAN_MODULES
+= chan_h323.so
309 ifneq ($(CONFIG_PACKAGE_asterisk-codec-speex
),)
310 EXTRA_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/speex
311 EXTRA_CODEC_MODULES
+= codec_speex.so
314 define Build
/Configure
317 ifneq ($(CONFIG_PACKAGE_asterisk-chan-h323
),)
318 define Build
/Compile
/chan-h323
319 $(MAKE
) -C
"$(PKG_BUILD_DIR)/channels/h323" \
320 $(TARGET_CONFIGURE_OPTS
) \
327 $(call Build
/Compile
/chan-h323
)
328 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
330 CROSS_COMPILE
="$(TARGET_CROSS)" \
331 CROSS_COMPILE_BIN
="/void/" \
332 CROSS_COMPILE_TARGET
="/void/" \
333 $(TARGET_CONFIGURE_OPTS
) \
334 HOST_CC
="$(HOSTCC)" \
335 OPTIMIZE
="$(TARGET_CFLAGS)" \
338 OPTIONS
="-DLOW_MEMORY -Dlinux" \
340 EXTRA_CFLAGS
="$(EXTRA_CFLAGS)" \
341 EXTRA_LDFLAGS
="$(EXTRA_LDFLAGS)" \
342 EXTRA_APP_MODULES
="$(EXTRA_APP_MODULES)" \
343 EXTRA_CDR_MODULES
="$(EXTRA_CDR_MODULES)" \
344 EXTRA_CHAN_MODULES
="$(EXTRA_CHAN_MODULES)" \
345 EXTRA_CODEC_MODULES
="$(EXTRA_CODEC_MODULES)" \
346 EXTRA_RES_MODULES
="$(EXTRA_RES_MODULES)" \
347 DESTDIR
="$(PKG_INSTALL_DIR)" \
348 ASTVARLIBDIR
="/usr/lib/asterisk" \
351 $(SED
) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR
)/etc
/asterisk
/musiconhold.conf
352 rm -f
$(PKG_INSTALL_DIR
)/etc
/asterisk
/*.old
355 define Package
/asterisk
/install
356 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)
357 rm -rf
$(1)/usr
/sbin
/astgenkey
359 rm -rf
$(1)/usr
/share
360 rm -rf
$(1)/usr
/include
362 (cd
$(1)/usr
/lib
/asterisk
; \
366 rm -rf mohmp3
/*.mp3
; \
369 rm -rf
*adsi
* *festival
* *modem
* *meetme
* *oss
* *phone
* *intercom
* \
370 *mp3
* *nbscat
* *mysql
* *postgres
* *pgsql
* *voicemail
* *speex
* \
371 *zapateller
* *jpeg
*; \
372 rm -f chan_bluetooth.so
; \
373 rm -f chan_h323.so
; \
374 rm -f chan_mgcp.so
; \
375 rm -f chan_skinny.so
; \
376 rm -f
{codec
,format
}_ilbc.so
; \
377 rm -f codec_lpc10.so
; \
378 rm -f pbx_dundi.so
; \
381 (cd
$(1)/etc
/asterisk
; \
382 rm -f
*odbc
* *mysql
* *postgres
* *pgsql
* *voicemail
* *adsi
* *oss
* *alsa
* \
383 *festival
* *modem
* *meetme
* *phone
* *tds
* *vofr
* *rpt
* *vpb
* \
385 rm -f bluetooth.conf
; \
387 rm -f skinny.conf
; \
390 install -m0644 .
/files
/modules.conf
$(1)/etc
/asterisk
/
391 install -d
-m0755
$(1)/etc
/default
392 install -m0644 .
/files
/asterisk.default
$(1)/etc
/default
/asterisk
393 install -d
-m0755
$(1)/etc
/init.d
394 install -m0755 .
/files
/asterisk.init
$(1)/etc
/init.d
/asterisk
395 ln
-sf asterisk
$(1)/etc
/init.d
/S60asterisk
398 define Package
/asterisk-mini
/install
399 install -d
-m0755
$(1)/etc
/asterisk
400 for f in asterisk enum extconfig extensions features iax iaxprov logger manager modules musiconhold rtp sip
; do \
401 $(CP
) $(PKG_INSTALL_DIR
)/etc
/asterisk
/$$$$f.conf
$(1)/etc
/asterisk
/ ; \
403 install -m0644 .
/files
/modules.conf
$(1)/etc
/asterisk
/
404 install -d
-m0755
$(1)/usr
/lib
/asterisk
405 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/asterisk
/firmware
$(1)/usr
/lib
/asterisk
/
406 install -d
-m0755
$(1)/usr
/lib
/asterisk
/keys
407 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
408 for f in chan_iax2 chan_local chan_sip codec_gsm codec_ulaw format_gsm format_pcm format_wav \
409 format_wav_gsm pbx_config res_features res_musiconhold
; do \
410 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/asterisk
/modules
/$$$$f.so
$(1)/usr
/lib
/asterisk
/modules
/ ; \
412 install -d
-m0755
$(1)/usr
/lib
/asterisk
/mohmp3
413 install -d
-m0755
$(1)/usr
/lib
/asterisk
/sounds
414 install -d
-m0755
$(1)/usr
/sbin
415 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/asterisk
$(1)/usr
/sbin
/
416 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/safe_asterisk
$(1)/usr
/sbin
/
417 install -d
-m0755
$(1)/etc
/default
418 install -m0644 .
/files
/asterisk.default
$(1)/etc
/default
/asterisk
419 install -d
-m0755
$(1)/etc
/init.d
420 install -m0755 .
/files
/asterisk.init
$(1)/etc
/init.d
/asterisk
421 ln
-sf asterisk
$(1)/etc
/init.d
/S
$(PKG_INIT_PRIO
)asterisk
424 define Package
/asterisk-mysql
/install
425 install -d
-m0755
$(1)/etc
/asterisk
426 install -m0600
$(PKG_BUILD_DIR
)/configs
/cdr_mysql.conf.sample
$(1)/etc
/asterisk
/cdr_mysql.conf
427 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
428 install -m0755
$(PKG_BUILD_DIR
)/apps
/app_sql_mysql.so
$(1)/usr
/lib
/asterisk
/modules
/
429 install -m0755
$(PKG_BUILD_DIR
)/cdr
/cdr_mysql.so
$(1)/usr
/lib
/asterisk
/modules
/
432 define Package
/asterisk-pgsql
/install
433 install -d
-m0755
$(1)/etc
/asterisk
434 install -m0600
$(PKG_BUILD_DIR
)/configs
/cdr_pgsql.conf.sample
$(1)/etc
/asterisk
/cdr_pgsql.conf
435 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
436 install -m0755
$(PKG_BUILD_DIR
)/apps
/app_sql_postgres.so
$(1)/usr
/lib
/asterisk
/modules
/
437 install -m0755
$(PKG_BUILD_DIR
)/cdr
/cdr_pgsql.so
$(1)/usr
/lib
/asterisk
/modules
/
440 define Package
/asterisk-sqlite
/install
441 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
442 install -m0755
$(PKG_BUILD_DIR
)/cdr
/cdr_sqlite.so
$(1)/usr
/lib
/asterisk
/modules
/
445 define Package
/asterisk-sounds
/install
446 install -d
-m0755
$(1)/usr
/lib
/asterisk
/sounds
447 $(CP
) $(PKG_BUILD_DIR
)/sounds
/* $(1)/usr
/lib
/asterisk
/sounds
/
448 rm -f
$(1)/usr
/lib
/asterisk
/sounds
/*.mp3
449 rm -f
$(1)/usr
/lib
/asterisk
/sounds
/vm-
*
452 define Package
/asterisk-voicemail
/install
453 install -d
-m0755
$(1)/etc
/asterisk
454 install -m0644
$(PKG_BUILD_DIR
)/configs
/voicemail.conf.sample
$(1)/etc
/asterisk
/voicemail.conf
455 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
456 install -m0755
$(PKG_BUILD_DIR
)/apps
/*voicemail.so
$(1)/usr
/lib
/asterisk
/modules
/
457 install -m0755
$(PKG_BUILD_DIR
)/res
/res_adsi.so
$(1)/usr
/lib
/asterisk
/modules
/
458 install -d
-m0755
$(1)/usr
/lib
/asterisk
/sounds
459 $(CP
) $(PKG_BUILD_DIR
)/sounds
/vm-
*.gsm
$(1)/usr
/lib
/asterisk
/sounds
/
462 define Package
/asterisk-chan-bluetooth
/install
463 install -d
-m0755
$(1)/etc
/asterisk
464 install -m0644
$(PKG_BUILD_DIR
)/configs
/bluetooth.conf
$(1)/etc
/asterisk
/bluetooth.conf
465 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
466 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_bluetooth.so
$(1)/usr
/lib
/asterisk
/modules
/
469 define Package
/asterisk-chan-h323
/install
470 install -d
-m0755
$(1)/etc
/asterisk
471 install -m0644
$(PKG_BUILD_DIR
)/channels
/h323
/h323.conf.sample
$(1)/etc
/asterisk
/h323.conf
472 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
473 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_h323.so
$(1)/usr
/lib
/asterisk
/modules
/
476 define Package
/asterisk-chan-mgcp
/install
477 install -d
-m0755
$(1)/etc
/asterisk
478 install -m0644
$(PKG_BUILD_DIR
)/configs
/mgcp.conf.sample
$(1)/etc
/asterisk
/mgcp.conf
479 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
480 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_mgcp.so
$(1)/usr
/lib
/asterisk
/modules
/
483 define Package
/asterisk-chan-skinny
/install
484 install -d
-m0755
$(1)/etc
/asterisk
485 install -m0644
$(PKG_BUILD_DIR
)/configs
/skinny.conf.sample
$(1)/etc
/asterisk
/skinny.conf
486 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
487 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_skinny.so
$(1)/usr
/lib
/asterisk
/modules
/
490 define Package
/asterisk-code-ilbc
/install
491 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
492 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_ilbc.so
$(1)/usr
/lib
/asterisk
/modules
/
493 install -m0755
$(PKG_BUILD_DIR
)/formats
/format_ilbc.so
$(1)/usr
/lib
/asterisk
/modules
/
496 define Package
/asterisk-codec-lpc10
/install
497 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
498 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_lpc10.so
$(1)/usr
/lib
/asterisk
/modules
/
501 define Package
/asterisk-codec-speex
/install
502 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
503 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_speex.so
$(1)/usr
/lib
/asterisk
/modules
/
506 define Package
/asterisk-pbx-dundi
/install
507 install -d
-m0755
$(1)/etc
/asterisk
508 install -m0644
$(PKG_BUILD_DIR
)/configs
/dundi.conf.sample
$(1)/etc
/asterisk
/dundi.conf
509 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
510 install -m0755
$(PKG_BUILD_DIR
)/pbx
/pbx_dundi.so
$(1)/usr
/lib
/asterisk
/modules
/
513 define Package
/asterisk-res-agi
/install
514 install -d
-m0755
$(1)/usr
/lib
/asterisk
/agi-bin
515 install -d
-m0755
$(1)/usr
/lib
/asterisk
/modules
516 install -m0755
$(PKG_BUILD_DIR
)/res
/res_agi.so
$(1)/usr
/lib
/asterisk
/modules
/
519 $(eval
$(call BuildPackage
,asterisk
))
520 $(eval
$(call BuildPackage
,asterisk-mini
))
521 $(eval
$(call BuildPackage
,asterisk-mysql
))
522 $(eval
$(call BuildPackage
,asterisk-pgsql
))
523 $(eval
$(call BuildPackage
,asterisk-sqlite
))
524 $(eval
$(call BuildPackage
,asterisk-voicemail
))
525 $(eval
$(call BuildPackage
,asterisk-sounds
))
526 $(eval
$(call BuildPackage
,asterisk-chan-bluetooth
))
527 $(eval
$(call BuildPackage
,asterisk-chan-h323
))
528 $(eval
$(call BuildPackage
,asterisk-chan-mgcp
))
529 $(eval
$(call BuildPackage
,asterisk-chan-skinny
))
530 $(eval
$(call BuildPackage
,asterisk-codec-ilbc
))
531 $(eval
$(call BuildPackage
,asterisk-codec-lpc10
))
532 $(eval
$(call BuildPackage
,asterisk-codec-speex
))
533 $(eval
$(call BuildPackage
,asterisk-pbx-dundi
))
534 $(eval
$(call BuildPackage
,asterisk-res-agi
))