add basic asterisk 1.6.x package based on 1.6.1-rc1
[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 # $Id$
8
9 # TODO:
10 # - create smaller default config files (sip.conf and extensions.conf)
11 # - ldd /usr/sbin/asterisk result:
12 # + libssl.so.0.9.8 dep. is missing (and zlib sub dep.) => libopenssl
13 # + libcrypto.so.0.9.8 dep. is missing => libopenssl
14 # => need 1063071 and 223551 bytes!
15 # - asterisk -cvvv
16 # + load_dynamic_module: Error loading module 'func_strings.so': File not found
17 # + Unable to open Asterisk database '/var/lib/asterisk/astdb
18 # + Error loading module 'res_musiconhold.so': File not found
19 # - mkdir -p /var/lib/asterisk/
20 # - app_echo.so need app_playback.so
21 # - I need app_macro.so
22 # - Function "CALLERID not registered
23 #
24 # Changelog:
25 # 20090111 nm build brcm47xx failde: add --without-sdl to CONFIGURE_ARGS
26 # build x86: Package gtk+-2.0 was not found in the pkg-config search path.
27 # => --without-gtk and --without-gtk2 added to CONFIGURE_ARGS but libpopt
28 # is needed
29
30 include $(TOPDIR)/rules.mk
31
32 PKG_NAME:=asterisk
33 PKG_VERSION:=1.6.1-rc1
34 PKG_RELEASE:=1
35
36 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
37 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
38 PKG_MD5SUM:=29f7285b673d52b49d91c8e797acbbb0
39
40 include $(INCLUDE_DIR)/package.mk
41
42 define Package/asterisk16/Default
43 SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
44 SECTION:=net
45 CATEGORY:=Network
46 URL:=http://www.asterisk.org/
47 endef
48
49 define Package/asterisk16/Default/description
50 Asterisk is a complete PBX in software. It provides all of the features
51 you would expect from a PBX and more. Asterisk does voice over IP in three
52 protocols, and can interoperate with almost all standards-based telephony
53 equipment using relatively inexpensive hardware.
54 endef
55
56
57 define Package/asterisk16
58 $(call Package/asterisk16/Default)
59 TITLE:=Complete open source PBX
60 DEPENDS:= +libncurses +libpopt +libpthread +zlib @!TARGET_avr32
61 endef
62
63 define Package/asterisk16/description
64 $(call Package/asterisk16/Default/description)
65 endef
66
67 define Package/asterisk16-sounds
68 $(call Package/asterisk16/Default)
69 TITLE:=Sound files
70 DEPENDS:= +asterisk16
71 endef
72
73 define Package/asterisk16-sounds/description
74 $(call Package/asterisk16/Default/description)
75 This package contains sound files for Asterisk.
76 endef
77
78
79 define Package/asterisk16-voicemail
80 $(call Package/asterisk16/Default)
81 TITLE:=Voicemail support
82 DEPENDS:= +asterisk16
83 endef
84
85 define Package/asterisk16-voicemail/description
86 $(call Package/asterisk16/Default/description)
87 This package contains voicemail related modules for Asterisk.
88 endef
89
90 define Package/asterisk16-app-meetme
91 $(call Package/asterisk16/Default)
92 TITLE:=conferencing support
93 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
94 endef
95
96 define Package/asterisk16-app-meetme/description
97 $(call Package/asterisk16/Default/description)
98 This package provides the MeetMe application driver Conferencing support to
99 Asterisk.
100 endef
101
102 CONFIGURE_ARGS+= \
103 --without-curl \
104 --without-curses \
105 --with-gsm=internal \
106 --without-gtk \
107 --without-gtk2 \
108 --without-isdnnet \
109 --without-kde \
110 --without-misdn \
111 --without-nbs \
112 --with-ncurses="$(STAGING_DIR)/usr" \
113 --without-netsnmp \
114 --without-newt \
115 --without-odbc \
116 --without-ogg \
117 --without-osptk \
118 --with-popt="$(STAGING_DIR)/usr" \
119 --without-pri \
120 --without-qt \
121 --without-radius \
122 --without-sdl \
123 --without-spandsp \
124 --without-suppserv \
125 --without-tds \
126 --without-termcap \
127 --without-tinfo \
128 --without-vorbis \
129 --without-vpb \
130 --with-z="$(STAGING_DIR)/usr" \
131
132 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
133 CONFIGURE_ARGS+= \
134 --with-dahdi="$(STAGING_DIR)/usr"
135 else
136 CONFIGURE_ARGS+= \
137 --without-dahdi
138 endif
139
140 EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
141 EXTRA_LDFLAGS:= $(TARGET_LDFLAGS)
142
143 define Build/Configure
144 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
145 $(call Build/Configure/Default,,$(SITE_VARS))
146 endef
147
148 define Build/Compile
149 $(MAKE) -C "$(PKG_BUILD_DIR)" \
150 include/asterisk/version.h \
151 include/asterisk/buildopts.h defaults.h \
152 makeopts.embed_rules
153 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY $(TARGET_CFLAGS)" \
154 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
155 $(MAKE) -C "$(PKG_BUILD_DIR)" \
156 ASTVARLIBDIR="/usr/lib/asterisk" \
157 NOISY_BUILD="1" \
158 DEBUG="" \
159 OPTIMIZE="" \
160 DESTDIR="$(PKG_INSTALL_DIR)" \
161 all install samples
162 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
163 endef
164
165 define Build/InstallDev
166 mkdir -p $(1)/usr/include/asterisk/
167 $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
168 $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
169 endef
170
171 define Package/asterisk16/conffiles
172 /etc/asterisk/asterisk.conf
173 /etc/asterisk/modules.conf
174 /etc/asterisk/extensions.conf
175 /etc/asterisk/sip.conf
176 /etc/asterisk/sip_notify.conf
177 /etc/asterisk/features.conf
178 /etc/asterisk/logger.conf
179 /etc/asterisk/manager.conf
180 /etc/asterisk/rtp.conf
181 /etc/default/asterisk
182 /etc/init.d/asterisk
183 endef
184
185 define Package/asterisk16/install
186 $(INSTALL_DIR) $(1)/etc/asterisk
187 for f in asterisk extensions features \
188 logger manager modules \
189 sip sip_notify rtp; do \
190 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
191 done
192 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
193 for f in app_dial chan_sip \
194 codec_ulaw codec_gsm \
195 format_gsm format_pcm format_wav format_wav_gsm \
196 pbx_config func_timeout; do \
197 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
198 done
199 $(INSTALL_DIR) $(1)/usr/sbin
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
201 $(INSTALL_DIR) $(1)/etc/default
202 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
203 $(INSTALL_DIR) $(1)/etc/init.d
204 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
205 endef
206
207 define Package/asterisk16-sounds/install
208 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
209 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
210 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
211 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
212 endef
213
214
215 define Package/asterisk16-voicemail/conffiles
216 /etc/asterisk/voicemail.conf
217 endef
218
219 define Package/asterisk16-voicemail/install
220 $(INSTALL_DIR) $(1)/etc/asterisk
221 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
222 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
225 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
226 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
227 endef
228
229 define Package/asterisk16-app-meetme/conffiles
230 /etc/asterisk/meetme.conf
231 endef
232
233 define Package/asterisk16-app-meetme/install
234 $(INSTALL_DIR) $(1)/etc/asterisk
235 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
236 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
237 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
239 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
240 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
241 endef
242
243 $(eval $(call BuildPackage,asterisk16))
244 $(eval $(call BuildPackage,asterisk16-voicemail))
245 $(eval $(call BuildPackage,asterisk16-sounds))
246 #$(eval $(call BuildPackage,asterisk16-app-meetme))