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
23 include $(INCLUDE_DIR)/package.mk
25 define Package/asterisk/Default
29 Asterisk is a complete PBX in software. It provides all of the features \\\
30 you would expect from a PBX and more. Asterisk does voice over IP in three \\\
31 protocols, and can interoperate with almost all standards-based telephony \\\
32 equipment using relatively inexpensive hardware.
33 URL:=http://www.asterisk.org/
36 define Package/asterisk
37 $(call Package/asterisk/Default)
38 DEPENDS:=+libncurses +libpthread
39 TITLE:=Complete open source PBX
43 define Package/asterisk/conffiles
44 /etc/asterisk/asterisk.conf
45 /etc/asterisk/agents.conf
46 /etc/asterisk/alarmreceiver.conf
47 /etc/asterisk/cdr_manager.conf
48 /etc/asterisk/codecs.conf
49 /etc/asterisk/enum.conf
50 /etc/asterisk/extconfig.conf
51 /etc/asterisk/extensions.conf
52 /etc/asterisk/features.conf
53 /etc/asterisk/iax.conf
54 /etc/asterisk/iaxprov.conf
55 /etc/asterisk/indications.conf
56 /etc/asterisk/logger.conf
57 /etc/asterisk/manager.conf
58 /etc/asterisk/modules.conf
59 /etc/asterisk/musiconhold.conf
60 /etc/asterisk/osp.conf
61 /etc/asterisk/privacy.conf
62 /etc/asterisk/queues.conf
63 /etc/asterisk/rtp.conf
64 /etc/asterisk/sip.conf
67 define Package/asterisk-mini
68 $(call Package/asterisk/Default)
70 TITLE:=Minimal open source PBX
73 This package contains only the following modules: \\\
88 define Package/asterisk-mini/conffiles
89 /etc/asterisk/asterisk.conf
90 /etc/asterisk/enum.conf
91 /etc/asterisk/extconfig.conf
92 /etc/asterisk/extensions.conf
93 /etc/asterisk/features.conf
94 /etc/asterisk/iax.conf
95 /etc/asterisk/iaxprov.conf
96 /etc/asterisk/logger.conf
97 /etc/asterisk/manager.conf
98 /etc/asterisk/modules.conf
99 /etc/asterisk/musiconhold.conf
100 /etc/asterisk/rtp.conf
101 /etc/asterisk/sip.conf
104 define Package/asterisk-chan-bluetooth
105 $(call Package/asterisk/Default)
106 DEPENDS:=asterisk +bluez-libs
107 TITLE:=Bluetooth HandsFreeProfile support for Asterisk
110 This package provides Bluetooth HandsFreeProfile support to Asterisk.
113 define Package/asterisk-chan-bluetooth/conffiles
114 /etc/asterisk/bluetooth.conf
117 define Package/asterisk-chan-h323
118 $(call Package/asterisk/Default)
119 DEPENDS:=asterisk +libopenh323
120 TITLE:=H.323 support for Asterisk
123 This package provides H.323 support to Asterisk.
126 define Package/asterisk-chan-h323/conffiles
127 /etc/asterisk/h323.conf
130 define Package/asterisk-chan-mgcp
131 $(call Package/asterisk/Default)
136 This package provides MGCP (Media Gateway Control Protocol) support \\\
140 define Package/asterisk-chan-mgcp/conffiles
141 /etc/asterisk/mgcp.conf
144 define Package/asterisk-chan-skinny
145 $(call Package/asterisk/Default)
147 TITLE:=Skinny Client Control Protocol support
150 This package provided Skinny Client Control Protocol support to \\\
154 define Package/asterisk-chan-skinny/conffiles
155 /etc/asterisk/skinny.conf
158 define Package/asterisk-codec-ilbc
159 $(call Package/asterisk/Default)
161 TITLE:=ILBC Translator
164 This package contains the ILBC (Internet Low Bitrate Codec) translator \\\
168 define Package/asterisk-codec-lpc10
169 $(call Package/asterisk/Default)
171 TITLE:=LPC10 2.4kbps voice codec Translator
174 This package contains the LPC10 (Linear Predictor Code) 2.4kbps voice \\\
175 codec translator for Asterisk.
178 define Package/asterisk-codec-speex
179 $(call Package/asterisk/Default)
180 DEPENDS:=asterisk +libspeex
181 TITLE:=Speex/PCM16 Codec Translator
184 This package contains the Speex speech compression codec translator for \\\
188 define Package/asterisk-pbx-dundi
189 $(call Package/asterisk/Default)
194 This package provides DUNDi (Distributed Universal Number Discovery) \\\
198 define Package/asterisk-pbx-dundi/conffiles
199 /etc/asterisk/dundi.conf
202 define Package/asterisk-res-agi
203 $(call Package/asterisk/Default)
208 This package provides AGI (Asterisk Gateway Interface) support to \\\
212 define Package/asterisk-mysql
213 $(call Package/asterisk/Default)
214 DEPENDS:=asterisk +libmysqlclient
218 This package contains MySQL support modules for Asterisk.
221 define Package/asterisk-mysql/conffiles
222 /etc/asterisk/cdr_mysql.conf
225 define Package/asterisk-pgsql
226 $(call Package/asterisk/Default)
227 DEPENDS:=asterisk +libpq
228 TITLE:=PostgreSQL support
231 This package contains PostgreSQL support modules for Asterisk.
234 define Package/asterisk-pgsql/conffiles
235 /etc/asterisk/cdr_pgsql.conf
238 define Package/asterisk-sqlite
239 $(call Package/asterisk/Default)
240 DEPENDS:=asterisk +libsqlite2
241 TITLE:=SQLite modules
244 This package contains SQLite support modules for Asterisk.
247 define Package/asterisk-sounds
248 $(call Package/asterisk)
254 This package contains sound files for Asterisk.
257 define Package/asterisk-voicemail
258 $(call Package/asterisk/Default)
260 TITLE:=Voicemail support
263 This package contains voicemail related modules for Asterisk.
266 define Package/asterisk-voicemail/conffiles
267 /etc/asterisk/voicemail.conf
271 # Make sure the options below are enabled when building with the SDK
272 CONFIG_PACKAGE_asterisk-mysql:=m
273 CONFIG_PACKAGE_asterisk-pgsql:=m
274 CONFIG_PACKAGE_asterisk-sqlite:=m
275 CONFIG_PACKAGE_asterisk-chan-bluetooth:=m
276 CONFIG_PACKAGE_asterisk-chan-h323:=m
277 CONFIG_PACKAGE_asterisk-codec-speex:=m
280 EXTRA_CFLAGS:= -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
281 EXTRA_LDFLAGS:= -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
283 ifneq ($(CONFIG_PACKAGE_asterisk-mysql),)
284 EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/mysql
285 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
286 EXTRA_APP_MODULES+= app_sql_mysql.so
287 EXTRA_CDR_MODULES+= cdr_mysql.so
288 EXTRA_RES_MODULES+= res_config_mysql.so
290 ifneq ($(CONFIG_PACKAGE_asterisk-pgsql),)
291 EXTRA_APP_MODULES+= app_sql_postgres.so
292 EXTRA_CDR_MODULES+= cdr_pgsql.so
294 ifneq ($(CONFIG_PACKAGE_asterisk-sqlite),)
295 EXTRA_CDR_MODULES+= cdr_sqlite.so
297 ifneq ($(CONFIG_PACKAGE_asterisk-chan-bluetooth),)
298 EXTRA_CHAN_MODULES+= chan_bluetooth.so
300 ifneq ($(CONFIG_PACKAGE_asterisk-chan-h323),)
302 OPENH323DIR="$(BUILD_DIR)/openh323" \
303 PWLIBDIR="$(BUILD_DIR)/pwlib" \
304 CXXLIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc"
305 EXTRA_CHAN_MODULES+= chan_h323.so
307 ifneq ($(CONFIG_PACKAGE_asterisk-codec-speex),)
308 EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/speex
309 EXTRA_CODEC_MODULES+= codec_speex.so
312 define Build/Configure
315 ifneq ($(CONFIG_PACKAGE_asterisk-chan-h323),)
316 define Build/Compile/chan-h323
317 $(MAKE) -C "$(PKG_BUILD_DIR)/channels/h323" \
318 $(TARGET_CONFIGURE_OPTS) \
325 $(call Build/Compile/chan-h323)
326 $(MAKE) -C "$(PKG_BUILD_DIR)" \
328 CROSS_COMPILE="$(TARGET_CROSS)" \
329 CROSS_COMPILE_BIN="/void/" \
330 CROSS_COMPILE_TARGET="/void/" \
331 $(TARGET_CONFIGURE_OPTS) \
332 HOST_CC="$(HOSTCC)" \
333 OPTIMIZE="$(TARGET_CFLAGS)" \
336 OPTIONS="-DLOW_MEMORY -Dlinux" \
338 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
339 EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" \
340 EXTRA_APP_MODULES="$(EXTRA_APP_MODULES)" \
341 EXTRA_CDR_MODULES="$(EXTRA_CDR_MODULES)" \
342 EXTRA_CHAN_MODULES="$(EXTRA_CHAN_MODULES)" \
343 EXTRA_CODEC_MODULES="$(EXTRA_CODEC_MODULES)" \
344 EXTRA_RES_MODULES="$(EXTRA_RES_MODULES)" \
345 DESTDIR="$(PKG_INSTALL_DIR)" \
346 ASTVARLIBDIR="/usr/lib/asterisk" \
349 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
350 rm -f $(PKG_INSTALL_DIR)/etc/asterisk/*.old
353 define Package/asterisk/install
354 $(CP) $(PKG_INSTALL_DIR)/* $(1)
355 rm -rf $(1)/usr/sbin/astgenkey
357 rm -rf $(1)/usr/share
358 rm -rf $(1)/usr/include
360 (cd $(1)/usr/lib/asterisk; \
364 rm -rf mohmp3/*.mp3; \
367 rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
368 *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
369 *zapateller* *jpeg*; \
370 rm -f chan_bluetooth.so ; \
371 rm -f chan_h323.so ; \
372 rm -f chan_mgcp.so ; \
373 rm -f chan_skinny.so ; \
374 rm -f {codec,format}_ilbc.so ; \
375 rm -f codec_lpc10.so ; \
376 rm -f pbx_dundi.so ; \
379 (cd $(1)/etc/asterisk; \
380 rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
381 *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
383 rm -f bluetooth.conf ; \
385 rm -f skinny.conf ; \
388 install -m0644 ./files/modules.conf $(1)/etc/asterisk/
389 install -d -m0755 $(1)/etc/default
390 install -m0644 ./files/asterisk.default $(1)/etc/default/asterisk
391 install -d -m0755 $(1)/etc/init.d
392 install -m0755 ./files/asterisk.init $(1)/etc/init.d/asterisk
395 define Package/asterisk-mini/install
396 install -d -m0755 $(1)/etc/asterisk
397 for f in asterisk enum extconfig extensions features iax iaxprov logger manager modules musiconhold rtp sip; do \
398 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
400 install -m0644 ./files/modules.conf $(1)/etc/asterisk/
401 install -d -m0755 $(1)/usr/lib/asterisk
402 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/firmware $(1)/usr/lib/asterisk/
403 install -d -m0755 $(1)/usr/lib/asterisk/keys
404 install -d -m0755 $(1)/usr/lib/asterisk/modules
405 for f in chan_iax2 chan_local chan_sip codec_gsm codec_ulaw format_gsm format_pcm format_wav \
406 format_wav_gsm pbx_config res_features res_musiconhold; do \
407 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
409 install -d -m0755 $(1)/usr/lib/asterisk/mohmp3
410 install -d -m0755 $(1)/usr/lib/asterisk/sounds
411 install -d -m0755 $(1)/usr/sbin
412 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
413 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/safe_asterisk $(1)/usr/sbin/
414 install -d -m0755 $(1)/etc/default
415 install -m0644 ./files/asterisk.default $(1)/etc/default/asterisk
416 install -d -m0755 $(1)/etc/init.d
417 install -m0755 ./files/asterisk.init $(1)/etc/init.d/asterisk
420 define Package/asterisk-mysql/install
421 install -d -m0755 $(1)/etc/asterisk
422 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(1)/etc/asterisk/cdr_mysql.conf
423 install -d -m0755 $(1)/usr/lib/asterisk/modules
424 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(1)/usr/lib/asterisk/modules/
425 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(1)/usr/lib/asterisk/modules/
428 define Package/asterisk-pgsql/install
429 install -d -m0755 $(1)/etc/asterisk
430 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(1)/etc/asterisk/cdr_pgsql.conf
431 install -d -m0755 $(1)/usr/lib/asterisk/modules
432 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(1)/usr/lib/asterisk/modules/
433 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(1)/usr/lib/asterisk/modules/
436 define Package/asterisk-sqlite/install
437 install -d -m0755 $(1)/usr/lib/asterisk/modules
438 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_sqlite.so $(1)/usr/lib/asterisk/modules/
441 define Package/asterisk-sounds/install
442 install -d -m0755 $(1)/usr/lib/asterisk/sounds
443 $(CP) $(PKG_BUILD_DIR)/sounds/* $(1)/usr/lib/asterisk/sounds/
444 rm -f $(1)/usr/lib/asterisk/sounds/*.mp3
445 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
448 define Package/asterisk-voicemail/install
449 install -d -m0755 $(1)/etc/asterisk
450 install -m0644 $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(1)/etc/asterisk/voicemail.conf
451 install -d -m0755 $(1)/usr/lib/asterisk/modules
452 install -m0755 $(PKG_BUILD_DIR)/apps/*voicemail.so $(1)/usr/lib/asterisk/modules/
453 install -m0755 $(PKG_BUILD_DIR)/res/res_adsi.so $(1)/usr/lib/asterisk/modules/
454 install -d -m0755 $(1)/usr/lib/asterisk/sounds
455 $(CP) $(PKG_BUILD_DIR)/sounds/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
458 define Package/asterisk-chan-bluetooth/install
459 install -d -m0755 $(1)/etc/asterisk
460 install -m0644 $(PKG_BUILD_DIR)/configs/bluetooth.conf $(1)/etc/asterisk/bluetooth.conf
461 install -d -m0755 $(1)/usr/lib/asterisk/modules
462 install -m0755 $(PKG_BUILD_DIR)/channels/chan_bluetooth.so $(1)/usr/lib/asterisk/modules/
465 define Package/asterisk-chan-h323/install
466 install -d -m0755 $(1)/etc/asterisk
467 install -m0644 $(PKG_BUILD_DIR)/channels/h323/h323.conf.sample $(1)/etc/asterisk/h323.conf
468 install -d -m0755 $(1)/usr/lib/asterisk/modules
469 install -m0755 $(PKG_BUILD_DIR)/channels/chan_h323.so $(1)/usr/lib/asterisk/modules/
472 define Package/asterisk-chan-mgcp/install
473 install -d -m0755 $(1)/etc/asterisk
474 install -m0644 $(PKG_BUILD_DIR)/configs/mgcp.conf.sample $(1)/etc/asterisk/mgcp.conf
475 install -d -m0755 $(1)/usr/lib/asterisk/modules
476 install -m0755 $(PKG_BUILD_DIR)/channels/chan_mgcp.so $(1)/usr/lib/asterisk/modules/
479 define Package/asterisk-chan-skinny/install
480 install -d -m0755 $(1)/etc/asterisk
481 install -m0644 $(PKG_BUILD_DIR)/configs/skinny.conf.sample $(1)/etc/asterisk/skinny.conf
482 install -d -m0755 $(1)/usr/lib/asterisk/modules
483 install -m0755 $(PKG_BUILD_DIR)/channels/chan_skinny.so $(1)/usr/lib/asterisk/modules/
486 define Package/asterisk-code-ilbc/install
487 install -d -m0755 $(1)/usr/lib/asterisk/modules
488 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_ilbc.so $(1)/usr/lib/asterisk/modules/
489 install -m0755 $(PKG_BUILD_DIR)/formats/format_ilbc.so $(1)/usr/lib/asterisk/modules/
492 define Package/asterisk-codec-lpc10/install
493 install -d -m0755 $(1)/usr/lib/asterisk/modules
494 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_lpc10.so $(1)/usr/lib/asterisk/modules/
497 define Package/asterisk-codec-speex/install
498 install -d -m0755 $(1)/usr/lib/asterisk/modules
499 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_speex.so $(1)/usr/lib/asterisk/modules/
502 define Package/asterisk-pbx-dundi/install
503 install -d -m0755 $(1)/etc/asterisk
504 install -m0644 $(PKG_BUILD_DIR)/configs/dundi.conf.sample $(1)/etc/asterisk/dundi.conf
505 install -d -m0755 $(1)/usr/lib/asterisk/modules
506 install -m0755 $(PKG_BUILD_DIR)/pbx/pbx_dundi.so $(1)/usr/lib/asterisk/modules/
509 define Package/asterisk-res-agi/install
510 install -d -m0755 $(1)/usr/lib/asterisk/agi-bin
511 install -d -m0755 $(1)/usr/lib/asterisk/modules
512 install -m0755 $(PKG_BUILD_DIR)/res/res_agi.so $(1)/usr/lib/asterisk/modules/
515 $(eval $(call BuildPackage,asterisk))
516 $(eval $(call BuildPackage,asterisk-mini))
517 $(eval $(call BuildPackage,asterisk-mysql))
518 $(eval $(call BuildPackage,asterisk-pgsql))
519 $(eval $(call BuildPackage,asterisk-sqlite))
520 $(eval $(call BuildPackage,asterisk-voicemail))
521 $(eval $(call BuildPackage,asterisk-sounds))
522 $(eval $(call BuildPackage,asterisk-chan-bluetooth))
523 $(eval $(call BuildPackage,asterisk-chan-h323))
524 $(eval $(call BuildPackage,asterisk-chan-mgcp))
525 $(eval $(call BuildPackage,asterisk-chan-skinny))
526 $(eval $(call BuildPackage,asterisk-codec-ilbc))
527 $(eval $(call BuildPackage,asterisk-codec-lpc10))
528 $(eval $(call BuildPackage,asterisk-codec-speex))
529 $(eval $(call BuildPackage,asterisk-pbx-dundi))
530 $(eval $(call BuildPackage,asterisk-res-agi))