ad05ec5648dd51ae704f8248c382b19ea83067bc
[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-beta2
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:=ca10a82f5c6ffcec8a9168560e5107ea
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
141 CONFIGURE_ARGS+= \
142 --without-curl \
143 --without-curses \
144 --with-gsm=internal \
145 --without-gtk \
146 --without-gtk2 \
147 --without-isdnnet \
148 --without-kde \
149 --without-misdn \
150 --without-nbs \
151 --with-ncurses="$(STAGING_DIR)/usr" \
152 --without-netsnmp \
153 --without-newt \
154 --without-odbc \
155 --without-ogg \
156 --without-osptk \
157 --with-popt="$(STAGING_DIR)/usr" \
158 --without-pri \
159 --without-qt \
160 --without-radius \
161 --without-sdl \
162 --without-spandsp \
163 --without-suppserv \
164 --without-tds \
165 --without-termcap \
166 --without-tinfo \
167 --without-vorbis \
168 --without-vpb \
169 --with-z="$(STAGING_DIR)/usr" \
170 --disable-xmldoc \
171
172 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
173 CONFIGURE_ARGS+= \
174 --with-dahdi="$(STAGING_DIR)/usr"
175 else
176 CONFIGURE_ARGS+= \
177 --without-dahdi
178 endif
179
180 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
181 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
182
183 define Build/Configure
184 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
185 $(call Build/Configure/Default,,$(SITE_VARS))
186 endef
187
188 define Build/Compile
189 $(MAKE) -C "$(PKG_BUILD_DIR)" \
190 include/asterisk/version.h \
191 include/asterisk/buildopts.h defaults.h \
192 makeopts.embed_rules
193 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
194 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
195 $(MAKE) -C "$(PKG_BUILD_DIR)" \
196 ASTVARLIBDIR="/usr/lib/asterisk" \
197 NOISY_BUILD="1" \
198 DEBUG="" \
199 OPTIMIZE="" \
200 DESTDIR="$(PKG_INSTALL_DIR)" \
201 all install samples
202 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
203 endef
204
205 #define Build/InstallDev
206 # mkdir -p $(1)/usr/include/asterisk/
207 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
208 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
209 #endef
210
211 define Package/asterisk16/conffiles
212 /etc/asterisk/asterisk.conf
213 /etc/asterisk/modules.conf
214 /etc/asterisk/extensions.conf
215 /etc/asterisk/sip.conf
216 /etc/asterisk/sip_notify.conf
217 /etc/asterisk/features.conf
218 /etc/asterisk/logger.conf
219 /etc/asterisk/manager.conf
220 /etc/asterisk/rtp.conf
221 /etc/default/asterisk
222 /etc/init.d/asterisk
223 endef
224
225 define Package/asterisk16/install
226 $(INSTALL_DIR) $(1)/etc/asterisk
227 for f in asterisk extensions features \
228 logger manager modules \
229 sip sip_notify rtp; do \
230 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
231 done
232 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
233 for f in app_dial app_echo app_playback app_macro \
234 chan_sip \
235 codec_ulaw codec_gsm \
236 format_gsm format_pcm format_wav format_wav_gsm \
237 pbx_config \
238 func_strings func_timeout func_callerid; do \
239 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
240 done
241 $(INSTALL_DIR) $(1)/usr/sbin
242 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
243 $(INSTALL_DIR) $(1)/etc/default
244 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
245 $(INSTALL_DIR) $(1)/etc/init.d
246 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
247 endef
248
249 define Package/asterisk16-sounds/install
250 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
251 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
252 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
253 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
254 endef
255
256
257 define Package/asterisk16-voicemail/conffiles
258 /etc/asterisk/voicemail.conf
259 endef
260
261 define Package/asterisk16-voicemail/install
262 $(INSTALL_DIR) $(1)/etc/asterisk
263 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
264 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
265 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
266 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
267 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
268 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
269 endef
270
271 define Package/asterisk16-app-meetme/conffiles
272 /etc/asterisk/meetme.conf
273 endef
274
275 define Package/asterisk16-app-meetme/install
276 $(INSTALL_DIR) $(1)/etc/asterisk
277 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
278 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
279 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
280 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
281 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
282 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
283 endef
284
285 define Package/asterisk16-chan-iax2/conffiles
286 /etc/asterisk/iax.conf
287 /etc/asterisk/iaxprov.conf
288 endef
289
290 define Package/asterisk16-cdr/conffiles
291 /etc/asterisk/cdr.conf
292 /etc/asterisk/cdr_custom.conf
293 /etc/asterisk/cdr_manager.conf
294 /etc/asterisk/cdr_odbc.conf
295 /etc/asterisk/cdr_pgsql.conf
296 /etc/asterisk/cdr_tds.conf
297 endef
298
299 define Package/asterisk16-res-musiconhold/conffiles
300 /etc/asterisk/musiconhold.conf
301 endef
302
303 define Package/asterisk16-chan-iax2/install
304 $(INSTALL_DIR) $(1)/etc/asterisk
305 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
306 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
307 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
308 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
309 endef
310
311 define Package/asterisk16-chan-local/install
312 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
313 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_local.so $(1)/usr/lib/asterisk/modules/
314 endef
315
316 define Package/asterisk16-cdr/install
317 $(INSTALL_DIR) $(1)/etc/asterisk
318 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
319 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
320 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
321 endef
322
323 define Package/asterisk16-res-musiconhold/install
324 $(INSTALL_DIR) $(1)/etc/asterisk
325 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
326 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
327 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
328 endef
329
330 define Package/asterisk16-format-g729/install
331 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
332 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_g729.so $(1)/usr/lib/asterisk/modules/
333 endef
334
335 $(eval $(call BuildPackage,asterisk16))
336 $(eval $(call BuildPackage,asterisk16-voicemail))
337 $(eval $(call BuildPackage,asterisk16-sounds))
338 #$(eval $(call BuildPackage,asterisk16-app-meetme))
339 $(eval $(call BuildPackage,asterisk16-chan-iax2))
340 $(eval $(call BuildPackage,asterisk16-chan-local))
341 $(eval $(call BuildPackage,asterisk16-cdr))
342 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
343 $(eval $(call BuildPackage,asterisk16-format-g729))