add asterisk-mini package,
[openwrt.git] / openwrt / package / asterisk / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=asterisk
6 PKG_VERSION:=1.0.10
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=f60f4c4edc36fa61dc55a5385fd82e71
9
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
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
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)))
32
33 ifneq ($(DEVELOPER),)
34 APPS:=app_sql_mysql.so app_sql_postgres.so
35 MODS:=cdr_mysql.so cdr_pgsql.so
36 SPEEX:=codec_speex.so
37 else
38 APPS:=
39 MODS:=
40 ifneq ($(BR2_PACKAGE_ASTERISK_MYSQL),)
41 APPS += app_sql_mysql.so
42 MODS += cdr_mysql.so
43 endif
44 ifneq ($(BR2_PACKAGE_ASTERISK_PGSQL),)
45 APPS += app_sql_postgres.so
46 MODS += cdr_pgsql.so
47 endif
48 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
49 SPEEX:=codec_speex.so
50 endif
51 endif
52
53 $(PKG_BUILD_DIR)/.configured:
54 touch $@
55
56 $(PKG_BUILD_DIR)/.built:
57 $(MAKE) -C "$(PKG_BUILD_DIR)/channels" \
58 CC="$(HOSTCC)" \
59 gentone
60 $(MAKE) -C "$(PKG_BUILD_DIR)" \
61 CC_FOR_BUILD="$(HOSTCC)" \
62 $(TARGET_CONFIGURE_OPTS) \
63 OPTIMIZE="$(TARGET_CFLAGS)" \
64 PROC="$(ARCH)" \
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)" \
70 MODSPEEX="$(SPEEX)"
71 $(MAKE) -C $(PKG_BUILD_DIR) \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 install samples
74 rm -f $(PKG_INSTALL_DIR)/etc/asterisk/*.old
75 touch $@
76
77 $(IPKG_ASTERISK):
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; \
85 rm -rf agi-bin; \
86 rm -rf images; \
87 rm -rf keys/*; \
88 rm -rf mohmp3/*.mp3; \
89 rm -rf sounds/*; \
90 cd modules; \
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 ; \
100 rm -f res_agi.so ; \
101 )
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* \
105 *zapata*; \
106 rm -f bluetooth.conf ; \
107 rm -f mgcp.conf ; \
108 rm -f skinny.conf ; \
109 rm -f dundi.conf ; \
110 )
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)
120
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/ ; \
125 done
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/ ; \
135 done
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)
148
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)
157
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)
166
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)
173
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)
184
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)
192
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)
200
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)
208
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)
215
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)
221
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)
227
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)
235
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)
242
This page took 0.056568 seconds and 5 git commands to generate.