5734b0cd753cbb07ea3c1e705367d06644091a94
[openwrt/svn-archive/archive.git] / net / asterisk-1.6.x / Makefile
1 #
2 # Copyright (C) 2008 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.1.0-rc3
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:=29c45a36653e15ef8e78f92a1de753b8
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 CONFIGURE_ARGS+= \
93 --without-curl \
94 --without-curses \
95 --with-gsm=internal \
96 --without-gtk \
97 --without-gtk2 \
98 --without-isdnnet \
99 --without-kde \
100 --without-misdn \
101 --without-nbs \
102 --with-ncurses="$(STAGING_DIR)/usr" \
103 --without-netsnmp \
104 --without-newt \
105 --without-odbc \
106 --without-ogg \
107 --without-osptk \
108 --with-popt="$(STAGING_DIR)/usr" \
109 --without-pri \
110 --without-qt \
111 --without-radius \
112 --without-sdl \
113 --without-spandsp \
114 --without-suppserv \
115 --without-tds \
116 --without-termcap \
117 --without-tinfo \
118 --without-vorbis \
119 --without-vpb \
120 --with-z="$(STAGING_DIR)/usr" \
121
122 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
123 CONFIGURE_ARGS+= \
124 --with-dahdi="$(STAGING_DIR)/usr"
125 else
126 CONFIGURE_ARGS+= \
127 --without-dahdi
128 endif
129
130 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
131 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
132
133 define Build/Configure
134 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
135 $(call Build/Configure/Default,,$(SITE_VARS))
136 endef
137
138 define Build/Compile
139 $(MAKE) -C "$(PKG_BUILD_DIR)" \
140 include/asterisk/version.h \
141 include/asterisk/buildopts.h defaults.h \
142 makeopts.embed_rules
143 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
144 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
145 $(MAKE) -C "$(PKG_BUILD_DIR)" \
146 ASTVARLIBDIR="/usr/lib/asterisk" \
147 NOISY_BUILD="1" \
148 DEBUG="" \
149 OPTIMIZE="" \
150 DESTDIR="$(PKG_INSTALL_DIR)" \
151 all install samples
152 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
153 endef
154
155 #define Build/InstallDev
156 # mkdir -p $(1)/usr/include/asterisk/
157 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
158 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
159 #endef
160
161 define Package/asterisk16/conffiles
162 /etc/asterisk/asterisk.conf
163 /etc/asterisk/modules.conf
164 /etc/asterisk/extensions.conf
165 /etc/asterisk/sip.conf
166 /etc/asterisk/sip_notify.conf
167 /etc/asterisk/features.conf
168 /etc/asterisk/logger.conf
169 /etc/asterisk/manager.conf
170 /etc/asterisk/rtp.conf
171 /etc/default/asterisk
172 /etc/init.d/asterisk
173 endef
174
175 define Package/asterisk16/install
176 $(INSTALL_DIR) $(1)/etc/asterisk
177 for f in asterisk extensions features \
178 logger manager modules \
179 sip sip_notify rtp; do \
180 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
181 done
182 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
183 for f in app_dial app_echo app_playback app_macro \
184 chan_sip \
185 codec_ulaw codec_gsm \
186 format_gsm format_pcm format_wav format_wav_gsm \
187 pbx_config \
188 func_strings func_timeout func_callerid; do \
189 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
190 done
191 $(INSTALL_DIR) $(1)/usr/sbin
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
193 $(INSTALL_DIR) $(1)/etc/default
194 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
195 $(INSTALL_DIR) $(1)/etc/init.d
196 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
197 endef
198
199 define Package/asterisk16-sounds/install
200 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
201 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
202 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
203 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
204 endef
205
206
207 define Package/asterisk16-voicemail/conffiles
208 /etc/asterisk/voicemail.conf
209 endef
210
211 define Package/asterisk16-voicemail/install
212 $(INSTALL_DIR) $(1)/etc/asterisk
213 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
214 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
216 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
217 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
218 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
219 endef
220
221 define Package/asterisk16-app-meetme/conffiles
222 /etc/asterisk/meetme.conf
223 endef
224
225 define Package/asterisk16-app-meetme/install
226 $(INSTALL_DIR) $(1)/etc/asterisk
227 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
228 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
230 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
231 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
232 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
233 endef
234
235 define Package/asterisk16-chan-iax2/conffiles
236 /etc/asterisk/iax.conf
237 /etc/asterisk/iaxprov.conf
238 endef
239
240 define Package/asterisk16-chan-iax2/install
241 $(INSTALL_DIR) $(1)/etc/asterisk
242 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
243 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
244 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
245 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
246 endef
247
248 $(eval $(call BuildPackage,asterisk16))
249 $(eval $(call BuildPackage,asterisk16-voicemail))
250 $(eval $(call BuildPackage,asterisk16-sounds))
251 #$(eval $(call BuildPackage,asterisk16-app-meetme))
252 $(eval $(call BuildPackage,asterisk16-chan-iax2))