356eb83213fc63176b3e9bac21ccfcfeb139bc4f
[packages.git] / net / asterisk-1.6.x / Makefile
1 #
2 # Copyright (C) 2008-2010 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:=asterisk16
11 PKG_VERSION:=1.6.2.14
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=4f0414c9b2d449222b2fc7096cbaffe7
17
18 PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/asterisk16/Default
23   SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
24   SECTION:=net
25   CATEGORY:=Network
26   URL:=http://www.asterisk.org/
27   MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
28 endef
29
30 define Package/asterisk16/Default/description
31  Asterisk is a complete PBX in software. It provides all of the features
32  you would expect from a PBX and more. Asterisk does voice over IP in three
33  protocols, and can interoperate with almost all standards-based telephony
34  equipment using relatively inexpensive hardware.
35 endef
36
37
38 define Package/asterisk16
39 $(call Package/asterisk16/Default)
40   TITLE:=Complete open source PBX
41   DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 @!PACKAGE_asterisk14
42 endef
43
44 define Package/asterisk16/description
45 $(call Package/asterisk16/Default/description)
46 endef
47
48 define Package/asterisk16-sounds
49 $(call Package/asterisk16/Default)
50   TITLE:=Sound files
51   DEPENDS:= +asterisk16
52 endef
53
54 define Package/asterisk16-sounds/description
55 $(call Package/asterisk16/Default/description)
56  This package contains sound files for Asterisk.
57 endef
58
59
60 define Package/asterisk16-voicemail
61 $(call Package/asterisk16/Default)
62   TITLE:=Voicemail support
63   DEPENDS:= +asterisk16
64 endef
65
66 define Package/asterisk16-voicemail/description
67 $(call Package/asterisk16/Default/description)
68  This package contains voicemail related modules for Asterisk.
69 endef
70
71 define Package/asterisk16-app-meetme
72 $(call Package/asterisk16/Default)
73   TITLE:=conferencing support
74   DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
75 endef
76
77 define Package/asterisk16-app-meetme/description
78 $(call Package/asterisk16/Default/description)
79  This package provides the MeetMe application driver Conferencing support to
80  Asterisk.
81 endef
82
83 define Package/asterisk16-chan-iax2
84 $(call Package/asterisk16/Default)
85   TITLE:=IAX support
86   DEPENDS:= +asterisk16
87 endef
88
89 define Package/asterisk16-chan-iax2/description
90 $(call Package/asterisk16/Default/description)
91  This package provides IAX support to
92  Asterisk.
93 endef
94
95 define Package/asterisk16-cdr
96 $(call Package/asterisk16/Default)
97   TITLE:=CDR support
98   DEPENDS:= +asterisk16
99 endef
100
101 define Package/asterisk16-cdr/description
102 $(call Package/asterisk16/Default/description)
103  This package provides Call Detail Record support to
104  Asterisk.
105 endef
106
107 define Package/asterisk16-res-musiconhold
108 $(call Package/asterisk16/Default)
109   TITLE:=MOH support
110   DEPENDS:= +asterisk16
111 endef
112
113 define Package/asterisk16-res-musiconhold/description
114 $(call Package/asterisk16/Default/description)
115  This package provides Music On Hold support to
116  Asterisk.
117 endef
118
119 define Package/asterisk16-chan-gtalk
120 $(call Package/asterisk16/Default)
121   TITLE:=GTalk support
122   DEPENDS:= +asterisk16 +libiksemel
123 endef
124
125 define Package/asterisk16-chan-gtalk/description
126 $(call Package/asterisk16/Default/description)
127  This package provides the channel chan_gtalk and res_jabber for GTalk
128  support to Asterisk.
129 endef
130
131 define Package/asterisk16-curl
132 $(call Package/asterisk16/Default)
133   TITLE:=CURL support
134   DEPENDS:= +asterisk16 +libcurl
135 endef
136
137 define Package/asterisk16-curl/description
138 $(call Package/asterisk16/Default/description)
139  This package provides CURL
140  support to Asterisk.
141 endef
142  
143 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
144   CONFIGURE_ARGS+= \
145         --with-dahdi="$(STAGING_DIR)/usr"
146 else
147   CONFIGURE_ARGS+= \
148         --without-dahdi
149 endif
150
151 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
152   CONFIGURE_ARGS+= \
153         --with-gnutls="$(STAGING_DIR)/usr" \
154         --with-iksemel="$(STAGING_DIR)/usr"
155   SITE_VARS+= \
156         ac_cv_lib_iksemel_iks_start_sasl=yes \
157         ac_cv_lib_gnutls_gnutls_bye=yes
158 else
159   CONFIGURE_ARGS+= \
160         --without-gnutls \
161         --without-iksemel
162 endif
163
164 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-curl),)
165   CONFIGURE_ARGS+= \
166         --with-curl="$(STAGING_DIR)/usr"
167 else
168   CONFIGURE_ARGS+= \
169         --without-curl
170 endif
171
172 CONFIGURE_ARGS+= \
173         --without-curses \
174         --with-gsm=internal \
175         --without-gtk \
176         --without-gtk2 \
177         --without-isdnnet \
178         --without-kde \
179         --without-misdn \
180         --without-nbs \
181         --with-ncurses="$(STAGING_DIR)/usr" \
182         --without-netsnmp \
183         --without-newt \
184         --without-odbc \
185         --without-ogg \
186         --without-osptk \
187         --with-popt="$(STAGING_DIR)/usr" \
188         --without-pri \
189         --without-qt \
190         --without-radius \
191         --without-sdl \
192         --without-spandsp \
193         --without-suppserv \
194         --without-tds \
195         --without-termcap \
196         --without-tinfo \
197         --without-vorbis \
198         --without-vpb \
199         --with-z="$(STAGING_DIR)/usr" \
200         --disable-xmldoc
201
202 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
203 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
204
205 define Build/Configure
206         -rm $(PKG_BUILD_DIR)/menuselect.makeopts
207         $(call Build/Configure/Default,,$(SITE_VARS))
208 endef
209
210 define Build/Compile
211         $(MAKE) -C "$(PKG_BUILD_DIR)" \
212                 include/asterisk/version.h \
213                 include/asterisk/buildopts.h defaults.h \
214                 makeopts.embed_rules
215         ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
216         ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
217         $(MAKE) -C "$(PKG_BUILD_DIR)" \
218                 ASTVARLIBDIR="/usr/lib/asterisk" \
219                 NOISY_BUILD="1" \
220                 DEBUG="" \
221                 OPTIMIZE="" \
222                 DESTDIR="$(PKG_INSTALL_DIR)" \
223                 all install samples
224         $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
225 endef
226
227 #define Build/InstallDev
228 #       $(INSTALL_DIR) $(1)/usr/include/asterisk/
229 #       $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
230 #       $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
231 #endef
232
233 define Package/asterisk16/conffiles
234 /etc/asterisk/asterisk.conf
235 /etc/asterisk/modules.conf
236 /etc/asterisk/extensions.conf
237 /etc/asterisk/sip.conf
238 /etc/asterisk/sip_notify.conf
239 /etc/asterisk/features.conf
240 /etc/asterisk/indications.conf
241 /etc/asterisk/logger.conf
242 /etc/asterisk/manager.conf
243 /etc/asterisk/rtp.conf
244 /etc/default/asterisk
245 /etc/init.d/asterisk
246 endef
247
248 define Package/asterisk16/install
249         $(INSTALL_DIR) $(1)/etc/asterisk
250         for f in asterisk extensions features \
251                 indications logger manager modules \
252                 sip sip_notify rtp; do \
253                 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
254         done
255         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
256         for f in app_dial app_echo app_playback app_macro \
257                 chan_sip \
258                 codec_ulaw codec_gsm \
259                 format_gsm format_pcm format_wav format_wav_gsm \
260                 pbx_config \
261                 func_strings func_timeout func_callerid func_logic; do \
262                 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
263         done
264         $(INSTALL_DIR) $(1)/usr/sbin
265         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
266         $(INSTALL_DIR) $(1)/etc/default
267         $(INSTALL_DATA)  ./files/asterisk.default $(1)/etc/default/asterisk
268         $(INSTALL_DIR) $(1)/etc/init.d
269         $(INSTALL_BIN)  ./files/asterisk.init $(1)/etc/init.d/asterisk
270 endef
271
272 define Package/asterisk16-sounds/install
273         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
274         $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
275         rm -f $(1)/usr/lib/asterisk/sounds/vm-*
276         rm -f $(1)/usr/lib/asterisk/sounds/conf-*
277 endef
278
279
280 define Package/asterisk16-voicemail/conffiles
281 /etc/asterisk/voicemail.conf
282 endef
283
284 define Package/asterisk16-voicemail/install
285         $(INSTALL_DIR) $(1)/etc/asterisk
286         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
287         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
288         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
289         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
290         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
291         $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
292 endef
293
294 define Package/asterisk16-app-meetme/conffiles
295 /etc/asterisk/meetme.conf
296 endef
297
298 define Package/asterisk16-app-meetme/install
299         $(INSTALL_DIR) $(1)/etc/asterisk
300         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
301         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
302         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
303         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
304         $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
305         $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
306 endef
307
308 define Package/asterisk16-chan-iax2/conffiles
309 /etc/asterisk/iax.conf
310 /etc/asterisk/iaxprov.conf
311 endef
312
313 define Package/asterisk16-cdr/conffiles
314 /etc/asterisk/cdr.conf
315 /etc/asterisk/cdr_custom.conf
316 /etc/asterisk/cdr_manager.conf
317 /etc/asterisk/cdr_odbc.conf
318 /etc/asterisk/cdr_pgsql.conf
319 /etc/asterisk/cdr_tds.conf
320 endef
321
322 define Package/asterisk16-res-musiconhold/conffiles
323 /etc/asterisk/musiconhold.conf
324 endef
325
326 define Package/asterisk16-chan-iax2/install
327         $(INSTALL_DIR) $(1)/etc/asterisk
328         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
329         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
330         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
331         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
332 endef
333
334 define Package/asterisk16-cdr/install
335         $(INSTALL_DIR) $(1)/etc/asterisk
336         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
337         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
338         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
339 endef
340
341 define Package/asterisk16-res-musiconhold/install
342         $(INSTALL_DIR) $(1)/etc/asterisk
343         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
344         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
345         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
346 endef
347
348 define Package/asterisk16-chan-gtalk/conffiles
349 /etc/asterisk/gtalk.conf
350 /etc/asterisk/jabber.conf
351 endef
352
353 define Package/asterisk16-chan-gtalk/install
354         $(INSTALL_DIR) $(1)/etc/asterisk
355         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
356         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
357         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
358         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
359         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
360 endef
361
362 define Package/asterisk16-curl/install
363         $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
364         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/
365         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/
366 endef
367
368 define BuildAsterisk16ModuleTemplate
369
370   define Package/asterisk16-$(subst _,-,$(1))
371   $$(call Package/asterisk16/Default)
372     TITLE:=$(2) support
373     DEPENDS:= +asterisk16
374   endef
375
376   define Package/asterisk16-$(subst _,-,$(1))/description
377   $$(call Package/asterisk16/Default/description)
378     This package provides support $(3) in Asterisk.
379   endef
380
381   define Package/asterisk16-$(subst _,-,$(1))/install
382         $(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules
383         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/
384   endef
385
386   $$(eval $$(call BuildPackage,asterisk16-$(subst _,-,$(1))))
387 endef
388
389 $(eval $(call BuildPackage,asterisk16))
390 $(eval $(call BuildPackage,asterisk16-voicemail))
391 $(eval $(call BuildPackage,asterisk16-sounds))
392 #$(eval $(call BuildPackage,asterisk16-app-meetme))
393 $(eval $(call BuildPackage,asterisk16-chan-iax2))
394 $(eval $(call BuildPackage,asterisk16-cdr))
395 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
396 $(eval $(call BuildPackage,asterisk16-chan-gtalk))
397 $(eval $(call BuildPackage,asterisk16-curl))
398 $(eval $(call BuildAsterisk16ModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands))
399 $(eval $(call BuildAsterisk16ModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available))
400 $(eval $(call BuildAsterisk16ModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel))
401 $(eval $(call BuildAsterisk16ModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup))
402 $(eval $(call BuildAsterisk16ModuleTemplate,app_exec,Exec application,support for application execution))
403 $(eval $(call BuildAsterisk16ModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system))
404 $(eval $(call BuildAsterisk16ModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable))
405 $(eval $(call BuildAsterisk16ModuleTemplate,app_read,Variable read,a trivial application to read a variable))
406 $(eval $(call BuildAsterisk16ModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time))
407 $(eval $(call BuildAsterisk16ModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1)))
408 $(eval $(call BuildAsterisk16ModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc.))
409 $(eval $(call BuildAsterisk16ModuleTemplate,app_system,System exec,support for executing system commands))
410 $(eval $(call BuildAsterisk16ModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect))
411 $(eval $(call BuildAsterisk16ModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch))
412 $(eval $(call BuildAsterisk16ModuleTemplate,app_while,While loop,a while loop implementation))
413 $(eval $(call BuildAsterisk16ModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel))
414 $(eval $(call BuildAsterisk16ModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel))
415 $(eval $(call BuildAsterisk16ModuleTemplate,codec_ulaw,Signed linear to ulaw translation,translation between signed linear and ulaw codecs))
416 $(eval $(call BuildAsterisk16ModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs))
417 $(eval $(call BuildAsterisk16ModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs))
418 $(eval $(call BuildAsterisk16ModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format))
419 $(eval $(call BuildAsterisk16ModuleTemplate,format_g729,G.729,support for raw headerless G729 data))
420 $(eval $(call BuildAsterisk16ModuleTemplate,format_sln,Raw slinear format,support for raw slinear format))
421 $(eval $(call BuildAsterisk16ModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format))
422 $(eval $(call BuildAsterisk16ModuleTemplate,func_db,Database interaction,functions for interaction with the database))
423 $(eval $(call BuildAsterisk16ModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights))
424 $(eval $(call BuildAsterisk16ModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function))
425 $(eval $(call BuildAsterisk16ModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control))
426 $(eval $(call BuildAsterisk16ModuleTemplate,func_global,Global variable,global variable dialplan functions))
427 $(eval $(call BuildAsterisk16ModuleTemplate,func_shell,Shell,support for shell execution))
428 $(eval $(call BuildAsterisk16ModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic))
429 $(eval $(call BuildAsterisk16ModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules))
430 $(eval $(call BuildAsterisk16ModuleTemplate,pbx_spool,Call Spool,outgoing call spool support))
431 $(eval $(call BuildAsterisk16ModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension))
432 $(eval $(call BuildAsterisk16ModuleTemplate,app_alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID))
433 $(eval $(call BuildAsterisk16ModuleTemplate,app_setcallerid,Set callerid,support for setting callerid))
434 $(eval $(call BuildAsterisk16ModuleTemplate,app_verbose,Verbose logging,Verbose logging application))
435 $(eval $(call BuildAsterisk16ModuleTemplate,func_channel,Channel info,Channel info dialplan function))
436 $(eval $(call BuildAsterisk16ModuleTemplate,func_blacklist,Blacklist on callerid,looking up the callerid number, and see if it is blacklisted))
437 $(eval $(call BuildAsterisk16ModuleTemplate,app_originate,Originate a call,originating an outbound call and connecting it to a specified extension or application))