update asterisk-1.6.x to 1.6.2.0-beta4; add chan_gtalk
[openwrt/svn-archive/archive.git] / net / asterisk-1.6.x / Makefile
1 #
2 # Copyright (C) 2008-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=asterisk
11 PKG_VERSION:=1.6.2.0-beta4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=a1f658207ed618056294e04d69077509
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/asterisk16/Default
21 SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
22 SECTION:=net
23 CATEGORY:=Network
24 URL:=http://www.asterisk.org/
25 endef
26
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.
32 endef
33
34
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
39 endef
40
41 define Package/asterisk16/description
42 $(call Package/asterisk16/Default/description)
43 endef
44
45 define Package/asterisk16-sounds
46 $(call Package/asterisk16/Default)
47 TITLE:=Sound files
48 DEPENDS:= +asterisk16
49 endef
50
51 define Package/asterisk16-sounds/description
52 $(call Package/asterisk16/Default/description)
53 This package contains sound files for Asterisk.
54 endef
55
56
57 define Package/asterisk16-voicemail
58 $(call Package/asterisk16/Default)
59 TITLE:=Voicemail support
60 DEPENDS:= +asterisk16
61 endef
62
63 define Package/asterisk16-voicemail/description
64 $(call Package/asterisk16/Default/description)
65 This package contains voicemail related modules for Asterisk.
66 endef
67
68 define Package/asterisk16-app-meetme
69 $(call Package/asterisk16/Default)
70 TITLE:=conferencing support
71 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
72 endef
73
74 define Package/asterisk16-app-meetme/description
75 $(call Package/asterisk16/Default/description)
76 This package provides the MeetMe application driver Conferencing support to
77 Asterisk.
78 endef
79
80 define Package/asterisk16-chan-iax2
81 $(call Package/asterisk16/Default)
82 TITLE:=IAX support
83 DEPENDS:= +asterisk16
84 endef
85
86 define Package/asterisk16-chan-iax2/description
87 $(call Package/asterisk16/Default/description)
88 This package provides IAX support to
89 Asterisk.
90 endef
91
92 define Package/asterisk16-chan-local
93 $(call Package/asterisk16/Default)
94 TITLE:=chan_local support
95 DEPENDS:= +asterisk16
96 endef
97
98 define Package/asterisk16-chan-local/description
99 $(call Package/asterisk16/Default/description)
100 This package provides chan_local support to
101 Asterisk.
102 endef
103
104 define Package/asterisk16-cdr
105 $(call Package/asterisk16/Default)
106 TITLE:=CDR support
107 DEPENDS:= +asterisk16
108 endef
109
110 define Package/asterisk16-cdr/description
111 $(call Package/asterisk16/Default/description)
112 This package provides Call Detail Record support to
113 Asterisk.
114 endef
115
116 define Package/asterisk16-res-musiconhold
117 $(call Package/asterisk16/Default)
118 TITLE:=MOH support
119 DEPENDS:= +asterisk16
120 endef
121
122 define Package/asterisk16-res-musiconhold/description
123 $(call Package/asterisk16/Default/description)
124 This package provides Music On Hold support to
125 Asterisk.
126 endef
127
128 define Package/asterisk16-format-g729
129 $(call Package/asterisk16/Default)
130 TITLE:=G.729 support
131 DEPENDS:= +asterisk16
132 endef
133
134 define Package/asterisk16-format-g729/description
135 $(call Package/asterisk16/Default/description)
136 This package provides G.729 support to
137 Asterisk.
138 endef
139
140 define Package/asterisk16-chan-gtalk
141 $(call Package/asterisk16/Default)
142 TITLE:=GTalk support
143 DEPENDS:= +asterisk16 +libiksemel
144 endef
145
146 define Package/asterisk16-chan-gtalk/description
147 $(call Package/asterisk16/Default/description)
148 This package provides the channel chan_gtalk and res_jabber for GTalk
149 support to Asterisk.
150 endef
151
152 CONFIGURE_ARGS+= \
153 --without-curl \
154 --without-curses \
155 --with-gsm=internal \
156 --without-gtk \
157 --without-gtk2 \
158 --without-isdnnet \
159 --without-kde \
160 --without-misdn \
161 --without-nbs \
162 --with-ncurses="$(STAGING_DIR)/usr" \
163 --without-netsnmp \
164 --without-newt \
165 --without-odbc \
166 --without-ogg \
167 --without-osptk \
168 --with-popt="$(STAGING_DIR)/usr" \
169 --without-pri \
170 --without-qt \
171 --without-radius \
172 --without-sdl \
173 --without-spandsp \
174 --without-suppserv \
175 --without-tds \
176 --without-termcap \
177 --without-tinfo \
178 --without-vorbis \
179 --without-vpb \
180 --with-z="$(STAGING_DIR)/usr" \
181 --disable-xmldoc \
182
183 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
184 CONFIGURE_ARGS+= \
185 --with-dahdi="$(STAGING_DIR)/usr"
186 else
187 CONFIGURE_ARGS+= \
188 --without-dahdi
189 endif
190
191 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
192 CONFIGURE_ARGS+= \
193 --with-gnutls="$(STAGING_DIR)/usr" \
194 --with-iksemel="$(STAGING_DIR)/usr"
195 SITE_VARS+= \
196 ac_cv_lib_iksemel_iks_start_sasl=yes \
197 ac_cv_lib_gnutls_gnutls_bye=yes
198 else
199 CONFIGURE_ARGS+= \
200 --without-gnutls \
201 --without-iksemel
202 endif
203
204 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
205 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
206
207 define Build/Configure
208 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
209 $(call Build/Configure/Default,,$(SITE_VARS))
210 endef
211
212 define Build/Compile
213 $(MAKE) -C "$(PKG_BUILD_DIR)" \
214 include/asterisk/version.h \
215 include/asterisk/buildopts.h defaults.h \
216 makeopts.embed_rules
217 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
218 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
219 $(MAKE) -C "$(PKG_BUILD_DIR)" \
220 ASTVARLIBDIR="/usr/lib/asterisk" \
221 NOISY_BUILD="1" \
222 DEBUG="" \
223 OPTIMIZE="" \
224 DESTDIR="$(PKG_INSTALL_DIR)" \
225 all install samples
226 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
227 endef
228
229 #define Build/InstallDev
230 # mkdir -p $(1)/usr/include/asterisk/
231 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
232 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
233 #endef
234
235 define Package/asterisk16/conffiles
236 /etc/asterisk/asterisk.conf
237 /etc/asterisk/modules.conf
238 /etc/asterisk/extensions.conf
239 /etc/asterisk/sip.conf
240 /etc/asterisk/sip_notify.conf
241 /etc/asterisk/features.conf
242 /etc/asterisk/logger.conf
243 /etc/asterisk/manager.conf
244 /etc/asterisk/rtp.conf
245 /etc/default/asterisk
246 /etc/init.d/asterisk
247 endef
248
249 define Package/asterisk16/install
250 $(INSTALL_DIR) $(1)/etc/asterisk
251 for f in asterisk extensions features \
252 logger manager modules \
253 sip sip_notify rtp; do \
254 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
255 done
256 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
257 for f in app_dial app_echo app_playback app_macro \
258 chan_sip \
259 codec_ulaw codec_gsm \
260 format_gsm format_pcm format_wav format_wav_gsm \
261 pbx_config \
262 func_strings func_timeout func_callerid; do \
263 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
264 done
265 $(INSTALL_DIR) $(1)/usr/sbin
266 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
267 $(INSTALL_DIR) $(1)/etc/default
268 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
269 $(INSTALL_DIR) $(1)/etc/init.d
270 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
271 endef
272
273 define Package/asterisk16-sounds/install
274 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
275 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
276 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
277 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
278 endef
279
280
281 define Package/asterisk16-voicemail/conffiles
282 /etc/asterisk/voicemail.conf
283 endef
284
285 define Package/asterisk16-voicemail/install
286 $(INSTALL_DIR) $(1)/etc/asterisk
287 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
288 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
289 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
290 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
291 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
292 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
293 endef
294
295 define Package/asterisk16-app-meetme/conffiles
296 /etc/asterisk/meetme.conf
297 endef
298
299 define Package/asterisk16-app-meetme/install
300 $(INSTALL_DIR) $(1)/etc/asterisk
301 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
302 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
303 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
304 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
305 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
306 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
307 endef
308
309 define Package/asterisk16-chan-iax2/conffiles
310 /etc/asterisk/iax.conf
311 /etc/asterisk/iaxprov.conf
312 endef
313
314 define Package/asterisk16-cdr/conffiles
315 /etc/asterisk/cdr.conf
316 /etc/asterisk/cdr_custom.conf
317 /etc/asterisk/cdr_manager.conf
318 /etc/asterisk/cdr_odbc.conf
319 /etc/asterisk/cdr_pgsql.conf
320 /etc/asterisk/cdr_tds.conf
321 endef
322
323 define Package/asterisk16-res-musiconhold/conffiles
324 /etc/asterisk/musiconhold.conf
325 endef
326
327 define Package/asterisk16-chan-iax2/install
328 $(INSTALL_DIR) $(1)/etc/asterisk
329 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
330 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
331 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
332 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
333 endef
334
335 define Package/asterisk16-chan-local/install
336 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
337 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_local.so $(1)/usr/lib/asterisk/modules/
338 endef
339
340 define Package/asterisk16-cdr/install
341 $(INSTALL_DIR) $(1)/etc/asterisk
342 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
343 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
344 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
345 endef
346
347 define Package/asterisk16-res-musiconhold/install
348 $(INSTALL_DIR) $(1)/etc/asterisk
349 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
350 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
351 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
352 endef
353
354 define Package/asterisk16-format-g729/install
355 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
356 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_g729.so $(1)/usr/lib/asterisk/modules/
357 endef
358
359 define Package/asterisk16-chan-gtalk/conffiles
360 /etc/asterisk/gtalk.conf
361 /etc/asterisk/jabber.conf
362 endef
363
364 define Package/asterisk16-chan-gtalk/install
365 $(INSTALL_DIR) $(1)/etc/asterisk
366 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
367 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
368 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
369 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
370 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
371 endef
372
373 $(eval $(call BuildPackage,asterisk16))
374 $(eval $(call BuildPackage,asterisk16-voicemail))
375 $(eval $(call BuildPackage,asterisk16-sounds))
376 #$(eval $(call BuildPackage,asterisk16-app-meetme))
377 $(eval $(call BuildPackage,asterisk16-chan-iax2))
378 $(eval $(call BuildPackage,asterisk16-chan-local))
379 $(eval $(call BuildPackage,asterisk16-cdr))
380 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
381 $(eval $(call BuildPackage,asterisk16-format-g729))
382 $(eval $(call BuildPackage,asterisk16-chan-gtalk))