[patchteam] - fix building of baresip/restund - Signed-off-by: Alfred E. Heggestad...
[openwrt/svn-archive/archive.git] / net / asterisk-addons-1.4.x / Makefile
1 #
2 # Copyright (C) 2007 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-addons
11 PKG_VERSION:=1.4.8
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:=d4e75c39f737b5ba2a75a4420e1a5a78
17
18 PKG_FIXUP = libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/asterisk-addons/Default
23 SUBMENU:=asterisk14 (Complete Open Source PBX), v1.4.x
24 SECTION:=net
25 CATEGORY:=Network
26 TITLE:=Asterisk addons
27 URL:=http://www.asterisk.org/
28 MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
29 endef
30
31 define Package/asterisk-addons/Default/description
32 Asterisk addons contains additional modules for Asterisk which are, for
33 one reason or another, not included in the normal base distribution.
34 endef
35
36
37 define Package/asterisk14-chan-mobile
38 $(call Package/asterisk-addons/Default)
39 DEPENDS:= +asterisk14 +bluez-libs
40 TITLE+= Mobile channel support
41 endef
42
43 define Package/asterisk14-chan-mobile/description
44 $(call Package/asterisk-addons/Default/description)
45 This package contains the chan_mobile module for Asterisk.
46 endef
47
48
49 define Package/asterisk14-chan-ooh323
50 $(call Package/asterisk-addons/Default)
51 DEPENDS:= +asterisk14
52 TITLE+= OO H.323 channel support
53 endef
54
55 define Package/asterisk14-chan-ooh323/description
56 $(call Package/asterisk-addons/Default/description)
57 This package contains the Objective Open H.323 support module for Asterisk.
58 endef
59
60
61 define Package/asterisk14-format-mp3
62 $(call Package/asterisk-addons/Default)
63 DEPENDS:= +asterisk14
64 TITLE+= MP3 format support
65 endef
66
67 define Package/asterisk14-format-mp3/description
68 $(call Package/asterisk-addons/Default/description)
69 This package contains the MP3 support module for Asterisk.
70 endef
71
72
73 define Package/asterisk14-mysql
74 $(call Package/asterisk-addons/Default)
75 DEPENDS:= +asterisk14 +libmysqlclient
76 TITLE+= MySQL support
77 endef
78
79 define Package/asterisk14-mysql/description
80 $(call Package/asterisk-addons/Default/description)
81 This package contains MySQL support modules for Asterisk.
82 endef
83
84
85 EXTRA_CFLAGS:=$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
86 EXTRA_LDFLAGS:=$(TARGET_LDFLAGS)
87
88 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-mysql),)
89 EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/mysql
90 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
91 endif
92
93 CONFIGURE_ARGS += \
94 --with-asterisk="$(STAGING_DIR)/usr" \
95 --with-bluetooth="$(STAGING_DIR)/usr" \
96 --with-ncurses="$(STAGING_DIR)/usr" \
97 --with-mysqlclient="$(STAGING_DIR)/usr" \
98
99 CONFIGURE_VARS += \
100 ac_cv_file__usr_include_asterisk_channel_h="yes" \
101
102 define Build/Configure
103 ( cd $(PKG_BUILD_DIR); ./bootstrap.sh )
104 $(call Build/Configure/Default,,,)
105 $(call Build/Configure/Default,,,asterisk-ooh323c)
106 endef
107
108 # XXX: explanations
109 # - use AM_CFLAGS for asterisk-ooh323c
110 # - use OPTIMIZE & OPTIONS for format_mp3
111
112 MAKE_ARGS:= \
113 AM_CFLAGS="$(TARGET_CFLAGS)" \
114 OPTIMIZE="$(TARGET_CFLAGS) -DLOW_MEMORY" \
115 OPTIONS="" \
116 NOISY_BUILD="yes" \
117 BLUETOOTH_LIB="$(TARGET_LDFLAGS) -lbluetooth" \
118
119 MAKE_VARS:= \
120 CFLAGS="$(EXTRA_CFLAGS)" \
121 LDFLAGS="$(EXTRA_LDFLAGS)" \
122
123 define Build/Compile
124 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules
125 $(MAKE_VARS) \
126 $(MAKE) -C "$(PKG_BUILD_DIR)" \
127 $(MAKE_ARGS) \
128 all
129 $(MAKE_VARS) \
130 $(MAKE) -C "$(PKG_BUILD_DIR)" \
131 $(MAKE_ARGS) \
132 DESTDIR="$(PKG_INSTALL_DIR)" \
133 install samples
134 endef
135
136
137 define Package/asterisk14-chan-mobile/conffiles
138 /etc/asterisk/mobile.conf
139 endef
140
141 define Package/asterisk14-chan-mobile/install
142 $(INSTALL_DIR) $(1)/etc/asterisk
143 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mobile.conf $(1)/etc/asterisk/
144 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
145 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/
146 endef
147
148
149 define Package/asterisk14-chan-ooh323/install
150 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_ooh323.so $(1)/usr/lib/asterisk/modules/
152 endef
153
154
155 define Package/asterisk14-format-mp3/install
156 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
157 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_mp3.so $(1)/usr/lib/asterisk/modules/
158 endef
159
160
161 define Package/asterisk14-mysql/conffiles
162 /etc/asterisk/cdr_mysql.conf
163 /etc/asterisk/res_mysql.conf
164 endef
165
166 define Package/asterisk14-mysql/install
167 $(INSTALL_DIR) $(1)/etc/asterisk
168 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/
169 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_mysql.conf $(1)/etc/asterisk/
170 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_addon_sql_mysql.so $(1)/usr/lib/asterisk/modules/
172 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_addon_mysql.so $(1)/usr/lib/asterisk/modules/
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/
174 endef
175
176
177 $(eval $(call BuildPackage,asterisk14-chan-mobile))
178 $(eval $(call BuildPackage,asterisk14-chan-ooh323))
179 $(eval $(call BuildPackage,asterisk14-format-mp3))
180 $(eval $(call BuildPackage,asterisk14-mysql))