971c1dc4591133e33b5d0fcc6467526e2f955cd4
[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 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 define Package/asterisk16-app-system
153 $(call Package/asterisk16/Default)
154 TITLE:=System exec support
155 DEPENDS:= +asterisk16
156 endef
157
158 define Package/asterisk16-app-system/description
159 $(call Package/asterisk16/Default/description)
160 This package provides support for executing system commands in Asterisk.
161 endef
162
163 CONFIGURE_ARGS+= \
164 --without-curl \
165 --without-curses \
166 --with-gsm=internal \
167 --without-gtk \
168 --without-gtk2 \
169 --without-isdnnet \
170 --without-kde \
171 --without-misdn \
172 --without-nbs \
173 --with-ncurses="$(STAGING_DIR)/usr" \
174 --without-netsnmp \
175 --without-newt \
176 --without-odbc \
177 --without-ogg \
178 --without-osptk \
179 --with-popt="$(STAGING_DIR)/usr" \
180 --without-pri \
181 --without-qt \
182 --without-radius \
183 --without-sdl \
184 --without-spandsp \
185 --without-suppserv \
186 --without-tds \
187 --without-termcap \
188 --without-tinfo \
189 --without-vorbis \
190 --without-vpb \
191 --with-z="$(STAGING_DIR)/usr" \
192 --disable-xmldoc \
193
194 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
195 CONFIGURE_ARGS+= \
196 --with-dahdi="$(STAGING_DIR)/usr"
197 else
198 CONFIGURE_ARGS+= \
199 --without-dahdi
200 endif
201
202 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
203 CONFIGURE_ARGS+= \
204 --with-gnutls="$(STAGING_DIR)/usr" \
205 --with-iksemel="$(STAGING_DIR)/usr"
206 SITE_VARS+= \
207 ac_cv_lib_iksemel_iks_start_sasl=yes \
208 ac_cv_lib_gnutls_gnutls_bye=yes
209 else
210 CONFIGURE_ARGS+= \
211 --without-gnutls \
212 --without-iksemel
213 endif
214
215 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
216 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
217
218 define Build/Configure
219 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
220 $(call Build/Configure/Default,,$(SITE_VARS))
221 endef
222
223 define Build/Compile
224 $(MAKE) -C "$(PKG_BUILD_DIR)" \
225 include/asterisk/version.h \
226 include/asterisk/buildopts.h defaults.h \
227 makeopts.embed_rules
228 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
229 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
230 $(MAKE) -C "$(PKG_BUILD_DIR)" \
231 ASTVARLIBDIR="/usr/lib/asterisk" \
232 NOISY_BUILD="1" \
233 DEBUG="" \
234 OPTIMIZE="" \
235 DESTDIR="$(PKG_INSTALL_DIR)" \
236 all install samples
237 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
238 endef
239
240 #define Build/InstallDev
241 # $(INSTALL_DIR) $(1)/usr/include/asterisk/
242 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
243 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
244 #endef
245
246 define Package/asterisk16/conffiles
247 /etc/asterisk/asterisk.conf
248 /etc/asterisk/modules.conf
249 /etc/asterisk/extensions.conf
250 /etc/asterisk/sip.conf
251 /etc/asterisk/sip_notify.conf
252 /etc/asterisk/features.conf
253 /etc/asterisk/indications.conf
254 /etc/asterisk/logger.conf
255 /etc/asterisk/manager.conf
256 /etc/asterisk/rtp.conf
257 /etc/default/asterisk
258 /etc/init.d/asterisk
259 endef
260
261 define Package/asterisk16/install
262 $(INSTALL_DIR) $(1)/etc/asterisk
263 for f in asterisk extensions features \
264 indications logger manager modules \
265 sip sip_notify rtp; do \
266 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
267 done
268 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
269 for f in app_dial app_echo app_playback app_macro \
270 chan_sip \
271 codec_ulaw codec_gsm \
272 format_gsm format_pcm format_wav format_wav_gsm \
273 pbx_config \
274 func_strings func_timeout func_callerid; do \
275 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
276 done
277 $(INSTALL_DIR) $(1)/usr/sbin
278 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
279 $(INSTALL_DIR) $(1)/etc/default
280 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
281 $(INSTALL_DIR) $(1)/etc/init.d
282 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
283 endef
284
285 define Package/asterisk16-sounds/install
286 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
287 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
288 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
289 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
290 endef
291
292
293 define Package/asterisk16-voicemail/conffiles
294 /etc/asterisk/voicemail.conf
295 endef
296
297 define Package/asterisk16-voicemail/install
298 $(INSTALL_DIR) $(1)/etc/asterisk
299 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
300 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
301 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
302 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
303 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
304 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
305 endef
306
307 define Package/asterisk16-app-meetme/conffiles
308 /etc/asterisk/meetme.conf
309 endef
310
311 define Package/asterisk16-app-meetme/install
312 $(INSTALL_DIR) $(1)/etc/asterisk
313 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
314 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
315 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
316 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
317 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
318 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
319 endef
320
321 define Package/asterisk16-chan-iax2/conffiles
322 /etc/asterisk/iax.conf
323 /etc/asterisk/iaxprov.conf
324 endef
325
326 define Package/asterisk16-cdr/conffiles
327 /etc/asterisk/cdr.conf
328 /etc/asterisk/cdr_custom.conf
329 /etc/asterisk/cdr_manager.conf
330 /etc/asterisk/cdr_odbc.conf
331 /etc/asterisk/cdr_pgsql.conf
332 /etc/asterisk/cdr_tds.conf
333 endef
334
335 define Package/asterisk16-res-musiconhold/conffiles
336 /etc/asterisk/musiconhold.conf
337 endef
338
339 define Package/asterisk16-chan-iax2/install
340 $(INSTALL_DIR) $(1)/etc/asterisk
341 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
342 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
343 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
344 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
345 endef
346
347 define Package/asterisk16-chan-local/install
348 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
349 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_local.so $(1)/usr/lib/asterisk/modules/
350 endef
351
352 define Package/asterisk16-cdr/install
353 $(INSTALL_DIR) $(1)/etc/asterisk
354 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
355 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
356 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
357 endef
358
359 define Package/asterisk16-res-musiconhold/install
360 $(INSTALL_DIR) $(1)/etc/asterisk
361 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
362 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
363 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
364 endef
365
366 define Package/asterisk16-format-g729/install
367 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
368 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_g729.so $(1)/usr/lib/asterisk/modules/
369 endef
370
371 define Package/asterisk16-chan-gtalk/conffiles
372 /etc/asterisk/gtalk.conf
373 /etc/asterisk/jabber.conf
374 endef
375
376 define Package/asterisk16-chan-gtalk/install
377 $(INSTALL_DIR) $(1)/etc/asterisk
378 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
379 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
380 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
381 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
382 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
383 endef
384
385 define Package/asterisk16-app-system/install
386 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
387 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_system.so $(1)/usr/lib/asterisk/modules/
388 endef
389
390 $(eval $(call BuildPackage,asterisk16))
391 $(eval $(call BuildPackage,asterisk16-voicemail))
392 $(eval $(call BuildPackage,asterisk16-sounds))
393 #$(eval $(call BuildPackage,asterisk16-app-meetme))
394 $(eval $(call BuildPackage,asterisk16-chan-iax2))
395 $(eval $(call BuildPackage,asterisk16-chan-local))
396 $(eval $(call BuildPackage,asterisk16-cdr))
397 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
398 $(eval $(call BuildPackage,asterisk16-format-g729))
399 $(eval $(call BuildPackage,asterisk16-chan-gtalk))
400 $(eval $(call BuildPackage,asterisk16-app-system))