add asterisk-addons-1.4.x (thanks to Hans Zandbelt)
[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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=asterisk-addons
12 PKG_VERSION:=1.4.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://ftp.digium.com/pub/asterisk/old-releases/
17 PKG_MD5SUM:=c080b02e6ddc81dab6a64691af890805
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/asterisk-addons/Default
22 SUBMENU:=asterisk14 (Complete Open Source PBX), v1.4.x
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=Asterisk addons
26 URL:=http://www.asterisk.org/
27 endef
28
29 define Package/asterisk-addons/Default/description
30 Asterisk addons contains additional modules for Asterisk which are, for
31 one reason or another, not included in the normal base distribution.
32 endef
33
34
35 define Package/asterisk14-chan-mobile
36 $(call Package/asterisk-addons/Default)
37 DEPENDS:= +asterisk14 +bluez-libs
38 TITLE+= Mobile channel support
39 endef
40
41 define Package/asterisk14-chan-mobile/description
42 $(call Package/asterisk-addons/Default/description)
43 This package contains the chan_mobile module for Asterisk.
44 endef
45
46
47 define Package/asterisk14-chan-ooh323
48 $(call Package/asterisk-addons/Default)
49 DEPENDS:= +asterisk14
50 TITLE+= OO H.323 channel support
51 endef
52
53 define Package/asterisk14-chan-ooh323/description
54 $(call Package/asterisk-addons/Default/description)
55 This package contains the Objective Open H.323 support module for Asterisk.
56 endef
57
58
59 define Package/asterisk14-format-mp3
60 $(call Package/asterisk-addons/Default)
61 DEPENDS:= +asterisk14
62 TITLE+= MP3 format support
63 endef
64
65 define Package/asterisk14-format-mp3/description
66 $(call Package/asterisk-addons/Default/description)
67 This package contains the MP3 support module for Asterisk.
68 endef
69
70
71 define Package/asterisk14-mysql
72 $(call Package/asterisk-addons/Default)
73 DEPENDS:= +asterisk14 +libmysqlclient
74 TITLE+= MySQL support
75 endef
76
77 define Package/asterisk14-mysql/description
78 $(call Package/asterisk-addons/Default/description)
79 This package contains MySQL support modules for Asterisk.
80 endef
81
82
83 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-mysql),)
84 EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/mysql
85 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
86 endif
87
88
89 define Build/Configure
90 ( cd $(PKG_BUILD_DIR); ./bootstrap.sh )
91 $(call Build/Configure/Default)
92 cd $(PKG_BUILD_DIR)/asterisk-ooh323c && \
93 CPPFLAGS="-I$(STAGING_DIR)/host/include $(EXTRA_CFLAGS)" \
94 LDFLAGS="-L$(STAGING_DIR)/host/lib" \
95 ./configure \
96 --target=$(GNU_TARGET_NAME) \
97 --host=$(GNU_TARGET_NAME) \
98 -build=$(GNU_HOST_NAME) \
99 --prefix=/usr \
100 --exec-prefix=/usr \
101 --bindir=/usr/bin \
102 --sbindir=/usr/sbin \
103 --libexecdir=/usr/lib \
104 --sysconfdir=/etc \
105 --datadir=/usr/share \
106 --localstatedir=/var \
107 --mandir=/usr/man \
108 --infodir=/usr/info \
109 $(DISABLE_NLS) \
110 ac_cv_file__usr_include_asterisk_channel_h="yes"
111 endef
112
113 define Build/Compile
114 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules
115 CFLAGS="-DLOW_MEMORY $(EXTRA_CFLAGS)" \
116 LDFLAGS="$(EXTRA_LDFLAGS)" \
117 $(MAKE) -C "$(PKG_BUILD_DIR)" \
118 BLUETOOTH_LIB="$(TARGET_LDFLAGS) -lbluetooth" \
119 DESTDIR="$(PKG_INSTALL_DIR)" \
120 all install samples
121 endef
122
123
124 define Package/asterisk14-chan-mobile/conffiles
125 /etc/asterisk/mobile.conf
126 endef
127
128 define Package/asterisk14-chan-mobile/install
129 $(INSTALL_DIR) $(1)/etc/asterisk
130 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mobile.conf $(1)/etc/asterisk/
131 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
132 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/
133 endef
134
135
136 define Package/asterisk14-chan-ooh323/install
137 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
138 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_ooh323.so $(1)/usr/lib/asterisk/modules/
139 endef
140
141
142 define Package/asterisk14-format-mp3/install
143 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_mp3.so $(1)/usr/lib/asterisk/modules/
145 endef
146
147
148 define Package/asterisk14-mysql/conffiles
149 /etc/asterisk/cdr_mysql.conf
150 /etc/asterisk/res_mysql.conf
151 endef
152
153 define Package/asterisk14-mysql/install
154 $(INSTALL_DIR) $(1)/etc/asterisk
155 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/
156 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_mysql.conf $(1)/etc/asterisk/
157 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_addon_sql_mysql.so $(1)/usr/lib/asterisk/modules/
159 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_addon_mysql.so $(1)/usr/lib/asterisk/modules/
160 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/
161 endef
162
163
164 $(eval $(call BuildPackage,asterisk14-chan-mobile))
165 $(eval $(call BuildPackage,asterisk14-chan-ooh323))
166 $(eval $(call BuildPackage,asterisk14-format-mp3))
167 $(eval $(call BuildPackage,asterisk14-mysql))