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