bb3cc439d01a2159659061984a43a28c1dc527c6
[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.6
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:=f068ef2433eebdc7f6dd635986f36d77
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 MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
26 endef
27
28 define Package/asterisk16/Default/description
29 Asterisk is a complete PBX in software. It provides all of the features
30 you would expect from a PBX and more. Asterisk does voice over IP in three
31 protocols, and can interoperate with almost all standards-based telephony
32 equipment using relatively inexpensive hardware.
33 endef
34
35
36 define Package/asterisk16
37 $(call Package/asterisk16/Default)
38 TITLE:=Complete open source PBX
39 DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 @!PACKAGE_asterisk14
40 endef
41
42 define Package/asterisk16/description
43 $(call Package/asterisk16/Default/description)
44 endef
45
46 define Package/asterisk16-sounds
47 $(call Package/asterisk16/Default)
48 TITLE:=Sound files
49 DEPENDS:= +asterisk16
50 endef
51
52 define Package/asterisk16-sounds/description
53 $(call Package/asterisk16/Default/description)
54 This package contains sound files for Asterisk.
55 endef
56
57
58 define Package/asterisk16-voicemail
59 $(call Package/asterisk16/Default)
60 TITLE:=Voicemail support
61 DEPENDS:= +asterisk16
62 endef
63
64 define Package/asterisk16-voicemail/description
65 $(call Package/asterisk16/Default/description)
66 This package contains voicemail related modules for Asterisk.
67 endef
68
69 define Package/asterisk16-app-meetme
70 $(call Package/asterisk16/Default)
71 TITLE:=conferencing support
72 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
73 endef
74
75 define Package/asterisk16-app-meetme/description
76 $(call Package/asterisk16/Default/description)
77 This package provides the MeetMe application driver Conferencing support to
78 Asterisk.
79 endef
80
81 define Package/asterisk16-chan-iax2
82 $(call Package/asterisk16/Default)
83 TITLE:=IAX support
84 DEPENDS:= +asterisk16
85 endef
86
87 define Package/asterisk16-chan-iax2/description
88 $(call Package/asterisk16/Default/description)
89 This package provides IAX support to
90 Asterisk.
91 endef
92
93 define Package/asterisk16-chan-local
94 $(call Package/asterisk16/Default)
95 TITLE:=chan_local support
96 DEPENDS:= +asterisk16
97 endef
98
99 define Package/asterisk16-chan-local/description
100 $(call Package/asterisk16/Default/description)
101 This package provides chan_local support to
102 Asterisk.
103 endef
104
105 define Package/asterisk16-cdr
106 $(call Package/asterisk16/Default)
107 TITLE:=CDR support
108 DEPENDS:= +asterisk16
109 endef
110
111 define Package/asterisk16-cdr/description
112 $(call Package/asterisk16/Default/description)
113 This package provides Call Detail Record support to
114 Asterisk.
115 endef
116
117 define Package/asterisk16-res-musiconhold
118 $(call Package/asterisk16/Default)
119 TITLE:=MOH support
120 DEPENDS:= +asterisk16
121 endef
122
123 define Package/asterisk16-res-musiconhold/description
124 $(call Package/asterisk16/Default/description)
125 This package provides Music On Hold support to
126 Asterisk.
127 endef
128
129 define Package/asterisk16-format-g729
130 $(call Package/asterisk16/Default)
131 TITLE:=G.729 support
132 DEPENDS:= +asterisk16
133 endef
134
135 define Package/asterisk16-format-g729/description
136 $(call Package/asterisk16/Default/description)
137 This package provides G.729 support to
138 Asterisk.
139 endef
140
141 define Package/asterisk16-chan-gtalk
142 $(call Package/asterisk16/Default)
143 TITLE:=GTalk support
144 DEPENDS:= +asterisk16 +libiksemel
145 endef
146
147 define Package/asterisk16-chan-gtalk/description
148 $(call Package/asterisk16/Default/description)
149 This package provides the channel chan_gtalk and res_jabber for GTalk
150 support to Asterisk.
151 endef
152
153 define Package/asterisk16-app-system
154 $(call Package/asterisk16/Default)
155 TITLE:=System exec support
156 DEPENDS:= +asterisk16
157 endef
158
159 define Package/asterisk16-app-system/description
160 $(call Package/asterisk16/Default/description)
161 This package provides support for executing system commands in Asterisk.
162 endef
163
164 CONFIGURE_ARGS+= \
165 --without-curl \
166 --without-curses \
167 --with-gsm=internal \
168 --without-gtk \
169 --without-gtk2 \
170 --without-isdnnet \
171 --without-kde \
172 --without-misdn \
173 --without-nbs \
174 --with-ncurses="$(STAGING_DIR)/usr" \
175 --without-netsnmp \
176 --without-newt \
177 --without-odbc \
178 --without-ogg \
179 --without-osptk \
180 --with-popt="$(STAGING_DIR)/usr" \
181 --without-pri \
182 --without-qt \
183 --without-radius \
184 --without-sdl \
185 --without-spandsp \
186 --without-suppserv \
187 --without-tds \
188 --without-termcap \
189 --without-tinfo \
190 --without-vorbis \
191 --without-vpb \
192 --with-z="$(STAGING_DIR)/usr" \
193 --disable-xmldoc \
194
195 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
196 CONFIGURE_ARGS+= \
197 --with-dahdi="$(STAGING_DIR)/usr"
198 else
199 CONFIGURE_ARGS+= \
200 --without-dahdi
201 endif
202
203 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
204 CONFIGURE_ARGS+= \
205 --with-gnutls="$(STAGING_DIR)/usr" \
206 --with-iksemel="$(STAGING_DIR)/usr"
207 SITE_VARS+= \
208 ac_cv_lib_iksemel_iks_start_sasl=yes \
209 ac_cv_lib_gnutls_gnutls_bye=yes
210 else
211 CONFIGURE_ARGS+= \
212 --without-gnutls \
213 --without-iksemel
214 endif
215
216 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
217 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
218
219 define Build/Configure
220 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
221 $(call Build/Configure/Default,,$(SITE_VARS))
222 endef
223
224 define Build/Compile
225 $(MAKE) -C "$(PKG_BUILD_DIR)" \
226 include/asterisk/version.h \
227 include/asterisk/buildopts.h defaults.h \
228 makeopts.embed_rules
229 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
230 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
231 $(MAKE) -C "$(PKG_BUILD_DIR)" \
232 ASTVARLIBDIR="/usr/lib/asterisk" \
233 NOISY_BUILD="1" \
234 DEBUG="" \
235 OPTIMIZE="" \
236 DESTDIR="$(PKG_INSTALL_DIR)" \
237 all install samples
238 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
239 endef
240
241 #define Build/InstallDev
242 # $(INSTALL_DIR) $(1)/usr/include/asterisk/
243 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
244 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
245 #endef
246
247 define Package/asterisk16/conffiles
248 /etc/asterisk/asterisk.conf
249 /etc/asterisk/modules.conf
250 /etc/asterisk/extensions.conf
251 /etc/asterisk/sip.conf
252 /etc/asterisk/sip_notify.conf
253 /etc/asterisk/features.conf
254 /etc/asterisk/indications.conf
255 /etc/asterisk/logger.conf
256 /etc/asterisk/manager.conf
257 /etc/asterisk/rtp.conf
258 /etc/default/asterisk
259 /etc/init.d/asterisk
260 endef
261
262 define Package/asterisk16/install
263 $(INSTALL_DIR) $(1)/etc/asterisk
264 for f in asterisk extensions features \
265 indications logger manager modules \
266 sip sip_notify rtp; do \
267 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
268 done
269 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
270 for f in app_dial app_echo app_playback app_macro \
271 chan_sip \
272 codec_ulaw codec_gsm \
273 format_gsm format_pcm format_wav format_wav_gsm \
274 pbx_config \
275 func_strings func_timeout func_callerid; do \
276 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
277 done
278 $(INSTALL_DIR) $(1)/usr/sbin
279 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
280 $(INSTALL_DIR) $(1)/etc/default
281 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
282 $(INSTALL_DIR) $(1)/etc/init.d
283 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
284 endef
285
286 define Package/asterisk16-sounds/install
287 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
288 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
289 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
290 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
291 endef
292
293
294 define Package/asterisk16-voicemail/conffiles
295 /etc/asterisk/voicemail.conf
296 endef
297
298 define Package/asterisk16-voicemail/install
299 $(INSTALL_DIR) $(1)/etc/asterisk
300 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
301 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
302 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
303 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
304 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
305 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
306 endef
307
308 define Package/asterisk16-app-meetme/conffiles
309 /etc/asterisk/meetme.conf
310 endef
311
312 define Package/asterisk16-app-meetme/install
313 $(INSTALL_DIR) $(1)/etc/asterisk
314 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
315 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
316 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
317 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
318 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
319 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
320 endef
321
322 define Package/asterisk16-chan-iax2/conffiles
323 /etc/asterisk/iax.conf
324 /etc/asterisk/iaxprov.conf
325 endef
326
327 define Package/asterisk16-cdr/conffiles
328 /etc/asterisk/cdr.conf
329 /etc/asterisk/cdr_custom.conf
330 /etc/asterisk/cdr_manager.conf
331 /etc/asterisk/cdr_odbc.conf
332 /etc/asterisk/cdr_pgsql.conf
333 /etc/asterisk/cdr_tds.conf
334 endef
335
336 define Package/asterisk16-res-musiconhold/conffiles
337 /etc/asterisk/musiconhold.conf
338 endef
339
340 define Package/asterisk16-chan-iax2/install
341 $(INSTALL_DIR) $(1)/etc/asterisk
342 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
343 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
344 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
345 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
346 endef
347
348 define Package/asterisk16-chan-local/install
349 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
350 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_local.so $(1)/usr/lib/asterisk/modules/
351 endef
352
353 define Package/asterisk16-cdr/install
354 $(INSTALL_DIR) $(1)/etc/asterisk
355 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
356 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
357 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
358 endef
359
360 define Package/asterisk16-res-musiconhold/install
361 $(INSTALL_DIR) $(1)/etc/asterisk
362 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
363 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
364 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
365 endef
366
367 define Package/asterisk16-format-g729/install
368 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
369 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_g729.so $(1)/usr/lib/asterisk/modules/
370 endef
371
372 define Package/asterisk16-chan-gtalk/conffiles
373 /etc/asterisk/gtalk.conf
374 /etc/asterisk/jabber.conf
375 endef
376
377 define Package/asterisk16-chan-gtalk/install
378 $(INSTALL_DIR) $(1)/etc/asterisk
379 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
380 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
381 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
382 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
383 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
384 endef
385
386 define Package/asterisk16-app-system/install
387 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
388 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_system.so $(1)/usr/lib/asterisk/modules/
389 endef
390
391 $(eval $(call BuildPackage,asterisk16))
392 $(eval $(call BuildPackage,asterisk16-voicemail))
393 $(eval $(call BuildPackage,asterisk16-sounds))
394 #$(eval $(call BuildPackage,asterisk16-app-meetme))
395 $(eval $(call BuildPackage,asterisk16-chan-iax2))
396 $(eval $(call BuildPackage,asterisk16-chan-local))
397 $(eval $(call BuildPackage,asterisk16-cdr))
398 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
399 $(eval $(call BuildPackage,asterisk16-format-g729))
400 $(eval $(call BuildPackage,asterisk16-chan-gtalk))
401 $(eval $(call BuildPackage,asterisk16-app-system))