3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=f60f4c4edc36fa61dc55a5385fd82e71
10 PKG_SOURCE_URL
:=http
://ftp.digium.com
/pub
/asterisk
/ ftp
://ftp.digium.com
/pub
/asterisk
/
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_VOICEMAIL
,asterisk-voicemail
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
23 $(eval
$(call PKG_template
,ASTERISK_SOUNDS
,asterisk-sounds
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
24 $(eval
$(call PKG_template
,ASTERISK_CHAN_BLUETOOTH
,asterisk-chan-bluetooth
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
25 $(eval
$(call PKG_template
,ASTERISK_CHAN_MGCP
,asterisk-chan-mgcp
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
26 $(eval
$(call PKG_template
,ASTERISK_CHAN_SKINNY
,asterisk-chan-skinny
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
27 $(eval
$(call PKG_template
,ASTERISK_CODEC_ILBC
,asterisk-codec-ilbc
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
28 $(eval
$(call PKG_template
,ASTERISK_CODEC_LPC10
,asterisk-codec-lpc10
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
29 $(eval
$(call PKG_template
,ASTERISK_CODEC_SPEEX
,asterisk-codec-speex
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
30 $(eval
$(call PKG_template
,ASTERISK_PBX_DUNDI
,asterisk-pbx-dundi
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
31 $(eval
$(call PKG_template
,ASTERISK_RES_AGI
,asterisk-res-agi
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
34 APPS
:=app_sql_mysql.so app_sql_postgres.so
35 MODS
:=cdr_mysql.so cdr_pgsql.so
40 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL
),)
41 APPS
+= app_sql_mysql.so
44 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL
),)
45 APPS
+= app_sql_postgres.so
48 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX
),)
53 $(PKG_BUILD_DIR
)/.configured
:
56 $(PKG_BUILD_DIR
)/.built
:
57 $(MAKE
) -C
"$(PKG_BUILD_DIR)/channels" \
60 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
61 CC_FOR_BUILD
="$(HOSTCC)" \
62 $(TARGET_CONFIGURE_OPTS
) \
63 OPTIMIZE
="$(TARGET_CFLAGS)" \
65 CFLAGS_EXTRA
="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/speex" \
66 LDFLAGS_EXTRA
="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/mysql" \
67 CRYPTO_LIBS
="-L$(STAGING_DIR)/usr/lib -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic" \
68 EXTRA_APPS
="$(APPS)" \
69 EXTRA_MODS
="$(MODS)" \
71 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
72 DESTDIR
="$(PKG_INSTALL_DIR)" \
74 rm -f
$(PKG_INSTALL_DIR
)/etc
/asterisk
/*.old
78 cp
-fpR
$(PKG_INSTALL_DIR
)/* $(IDIR_ASTERISK
)
79 rm -rf
$(IDIR_ASTERISK
)/usr
/sbin
/astgenkey
80 rm -rf
$(IDIR_ASTERISK
)/usr
/bin
81 rm -rf
$(IDIR_ASTERISK
)/usr
/share
82 rm -rf
$(IDIR_ASTERISK
)/usr
/include
83 rm -rf
$(IDIR_ASTERISK
)/var
84 (cd
$(IDIR_ASTERISK
)/usr
/lib
/asterisk
; \
88 rm -rf mohmp3
/*.mp3
; \
91 rm -rf
*adsi
* *festival
* *modem
* *meetme
* *oss
* *phone
* *intercom
* \
92 *mp3
* *nbscat
* *mysql
* *postgres
* *pgsql
* *voicemail
* *speex
* \
93 *zapateller
* *jpeg
*; \
94 rm -f chan_bluetooth.so
; \
95 rm -f chan_mgcp.so
; \
96 rm -f chan_skinny.so
; \
97 rm -f
{codec
,format
}_ilbc.so
; \
98 rm -f codec_lpc10.so
; \
99 rm -f pbx_dundi.so
; \
102 (cd
$(IDIR_ASTERISK
)/etc
/asterisk
; \
103 rm -f
*odbc
* *mysql
* *postgres
* *pgsql
* *voicemail
* *adsi
* *oss
* *alsa
* \
104 *festival
* *modem
* *meetme
* *phone
* *tds
* *vofr
* *rpt
* *vpb
* \
106 rm -f bluetooth.conf
; \
108 rm -f skinny.conf
; \
111 install -m0644 .
/files
/modules.conf
$(IDIR_ASTERISK
)/etc
/asterisk
/
112 $(SED
) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR
)/etc
/asterisk
/musiconhold.conf
113 install -d
-m0755
$(IDIR_ASTERISK
)/etc
/default
114 install -m0644 .
/files
/asterisk.default
$(IDIR_ASTERISK
)/etc
/default
/asterisk
115 install -d
-m0755
$(IDIR_ASTERISK
)/etc
/init.d
116 install -m0755 .
/files
/asterisk.init
$(IDIR_ASTERISK
)/etc
/init.d
/asterisk
117 ln
-sf asterisk
$(IDIR_ASTERISK
)/etc
/init.d
/S60asterisk
118 $(RSTRIP
) $(IDIR_ASTERISK
)
119 $(IPKG_BUILD
) $(IDIR_ASTERISK
) $(PACKAGE_DIR
)
121 $(IPKG_ASTERISK_MINI
):
122 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/etc
/asterisk
123 for f in asterisk enum extconfig extensions features iax iaxprov logger manager modules musiconhold rtp sip
; do \
124 cp
-fpR
$(PKG_INSTALL_DIR
)/etc
/asterisk
/$$f.conf
$(IDIR_ASTERISK_MINI
)/etc
/asterisk
/ ; \
126 install -m0644 .
/files
/modules.conf
$(IDIR_ASTERISK
)/etc
/asterisk
/
127 $(SED
) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR
)/etc
/asterisk
/musiconhold.conf
128 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
129 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/lib
/asterisk
/firmware
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/
130 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/keys
131 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/modules
132 for f in chan_iax2 chan_local chan_sip codec_gsm codec_ulaw format_gsm format_pcm format_wav \
133 format_wav_gsm pbx_config res_features res_musiconhold
; do \
134 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/lib
/asterisk
/modules
/$$f.so
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/modules
/ ; \
136 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/mohmp3
137 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/lib
/asterisk
/sounds
138 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/usr
/sbin
139 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/sbin
/asterisk
$(IDIR_ASTERISK_MINI
)/usr
/sbin
/
140 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/sbin
/safe_asterisk
$(IDIR_ASTERISK_MINI
)/usr
/sbin
/
141 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/etc
/default
142 install -m0644 .
/files
/asterisk.default
$(IDIR_ASTERISK_MINI
)/etc
/default
/asterisk
143 install -d
-m0755
$(IDIR_ASTERISK_MINI
)/etc
/init.d
144 install -m0755 .
/files
/asterisk.init
$(IDIR_ASTERISK_MINI
)/etc
/init.d
/asterisk
145 ln
-sf asterisk
$(IDIR_ASTERISK_MINI
)/etc
/init.d
/S60asterisk
146 $(RSTRIP
) $(IDIR_ASTERISK_MINI
)
147 $(IPKG_BUILD
) $(IDIR_ASTERISK_MINI
) $(PACKAGE_DIR
)
149 $(IPKG_ASTERISK_MYSQL
):
150 install -d
-m0755
$(IDIR_ASTERISK_MYSQL
)/etc
/asterisk
151 install -m0600
$(PKG_BUILD_DIR
)/configs
/cdr_mysql.conf.sample
$(IDIR_ASTERISK_MYSQL
)/etc
/asterisk
/cdr_mysql.conf
152 install -d
-m0755
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
153 install -m0755
$(PKG_BUILD_DIR
)/apps
/app_sql_mysql.so
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
/
154 install -m0755
$(PKG_BUILD_DIR
)/cdr
/cdr_mysql.so
$(IDIR_ASTERISK_MYSQL
)/usr
/lib
/asterisk
/modules
/
155 $(RSTRIP
) $(IDIR_ASTERISK_MYSQL
)
156 $(IPKG_BUILD
) $(IDIR_ASTERISK_MYSQL
) $(PACKAGE_DIR
)
158 $(IPKG_ASTERISK_PGSQL
):
159 install -d
-m0755
$(IDIR_ASTERISK_PGSQL
)/etc
/asterisk
160 install -m0600
$(PKG_BUILD_DIR
)/configs
/cdr_pgsql.conf.sample
$(IDIR_ASTERISK_PGSQL
)/etc
/asterisk
/cdr_pgsql.conf
161 install -d
-m0755
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
162 install -m0755
$(PKG_BUILD_DIR
)/apps
/app_sql_postgres.so
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
/
163 install -m0755
$(PKG_BUILD_DIR
)/cdr
/cdr_pgsql.so
$(IDIR_ASTERISK_PGSQL
)/usr
/lib
/asterisk
/modules
/
164 $(RSTRIP
) $(IDIR_ASTERISK_PGSQL
)
165 $(IPKG_BUILD
) $(IDIR_ASTERISK_PGSQL
) $(PACKAGE_DIR
)
167 $(IPKG_ASTERISK_SOUNDS
):
168 install -d
-m0755
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
169 cp
-fpR
$(PKG_BUILD_DIR
)/sounds
/* $(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/
170 rm -f
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/*.mp3
171 rm -f
$(IDIR_ASTERISK_SOUNDS
)/usr
/lib
/asterisk
/sounds
/vm-
*
172 $(IPKG_BUILD
) $(IDIR_ASTERISK_SOUNDS
) $(PACKAGE_DIR
)
174 $(IPKG_ASTERISK_VOICEMAIL
):
175 install -d
-m0755
$(IDIR_ASTERISK_VOICEMAIL
)/etc
/asterisk
176 install -m0644
$(PKG_BUILD_DIR
)/configs
/voicemail.conf.sample
$(IDIR_ASTERISK_VOICEMAIL
)/etc
/asterisk
/voicemail.conf
177 install -d
-m0755
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
178 install -m0755
$(PKG_BUILD_DIR
)/apps
/*voicemail.so
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
/
179 install -m0755
$(PKG_BUILD_DIR
)/res
/res_adsi.so
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/modules
/
180 install -d
-m0755
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/sounds
181 cp
-fpR
$(PKG_BUILD_DIR
)/sounds
/vm-
*.gsm
$(IDIR_ASTERISK_VOICEMAIL
)/usr
/lib
/asterisk
/sounds
/
182 $(RSTRIP
) $(IDIR_ASTERISK_VOICEMAIL
)
183 $(IPKG_BUILD
) $(IDIR_ASTERISK_VOICEMAIL
) $(PACKAGE_DIR
)
185 $(IPKG_ASTERISK_CHAN_BLUETOOTH
):
186 install -d
-m0755
$(IDIR_ASTERISK_CHAN_BLUETOOTH
)/etc
/asterisk
187 install -m0644
$(PKG_BUILD_DIR
)/configs
/bluetooth.conf
$(IDIR_ASTERISK_CHAN_BLUETOOTH
)/etc
/asterisk
/bluetooth.conf
188 install -d
-m0755
$(IDIR_ASTERISK_CHAN_BLUETOOTH
)/usr
/lib
/asterisk
/modules
189 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_bluetooth.so
$(IDIR_ASTERISK_CHAN_BLUETOOTH
)/usr
/lib
/asterisk
/modules
/
190 $(RSTRIP
) $(IDIR_ASTERISK_CHAN_BLUETOOTH
)
191 $(IPKG_BUILD
) $(IDIR_ASTERISK_CHAN_BLUETOOTH
) $(PACKAGE_DIR
)
193 $(IPKG_ASTERISK_CHAN_MGCP
):
194 install -d
-m0755
$(IDIR_ASTERISK_CHAN_MGCP
)/etc
/asterisk
195 install -m0644
$(PKG_BUILD_DIR
)/configs
/mgcp.conf.sample
$(IDIR_ASTERISK_CHAN_MGCP
)/etc
/asterisk
/mgcp.conf
196 install -d
-m0755
$(IDIR_ASTERISK_CHAN_MGCP
)/usr
/lib
/asterisk
/modules
197 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_mgcp.so
$(IDIR_ASTERISK_CHAN_MGCP
)/usr
/lib
/asterisk
/modules
/
198 $(RSTRIP
) $(IDIR_ASTERISK_CHAN_MGCP
)
199 $(IPKG_BUILD
) $(IDIR_ASTERISK_CHAN_MGCP
) $(PACKAGE_DIR
)
201 $(IPKG_ASTERISK_CHAN_SKINNY
):
202 install -d
-m0755
$(IDIR_ASTERISK_CHAN_SKINNY
)/etc
/asterisk
203 install -m0644
$(PKG_BUILD_DIR
)/configs
/skinny.conf.sample
$(IDIR_ASTERISK_CHAN_SKINNY
)/etc
/asterisk
/skinny.conf
204 install -d
-m0755
$(IDIR_ASTERISK_CHAN_SKINNY
)/usr
/lib
/asterisk
/modules
205 install -m0755
$(PKG_BUILD_DIR
)/channels
/chan_skinny.so
$(IDIR_ASTERISK_CHAN_SKINNY
)/usr
/lib
/asterisk
/modules
/
206 $(RSTRIP
) $(IDIR_ASTERISK_CHAN_SKINNY
)
207 $(IPKG_BUILD
) $(IDIR_ASTERISK_CHAN_SKINNY
) $(PACKAGE_DIR
)
209 $(IPKG_ASTERISK_CODEC_ILBC
):
210 install -d
-m0755
$(IDIR_ASTERISK_CODEC_ILBC
)/usr
/lib
/asterisk
/modules
211 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_ilbc.so
$(IDIR_ASTERISK_CODEC_ILBC
)/usr
/lib
/asterisk
/modules
/
212 install -m0755
$(PKG_BUILD_DIR
)/formats
/format_ilbc.so
$(IDIR_ASTERISK_CODEC_ILBC
)/usr
/lib
/asterisk
/modules
/
213 $(RSTRIP
) $(IDIR_ASTERISK_CODEC_ILBC
)
214 $(IPKG_BUILD
) $(IDIR_ASTERISK_CODEC_ILBC
) $(PACKAGE_DIR
)
216 $(IPKG_ASTERISK_CODEC_LPC10
):
217 install -d
-m0755
$(IDIR_ASTERISK_CODEC_LPC10
)/usr
/lib
/asterisk
/modules
218 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_lpc10.so
$(IDIR_ASTERISK_CODEC_LPC10
)/usr
/lib
/asterisk
/modules
/
219 $(RSTRIP
) $(IDIR_ASTERISK_CODEC_LPC10
)
220 $(IPKG_BUILD
) $(IDIR_ASTERISK_CODEC_LPC10
) $(PACKAGE_DIR
)
222 $(IPKG_ASTERISK_CODEC_SPEEX
):
223 install -d
-m0755
$(IDIR_ASTERISK_CODEC_SPEEX
)/usr
/lib
/asterisk
/modules
224 install -m0755
$(PKG_BUILD_DIR
)/codecs
/codec_speex.so
$(IDIR_ASTERISK_CODEC_SPEEX
)/usr
/lib
/asterisk
/modules
/
225 $(RSTRIP
) $(IDIR_ASTERISK_CODEC_SPEEX
)
226 $(IPKG_BUILD
) $(IDIR_ASTERISK_CODEC_SPEEX
) $(PACKAGE_DIR
)
228 $(IPKG_ASTERISK_PBX_DUNDI
):
229 install -d
-m0755
$(IDIR_ASTERISK_PBX_DUNDI
)/etc
/asterisk
230 install -m0644
$(PKG_BUILD_DIR
)/configs
/dundi.conf.sample
$(IDIR_ASTERISK_PBX_DUNDI
)/etc
/asterisk
/dundi.conf
231 install -d
-m0755
$(IDIR_ASTERISK_PBX_DUNDI
)/usr
/lib
/asterisk
/modules
232 install -m0755
$(PKG_BUILD_DIR
)/pbx
/pbx_dundi.so
$(IDIR_ASTERISK_PBX_DUNDI
)/usr
/lib
/asterisk
/modules
/
233 $(RSTRIP
) $(IDIR_ASTERISK_PBX_DUNDI
)
234 $(IPKG_BUILD
) $(IDIR_ASTERISK_PBX_DUNDI
) $(PACKAGE_DIR
)
236 $(IPKG_ASTERISK_RES_AGI
):
237 install -d
-m0755
$(IDIR_ASTERISK_RES_AGI
)/usr
/lib
/asterisk
/agi-bin
238 install -d
-m0755
$(IDIR_ASTERISK_RES_AGI
)/usr
/lib
/asterisk
/modules
239 install -m0755
$(PKG_BUILD_DIR
)/res
/res_agi.so
$(IDIR_ASTERISK_RES_AGI
)/usr
/lib
/asterisk
/modules
/
240 $(RSTRIP
) $(IDIR_ASTERISK_RES_AGI
)
241 $(IPKG_BUILD
) $(IDIR_ASTERISK_RES_AGI
) $(PACKAGE_DIR
)