2 # Copyright (C) 2008-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=7e4dccc79c504ae497ff42062279905d
18 include $(INCLUDE_DIR)/package.mk
20 define Package/asterisk16/Default
21 SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
24 URL:=http://www.asterisk.org/
27 define Package/asterisk16/Default/description
28 Asterisk is a complete PBX in software. It provides all of the features
29 you would expect from a PBX and more. Asterisk does voice over IP in three
30 protocols, and can interoperate with almost all standards-based telephony
31 equipment using relatively inexpensive hardware.
35 define Package/asterisk16
36 $(call Package/asterisk16/Default)
37 TITLE:=Complete open source PBX
38 DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 @!PACKAGE_asterisk14
41 define Package/asterisk16/description
42 $(call Package/asterisk16/Default/description)
45 define Package/asterisk16-sounds
46 $(call Package/asterisk16/Default)
51 define Package/asterisk16-sounds/description
52 $(call Package/asterisk16/Default/description)
53 This package contains sound files for Asterisk.
57 define Package/asterisk16-voicemail
58 $(call Package/asterisk16/Default)
59 TITLE:=Voicemail support
63 define Package/asterisk16-voicemail/description
64 $(call Package/asterisk16/Default/description)
65 This package contains voicemail related modules for Asterisk.
68 define Package/asterisk16-app-meetme
69 $(call Package/asterisk16/Default)
70 TITLE:=conferencing support
71 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
74 define Package/asterisk16-app-meetme/description
75 $(call Package/asterisk16/Default/description)
76 This package provides the MeetMe application driver Conferencing support to
80 define Package/asterisk16-chan-iax2
81 $(call Package/asterisk16/Default)
86 define Package/asterisk16-chan-iax2/description
87 $(call Package/asterisk16/Default/description)
88 This package provides IAX support to
92 define Package/asterisk16-chan-local
93 $(call Package/asterisk16/Default)
94 TITLE:=chan_local support
98 define Package/asterisk16-chan-local/description
99 $(call Package/asterisk16/Default/description)
100 This package provides chan_local support to
104 define Package/asterisk16-cdr
105 $(call Package/asterisk16/Default)
107 DEPENDS:= +asterisk16
110 define Package/asterisk16-cdr/description
111 $(call Package/asterisk16/Default/description)
112 This package provides Call Detail Record support to
116 define Package/asterisk16-res-musiconhold
117 $(call Package/asterisk16/Default)
119 DEPENDS:= +asterisk16
122 define Package/asterisk16-res-musiconhold/description
123 $(call Package/asterisk16/Default/description)
124 This package provides Music On Hold support to
128 define Package/asterisk16-format-g729
129 $(call Package/asterisk16/Default)
131 DEPENDS:= +asterisk16
134 define Package/asterisk16-format-g729/description
135 $(call Package/asterisk16/Default/description)
136 This package provides G.729 support to
144 --with-gsm=internal \
151 --with-ncurses="$(STAGING_DIR)/usr" \
157 --with-popt="$(STAGING_DIR)/usr" \
169 --with-z="$(STAGING_DIR)/usr" \
171 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
173 --with-dahdi="$(STAGING_DIR)/usr"
179 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
180 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
182 define Build/Configure
183 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
184 $(call Build/Configure/Default,,$(SITE_VARS))
188 $(MAKE) -C "$(PKG_BUILD_DIR)" \
189 include/asterisk/version.h \
190 include/asterisk/buildopts.h defaults.h \
192 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
193 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
194 $(MAKE) -C "$(PKG_BUILD_DIR)" \
195 ASTVARLIBDIR="/usr/lib/asterisk" \
199 DESTDIR="$(PKG_INSTALL_DIR)" \
201 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
204 #define Build/InstallDev
205 # mkdir -p $(1)/usr/include/asterisk/
206 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
207 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
210 define Package/asterisk16/conffiles
211 /etc/asterisk/asterisk.conf
212 /etc/asterisk/modules.conf
213 /etc/asterisk/extensions.conf
214 /etc/asterisk/sip.conf
215 /etc/asterisk/sip_notify.conf
216 /etc/asterisk/features.conf
217 /etc/asterisk/logger.conf
218 /etc/asterisk/manager.conf
219 /etc/asterisk/rtp.conf
220 /etc/default/asterisk
224 define Package/asterisk16/install
225 $(INSTALL_DIR) $(1)/etc/asterisk
226 for f in asterisk extensions features \
227 logger manager modules \
228 sip sip_notify rtp; do \
229 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
231 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
232 for f in app_dial app_echo app_playback app_macro \
234 codec_ulaw codec_gsm \
235 format_gsm format_pcm format_wav format_wav_gsm \
237 func_strings func_timeout func_callerid; do \
238 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
240 $(INSTALL_DIR) $(1)/usr/sbin
241 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
242 $(INSTALL_DIR) $(1)/etc/default
243 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
244 $(INSTALL_DIR) $(1)/etc/init.d
245 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
248 define Package/asterisk16-sounds/install
249 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
250 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
251 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
252 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
256 define Package/asterisk16-voicemail/conffiles
257 /etc/asterisk/voicemail.conf
260 define Package/asterisk16-voicemail/install
261 $(INSTALL_DIR) $(1)/etc/asterisk
262 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
263 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
264 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
265 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
266 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
267 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
270 define Package/asterisk16-app-meetme/conffiles
271 /etc/asterisk/meetme.conf
274 define Package/asterisk16-app-meetme/install
275 $(INSTALL_DIR) $(1)/etc/asterisk
276 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
277 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
278 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
279 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
280 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
281 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
284 define Package/asterisk16-chan-iax2/conffiles
285 /etc/asterisk/iax.conf
286 /etc/asterisk/iaxprov.conf
289 define Package/asterisk16-cdr/conffiles
290 /etc/asterisk/cdr.conf
291 /etc/asterisk/cdr_custom.conf
292 /etc/asterisk/cdr_manager.conf
293 /etc/asterisk/cdr_odbc.conf
294 /etc/asterisk/cdr_pgsql.conf
295 /etc/asterisk/cdr_tds.conf
298 define Package/asterisk16-res-musiconhold/conffiles
299 /etc/asterisk/musiconhold.conf
302 define Package/asterisk16-chan-iax2/install
303 $(INSTALL_DIR) $(1)/etc/asterisk
304 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
305 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
306 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
307 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
310 define Package/asterisk16-chan-local/install
311 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
312 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_local.so $(1)/usr/lib/asterisk/modules/
315 define Package/asterisk16-cdr/install
316 $(INSTALL_DIR) $(1)/etc/asterisk
317 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
318 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
319 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
322 define Package/asterisk16-res-musiconhold/install
323 $(INSTALL_DIR) $(1)/etc/asterisk
324 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
325 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
326 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
329 define Package/asterisk16-format-g729/install
330 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
331 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_g729.so $(1)/usr/lib/asterisk/modules/
334 $(eval $(call BuildPackage,asterisk16))
335 $(eval $(call BuildPackage,asterisk16-voicemail))
336 $(eval $(call BuildPackage,asterisk16-sounds))
337 #$(eval $(call BuildPackage,asterisk16-app-meetme))
338 $(eval $(call BuildPackage,asterisk16-chan-iax2))
339 $(eval $(call BuildPackage,asterisk16-chan-local))
340 $(eval $(call BuildPackage,asterisk16-cdr))
341 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
342 $(eval $(call BuildPackage,asterisk16-format-g729))