move ntfs-3g to /packages, no need to be in /trunk
[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 EXTRA_CFLAGS:=$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
83 EXTRA_LDFLAGS:=$(TARGET_LDFLAGS)
84 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk14-mysql),)
85 EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/mysql
86 EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
87 endif
88
89 CONFIGURE_ARGS += \
90 --with-bluetooth="$(STAGING_DIR)/usr" \
91 --with-ncurses="$(STAGING_DIR)/usr" \
92 --with-mysqlclient="$(STAGING_DIR)/usr" \
93
94 CONFIGURE_VARS += \
95 ac_cv_file__usr_include_asterisk_channel_h="yes" \
96
97 define Build/Configure
98 ( cd $(PKG_BUILD_DIR); ./bootstrap.sh )
99 $(call Build/Configure/Default,,,)
100 $(call Build/Configure/Default,,,asterisk-ooh323c)
101 $(call libtool_disable_rpath)
102 endef
103
104 # XXX: explanations
105 # - use AM_CFLAGS for asterisk-ooh323c
106 # - use OPTIMIZE & OPTIONS for format_mp3
107
108 MAKE_ARGS:= \
109 AM_CFLAGS="$(TARGET_CFLAGS)" \
110 OPTIMIZE="$(TARGET_CFLAGS)" \
111 OPTIONS="" \
112 BLUETOOTH_LIB="$(TARGET_LDFLAGS) -lbluetooth" \
113
114 MAKE_VARS:= \
115 CFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
116 LDFLAGS="$(EXTRA_LDFLAGS)" \
117
118 define Build/Compile
119 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules
120 $(MAKE_VARS) \
121 $(MAKE) -C "$(PKG_BUILD_DIR)" \
122 $(MAKE_ARGS) \
123 all
124 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
125 $(MAKE_VARS) \
126 $(MAKE) -C "$(PKG_BUILD_DIR)" \
127 $(MAKE_ARGS) \
128 DESTDIR="$(PKG_INSTALL_DIR)" \
129 install samples
130 endef
131
132
133 define Package/asterisk14-chan-mobile/conffiles
134 /etc/asterisk/mobile.conf
135 endef
136
137 define Package/asterisk14-chan-mobile/install
138 $(INSTALL_DIR) $(1)/etc/asterisk
139 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mobile.conf $(1)/etc/asterisk/
140 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/
142 endef
143
144
145 define Package/asterisk14-chan-ooh323/install
146 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
147 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_ooh323.so $(1)/usr/lib/asterisk/modules/
148 endef
149
150
151 define Package/asterisk14-format-mp3/install
152 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/format_mp3.so $(1)/usr/lib/asterisk/modules/
154 endef
155
156
157 define Package/asterisk14-mysql/conffiles
158 /etc/asterisk/cdr_mysql.conf
159 /etc/asterisk/res_mysql.conf
160 endef
161
162 define Package/asterisk14-mysql/install
163 $(INSTALL_DIR) $(1)/etc/asterisk
164 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/
165 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_mysql.conf $(1)/etc/asterisk/
166 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_addon_sql_mysql.so $(1)/usr/lib/asterisk/modules/
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_addon_mysql.so $(1)/usr/lib/asterisk/modules/
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/
170 endef
171
172
173 $(eval $(call BuildPackage,asterisk14-chan-mobile))
174 $(eval $(call BuildPackage,asterisk14-chan-ooh323))
175 $(eval $(call BuildPackage,asterisk14-format-mp3))
176 $(eval $(call BuildPackage,asterisk14-mysql))