3 include $(TOPDIR)/rules.mk
8 PKG_MD5SUM:=04657086791e80f319c0d728af705001
10 PKG_SOURCE_URL:=http://ftp.digium.com/pub/asterisk/old-releases/ ftp://ftp.digium.com/pub/asterisk/old-releases/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
17 include $(TOPDIR)/package/rules.mk
18 $(eval $(call PKG_template,ASTERISK,asterisk,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
19 $(eval $(call PKG_template,ASTERISK_MINI,asterisk-mini,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20 $(eval $(call PKG_template,ASTERISK_MYSQL,asterisk-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21 $(eval $(call PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22 $(eval $(call PKG_template,ASTERISK_SQLITE,asterisk-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
23 $(eval $(call PKG_template,ASTERISK_VOICEMAIL,asterisk-voicemail,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
24 $(eval $(call PKG_template,ASTERISK_SOUNDS,asterisk-sounds,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
25 $(eval $(call PKG_template,ASTERISK_CHAN_BLUETOOTH,asterisk-chan-bluetooth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
26 $(eval $(call PKG_template,ASTERISK_CHAN_H323,asterisk-chan-h323,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
27 $(eval $(call PKG_template,ASTERISK_CHAN_MGCP,asterisk-chan-mgcp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
28 $(eval $(call PKG_template,ASTERISK_CHAN_SKINNY,asterisk-chan-skinny,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
29 $(eval $(call PKG_template,ASTERISK_CODEC_ILBC,asterisk-codec-ilbc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
30 $(eval $(call PKG_template,ASTERISK_CODEC_LPC10,asterisk-codec-lpc10,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
31 $(eval $(call PKG_template,ASTERISK_CODEC_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
32 $(eval $(call PKG_template,ASTERISK_PBX_DUNDI,asterisk-pbx-dundi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
33 $(eval $(call PKG_template,ASTERISK_RES_AGI,asterisk-res-agi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
35 EXTRA_CFLAGS := -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
36 EXTRA_LDFLAGS := -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
38 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
39 EXTRA_CFLAGS += -I$(STAGING_DIR)/usr/include/mysql
40 EXTRA_LDFLAGS += -L$(STAGING_DIR)/usr/lib/mysql
41 EXTRA_APP_MODULES += app_sql_mysql.so
42 EXTRA_CDR_MODULES += cdr_mysql.so
43 EXTRA_RES_MODULES += res_config_mysql.so
45 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
46 EXTRA_APP_MODULES += app_sql_postgres.so
47 EXTRA_CDR_MODULES += cdr_pgsql.so
49 ifneq ($(BR2_PACKAGE_ASTERISK_SQLITE),)
50 EXTRA_CDR_MODULES += cdr_sqlite.so
52 ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_BLUETOOTH),)
53 EXTRA_CHAN_MODULES += chan_bluetooth.so
55 ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_H323),)
57 OPENH323DIR="$(BUILD_DIR)/openh323" \
58 PWLIBDIR="$(BUILD_DIR)/pwlib" \
59 CXXLIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc"
60 EXTRA_CHAN_MODULES += chan_h323.so
62 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
63 EXTRA_CFLAGS += -I$(STAGING_DIR)/usr/include/speex
64 EXTRA_CODEC_MODULES += codec_speex.so
67 $(PKG_BUILD_DIR)/.configured:
70 $(PKG_BUILD_DIR)/.built:
71 ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_H323),)
72 $(MAKE) -C "$(PKG_BUILD_DIR)/channels/h323" \
73 $(TARGET_CONFIGURE_OPTS) \
77 $(MAKE) -C "$(PKG_BUILD_DIR)" \
79 CROSS_COMPILE="$(TARGET_CROSS)" \
80 CROSS_COMPILE_BIN="/void/" \
81 CROSS_COMPILE_TARGET="/void/" \
82 $(TARGET_CONFIGURE_OPTS) \
84 OPTIMIZE="$(TARGET_CFLAGS)" \
87 OPTIONS="-DLOW_MEMORY -Dlinux" \
89 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
90 EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" \
91 EXTRA_APP_MODULES="$(EXTRA_APP_MODULES)" \
92 EXTRA_CDR_MODULES="$(EXTRA_CDR_MODULES)" \
93 EXTRA_CHAN_MODULES="$(EXTRA_CHAN_MODULES)" \
94 EXTRA_CODEC_MODULES="$(EXTRA_CODEC_MODULES)" \
95 EXTRA_RES_MODULES="$(EXTRA_RES_MODULES)" \
96 DESTDIR="$(PKG_INSTALL_DIR)" \
97 ASTVARLIBDIR="/usr/lib/asterisk" \
100 rm -f $(PKG_INSTALL_DIR)/etc/asterisk/*.old
104 $(CP) $(PKG_INSTALL_DIR)/* $(IDIR_ASTERISK)
105 rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
106 rm -rf $(IDIR_ASTERISK)/usr/bin
107 rm -rf $(IDIR_ASTERISK)/usr/share
108 rm -rf $(IDIR_ASTERISK)/usr/include
109 rm -rf $(IDIR_ASTERISK)/var
110 (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
114 rm -rf mohmp3/*.mp3; \
117 rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
118 *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
119 *zapateller* *jpeg*; \
120 rm -f chan_bluetooth.so ; \
121 rm -f chan_h323.so ; \
122 rm -f chan_mgcp.so ; \
123 rm -f chan_skinny.so ; \
124 rm -f {codec,format}_ilbc.so ; \
125 rm -f codec_lpc10.so ; \
126 rm -f pbx_dundi.so ; \
129 (cd $(IDIR_ASTERISK)/etc/asterisk; \
130 rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
131 *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
133 rm -f bluetooth.conf ; \
135 rm -f skinny.conf ; \
138 install -m0644 ./files/modules.conf $(IDIR_ASTERISK)/etc/asterisk/
139 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
140 install -d -m0755 $(IDIR_ASTERISK)/etc/default
141 install -m0644 ./files/asterisk.default $(IDIR_ASTERISK)/etc/default/asterisk
142 install -d -m0755 $(IDIR_ASTERISK)/etc/init.d
143 install -m0755 ./files/asterisk.init $(IDIR_ASTERISK)/etc/init.d/asterisk
144 ln -sf asterisk $(IDIR_ASTERISK)/etc/init.d/S60asterisk
145 $(RSTRIP) $(IDIR_ASTERISK)
146 $(IPKG_BUILD) $(IDIR_ASTERISK) $(PACKAGE_DIR)
148 $(IPKG_ASTERISK_MINI):
149 install -d -m0755 $(IDIR_ASTERISK_MINI)/etc/asterisk
150 for f in asterisk enum extconfig extensions features iax iaxprov logger manager modules musiconhold rtp sip; do \
151 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$f.conf $(IDIR_ASTERISK_MINI)/etc/asterisk/ ; \
153 install -m0644 ./files/modules.conf $(IDIR_ASTERISK)/etc/asterisk/
154 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
155 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/lib/asterisk
156 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/firmware $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/
157 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/keys
158 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/modules
159 for f in chan_iax2 chan_local chan_sip codec_gsm codec_ulaw format_gsm format_pcm format_wav \
160 format_wav_gsm pbx_config res_features res_musiconhold; do \
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$f.so $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/modules/ ; \
163 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/mohmp3
164 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/lib/asterisk/sounds
165 install -d -m0755 $(IDIR_ASTERISK_MINI)/usr/sbin
166 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(IDIR_ASTERISK_MINI)/usr/sbin/
167 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/safe_asterisk $(IDIR_ASTERISK_MINI)/usr/sbin/
168 install -d -m0755 $(IDIR_ASTERISK_MINI)/etc/default
169 install -m0644 ./files/asterisk.default $(IDIR_ASTERISK_MINI)/etc/default/asterisk
170 install -d -m0755 $(IDIR_ASTERISK_MINI)/etc/init.d
171 install -m0755 ./files/asterisk.init $(IDIR_ASTERISK_MINI)/etc/init.d/asterisk
172 ln -sf asterisk $(IDIR_ASTERISK_MINI)/etc/init.d/S60asterisk
173 $(RSTRIP) $(IDIR_ASTERISK_MINI)
174 $(IPKG_BUILD) $(IDIR_ASTERISK_MINI) $(PACKAGE_DIR)
176 $(IPKG_ASTERISK_MYSQL):
177 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/etc/asterisk
178 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_mysql.conf.sample $(IDIR_ASTERISK_MYSQL)/etc/asterisk/cdr_mysql.conf
179 install -d -m0755 $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules
180 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
181 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_mysql.so $(IDIR_ASTERISK_MYSQL)/usr/lib/asterisk/modules/
182 $(RSTRIP) $(IDIR_ASTERISK_MYSQL)
183 $(IPKG_BUILD) $(IDIR_ASTERISK_MYSQL) $(PACKAGE_DIR)
185 $(IPKG_ASTERISK_PGSQL):
186 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/etc/asterisk
187 install -m0600 $(PKG_BUILD_DIR)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
188 install -d -m0755 $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
189 install -m0755 $(PKG_BUILD_DIR)/apps/app_sql_postgres.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
190 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
191 $(RSTRIP) $(IDIR_ASTERISK_PGSQL)
192 $(IPKG_BUILD) $(IDIR_ASTERISK_PGSQL) $(PACKAGE_DIR)
194 $(IPKG_ASTERISK_SQLITE):
195 install -d -m0755 $(IDIR_ASTERISK_SQLITE)/usr/lib/asterisk/modules
196 install -m0755 $(PKG_BUILD_DIR)/cdr/cdr_sqlite.so $(IDIR_ASTERISK_SQLITE)/usr/lib/asterisk/modules/
197 $(RSTRIP) $(IDIR_ASTERISK_SQLITE)
198 $(IPKG_BUILD) $(IDIR_ASTERISK_SQLITE) $(PACKAGE_DIR)
200 $(IPKG_ASTERISK_SOUNDS):
201 install -d -m0755 $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
202 $(CP) $(PKG_BUILD_DIR)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
203 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
204 rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
205 $(IPKG_BUILD) $(IDIR_ASTERISK_SOUNDS) $(PACKAGE_DIR)
207 $(IPKG_ASTERISK_VOICEMAIL):
208 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
209 install -m0644 $(PKG_BUILD_DIR)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
210 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
211 install -m0755 $(PKG_BUILD_DIR)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
212 install -m0755 $(PKG_BUILD_DIR)/res/res_adsi.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
213 install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds
214 $(CP) $(PKG_BUILD_DIR)/sounds/vm-*.gsm $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds/
215 $(RSTRIP) $(IDIR_ASTERISK_VOICEMAIL)
216 $(IPKG_BUILD) $(IDIR_ASTERISK_VOICEMAIL) $(PACKAGE_DIR)
218 $(IPKG_ASTERISK_CHAN_BLUETOOTH):
219 install -d -m0755 $(IDIR_ASTERISK_CHAN_BLUETOOTH)/etc/asterisk
220 install -m0644 $(PKG_BUILD_DIR)/configs/bluetooth.conf $(IDIR_ASTERISK_CHAN_BLUETOOTH)/etc/asterisk/bluetooth.conf
221 install -d -m0755 $(IDIR_ASTERISK_CHAN_BLUETOOTH)/usr/lib/asterisk/modules
222 install -m0755 $(PKG_BUILD_DIR)/channels/chan_bluetooth.so $(IDIR_ASTERISK_CHAN_BLUETOOTH)/usr/lib/asterisk/modules/
223 $(RSTRIP) $(IDIR_ASTERISK_CHAN_BLUETOOTH)
224 $(IPKG_BUILD) $(IDIR_ASTERISK_CHAN_BLUETOOTH) $(PACKAGE_DIR)
226 $(IPKG_ASTERISK_CHAN_H323):
227 install -d -m0755 $(IDIR_ASTERISK_CHAN_H323)/etc/asterisk
228 install -m0644 $(PKG_BUILD_DIR)/channels/h323/h323.conf.sample $(IDIR_ASTERISK_CHAN_H323)/etc/asterisk/h323.conf
229 install -d -m0755 $(IDIR_ASTERISK_CHAN_H323)/usr/lib/asterisk/modules
230 install -m0755 $(PKG_BUILD_DIR)/channels/chan_h323.so $(IDIR_ASTERISK_CHAN_H323)/usr/lib/asterisk/modules/
231 $(RSTRIP) $(IDIR_ASTERISK_CHAN_H323)
232 $(IPKG_BUILD) $(IDIR_ASTERISK_CHAN_H323) $(PACKAGE_DIR)
234 $(IPKG_ASTERISK_CHAN_MGCP):
235 install -d -m0755 $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk
236 install -m0644 $(PKG_BUILD_DIR)/configs/mgcp.conf.sample $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk/mgcp.conf
237 install -d -m0755 $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules
238 install -m0755 $(PKG_BUILD_DIR)/channels/chan_mgcp.so $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules/
239 $(RSTRIP) $(IDIR_ASTERISK_CHAN_MGCP)
240 $(IPKG_BUILD) $(IDIR_ASTERISK_CHAN_MGCP) $(PACKAGE_DIR)
242 $(IPKG_ASTERISK_CHAN_SKINNY):
243 install -d -m0755 $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk
244 install -m0644 $(PKG_BUILD_DIR)/configs/skinny.conf.sample $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk/skinny.conf
245 install -d -m0755 $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules
246 install -m0755 $(PKG_BUILD_DIR)/channels/chan_skinny.so $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules/
247 $(RSTRIP) $(IDIR_ASTERISK_CHAN_SKINNY)
248 $(IPKG_BUILD) $(IDIR_ASTERISK_CHAN_SKINNY) $(PACKAGE_DIR)
250 $(IPKG_ASTERISK_CODEC_ILBC):
251 install -d -m0755 $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules
252 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
253 install -m0755 $(PKG_BUILD_DIR)/formats/format_ilbc.so $(IDIR_ASTERISK_CODEC_ILBC)/usr/lib/asterisk/modules/
254 $(RSTRIP) $(IDIR_ASTERISK_CODEC_ILBC)
255 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_ILBC) $(PACKAGE_DIR)
257 $(IPKG_ASTERISK_CODEC_LPC10):
258 install -d -m0755 $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules
259 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_lpc10.so $(IDIR_ASTERISK_CODEC_LPC10)/usr/lib/asterisk/modules/
260 $(RSTRIP) $(IDIR_ASTERISK_CODEC_LPC10)
261 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_LPC10) $(PACKAGE_DIR)
263 $(IPKG_ASTERISK_CODEC_SPEEX):
264 install -d -m0755 $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules
265 install -m0755 $(PKG_BUILD_DIR)/codecs/codec_speex.so $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules/
266 $(RSTRIP) $(IDIR_ASTERISK_CODEC_SPEEX)
267 $(IPKG_BUILD) $(IDIR_ASTERISK_CODEC_SPEEX) $(PACKAGE_DIR)
269 $(IPKG_ASTERISK_PBX_DUNDI):
270 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk
271 install -m0644 $(PKG_BUILD_DIR)/configs/dundi.conf.sample $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk/dundi.conf
272 install -d -m0755 $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules
273 install -m0755 $(PKG_BUILD_DIR)/pbx/pbx_dundi.so $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules/
274 $(RSTRIP) $(IDIR_ASTERISK_PBX_DUNDI)
275 $(IPKG_BUILD) $(IDIR_ASTERISK_PBX_DUNDI) $(PACKAGE_DIR)
277 $(IPKG_ASTERISK_RES_AGI):
278 install -d -m0755 $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/agi-bin
279 install -d -m0755 $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules
280 install -m0755 $(PKG_BUILD_DIR)/res/res_agi.so $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules/
281 $(RSTRIP) $(IDIR_ASTERISK_RES_AGI)
282 $(IPKG_BUILD) $(IDIR_ASTERISK_RES_AGI) $(PACKAGE_DIR)