059b43271600eb3b95932952c2b4c482cdc20654
[feed/telephony.git] / net / yate / Makefile
1 #
2 # Copyright (C) 2006-2013 OpenWrt.org
3 # Copyright (C) 2006-2011 SMBPhone
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/uclibc++.mk
11
12 RELEASEVER:=5.0.0
13
14 PKG_NAME:=yate
15 PKG_VERSION:=$(RELEASEVER)-1
16 PKG_RELEASE:=1
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate5/
20 PKG_MD5SUM:=6113bce2b81b402431c61d1f777e09a6
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
22
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/$(PKG_NAME)/Default
28   SUBMENU:=Telephony
29   SECTION:=net
30   CATEGORY:=Network
31   URL:=http://yate.null.ro/
32 endef
33
34 define Package/$(PKG_NAME)
35   $(call Package/yate/Default)
36   DEPENDS:=+libpthread $(CXX_DEPENDS)
37   TITLE:=Yet Another Telphony Engine
38   MENU:=1
39 endef
40
41 define Package/$(PKG_NAME)/conffiles
42 /etc/yate/yate.conf
43 /etc/init.d/yate
44 endef
45
46 define Package/$(PKG_NAME)/Default/description
47   Is a next-generation telephony engine focused on the VoIP and PSTN.  It does
48   SIP, H.323, IAX, PSTN, and more.
49 endef
50
51 define Package/$(PKG_NAME)-scripts-php
52   $(call Package/yate/Default)
53   DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +php5 +php5-cli
54   TITLE:= PHP Scripts and script libraries for Yate
55 endef
56
57 define Package/$(PKG_NAME)-scripts-perl
58   $(call Package/yate/Default)
59   DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +microperl
60   TITLE:= Perl module for Yate
61 endef
62
63 define Package/$(PKG_NAME)-scripts-python
64   $(call Package/yate/Default)
65   DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +python-mini
66   TITLE:= Python module for Yate
67 endef
68
69 define Package/$(PKG_NAME)-sounds
70   $(call Package/yate/Default)
71   DEPENDS += $(PKG_NAME)
72   TITLE := Sounds for Yate
73 endef
74
75 define Package/$(PKG_NAME)-collection-basic
76   $(call Package/yate/Default)
77   DEPENDS += $(PKG_NAME) \
78         +$(PKG_NAME)-sounds \
79         +$(PKG_NAME)-mod-dumbchan \
80         +$(PKG_NAME)-mod-regfile \
81         +$(PKG_NAME)-mod-regexroute \
82         +$(PKG_NAME)-mod-rmanager \
83         +$(PKG_NAME)-mod-tonegen \
84         +$(PKG_NAME)-mod-yrtpchan \
85         +$(PKG_NAME)-mod-ysipchan
86    TITLE := Basic Yate Server
87 endef
88
89 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include $(if $(CONFIG_BIG_ENDIAN),-DBIGENDIAN,)
90
91 CONFIGURE_ARGS+= \
92         --enable-strings \
93         --enable-poll \
94         --enable-inline \
95         --enable-atomics \
96         --disable-sse2 \
97         --enable-sctp \
98         --enable-resolver \
99         --enable-internalregex \
100         --disable-dahdi \
101         --disable-zaptel \
102         --disable-wpcard \
103         --disable-tdmcard \
104         --enable-wanpipe \
105         --enable-ilbc \
106         --enable-ilbc-webrtc \
107         --enable-isac-float \
108         --disable-isac-fixed \
109         --enable-rtti \
110         --with-libpq="$(STAGING_DIR)/usr" \
111         --with-mysql="$(STAGING_DIR)/usr" \
112         --without-wphwec \
113         --with-libgsm="$(STAGING_DIR)/usr/include/gsm" \
114         --with-libspeex="$(STAGING_DIR)/usr/include" \
115         --with-amrnb="$(STAGING_DIR)/usr" \
116         --with-spandsp="$(STAGING_DIR)/usr/include" \
117         --without-pwlib \
118         --without-openh323 \
119         --with-openssl="$(STAGING_DIR)/usr" \
120         --with-zlib="$(STAGING_DIR)/usr" \
121         --without-libqt4 \
122         --without-qtstatic \
123         --without-coredumper \
124         --without-doxygen \
125         --without-kdoc
126
127 CONFIGURE_VARS+= \
128         LDFLAGS="$$$$LDFLAGS -nodefaultlibs" \
129         LIBS="-lc -luClibc++ -lpthread -lresolv -ldl -lm -lc $(LIBGCC_S)"
130
131 define Package/$(PKG_NAME)/install
132         $(INSTALL_DIR) $(1)/usr/lib
133         
134         for yatelib in "" sig mgcp jabber script; do \
135                 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib ;\
136                 $(LN) ./libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib/libyate$$$${yatelib}.so ;\
137         done
138         
139         $(INSTALL_DIR) $(1)/usr/bin
140         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yate $(1)/usr/bin/
141         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
142         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/yate/yate.conf $(1)/etc/$(PKG_NAME)/yate.conf
143         $(INSTALL_DIR) $(1)/etc/init.d
144         $(INSTALL_BIN) ./files/yate.init $(1)/etc/init.d/yate
145 endef
146
147 define Package/$(PKG_NAME)-scripts-php/install
148         $(INSTALL_DIR) $(1)/usr/share/yate/scripts
149         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/leavemail.php $(1)/usr/share/yate/scripts/
150         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/queue_in.php $(1)/usr/share/yate/scripts/
151         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/queue_out.php $(1)/usr/share/yate/scripts/
152         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/route.php $(1)/usr/share/yate/scripts/
153         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/voicemail.php $(1)/usr/share/yate/scripts/
154         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libvoicemail.php $(1)/usr/share/yate/scripts/
155         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyatechan.php $(1)/usr/share/yate/scripts/
156         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyateivr.php $(1)/usr/share/yate/scripts/
157         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyate.php $(1)/usr/share/yate/scripts/
158 endef
159
160 define Package/$(PKG_NAME)-scripts-perl/install
161         $(INSTALL_DIR) $(1)/usr/share/yate/scripts
162         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/Yate.pm $(1)/usr/share/yate/scripts/
163 endef
164
165 define Package/$(PKG_NAME)-scripts-python/install
166         $(INSTALL_DIR) $(1)/usr/share/yate/scripts
167         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/libyate.py $(1)/usr/share/yate/scripts/
168 endef
169
170 define Package/$(PKG_NAME)-sounds/install
171         $(INSTALL_DIR) $(1)/usr/share/yate/sounds
172         $(CP) $(PKG_INSTALL_DIR)/usr/share/yate/sounds/ $(1)/usr/share/yate/
173 endef
174
175 define Package/$(PKG_NAME)-collection-basic/install
176 endef
177
178 define Build/InstallDev
179         $(INSTALL_DIR) $(STAGING_DIR)/usr/include
180         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(STAGING_DIR)/usr/include/
181         $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
182         $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib/
183 endef
184
185 define BuildPlugin
186   define Package/$(PKG_NAME)-mod-$(1)
187     $(call Package/yate/Default)
188     DEPENDS:= $(PKG_NAME) $(4)
189     TITLE:=$(3)
190   endef
191
192   $(if $(PKG_BUILD_DIR)/conf.d/$(1).conf.sample,
193   define Package/$(PKG_NAME)-mod-$(1)/conffiles
194     /etc/yate/$(1).conf
195   endef
196   ,)
197   
198   define Package/$(PKG_NAME)-mod-$(1)/description
199     $(3) module for $(PKG_NAME)
200   endef
201   
202   define Package/$(PKG_NAME)-mod-$(1)/install
203         $$(INSTALL_DIR) $$(1)/usr/lib/yate/$(2)
204         $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/lib/yate/$(2)/$(1).yate $$(1)/usr/lib/yate/$(2)/$(1).yate
205         if [ -f $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf ]; then \
206                 $$(INSTALL_DIR) $$(1)/etc/yate ;\
207                 $$(INSTALL_DATA) $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf $$(1)/etc/yate/ ;\
208         fi
209         $(if $(5),$(foreach extra_file,$(5),\
210                 $(INSTALL_DIR) $$(1)$(dir $(extra_file)) ; \
211                 $(CP) $(PKG_INSTALL_DIR)$(extra_file) $$(1)$(extra_file) ; \
212         ),)
213   endef
214
215   $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
216 endef
217
218 $(eval $(call BuildPackage,$(PKG_NAME)))
219 $(eval $(call BuildPackage,$(PKG_NAME)-collection-basic))
220 $(eval $(call BuildPackage,$(PKG_NAME)-scripts-php))
221 $(eval $(call BuildPackage,$(PKG_NAME)-scripts-perl))
222 $(eval $(call BuildPackage,$(PKG_NAME)-scripts-python))
223 $(eval $(call BuildPackage,$(PKG_NAME)-sounds))
224 $(eval $(call BuildPlugin,accfile,server,SIP or H.323 client (from file),))
225 $(eval $(call BuildPlugin,alsachan,client,ALSA Sound Channel,+alsa-lib))
226 $(eval $(call BuildPlugin,amrnbcodec,,AMR-NB Codec,@BROKEN)) # Missing amr-nb library
227 $(eval $(call BuildPlugin,analog,server,Analog (e.g. POTS) Channel,))
228 $(eval $(call BuildPlugin,analogdetect,server,Analog Data Detector,))
229 $(eval $(call BuildPlugin,analyzer,,Test Call Generator and AQ Analyzer,))
230 $(eval $(call BuildPlugin,cache,server,CNAM and LNP memory caches,))
231 $(eval $(call BuildPlugin,callcounters,server,Count Active Call Legs,))
232 $(eval $(call BuildPlugin,callfork,,Call Forker,))
233 $(eval $(call BuildPlugin,callgen,,Call Generator,))
234 $(eval $(call BuildPlugin,ccongestion,server,Accept Status from Installed Engine Monitors,))
235 $(eval $(call BuildPlugin,cdrbuild,,Call Detail Record Builder,))
236 $(eval $(call BuildPlugin,cdrcombine,,Call Detail Records per call instead of per call leg,))
237 $(eval $(call BuildPlugin,cdrfile,,Call Detail Record to File,))
238 $(eval $(call BuildPlugin,ciscosm,server,SS7 Support,))
239 $(eval $(call BuildPlugin,clustering,server,Clustering Server Support,))
240 $(eval $(call BuildPlugin,conference,,Conference Room Mixer,))
241 $(eval $(call BuildPlugin,cpuload,server,Monitor CPU load and Inform Yate,))
242 $(eval $(call BuildPlugin,dbpbx,server,PBX IVR and Multi-routing from Database,))
243 $(eval $(call BuildPlugin,dbwave,server,Wav Media for DB Storage,+$(PKG_NAME)-mod-wavefile))
244 $(eval $(call BuildPlugin,dumbchan,,Dummy Channel,))
245 $(eval $(call BuildPlugin,enumroute,,ENUM Routing,))
246 $(eval $(call BuildPlugin,eventlogs,server,Write events and alarms to log files,))
247 $(eval $(call BuildPlugin,extmodule,,External Module Handler,))
248 $(eval $(call BuildPlugin,faxchan,,Spandsp Fax Channel,+libspandsp))
249 $(eval $(call BuildPlugin,filetransfer,,File Transfer Driver,))
250 $(eval $(call BuildPlugin,gsmcodec,,GSM Codec,+libgsm))
251 $(eval $(call BuildPlugin,gvoice,,Google Voice support,))
252 $(eval $(call BuildPlugin,h323chan,,Open H.323 Channel,+libopenh323 @BROKEN)) # libopenh323 doesn't create package or stagin_dir includes or libs
253 $(eval $(call BuildPlugin,heartbeat,server,Linux-HA compatible heartbeat,))
254 $(eval $(call BuildPlugin,ilbccodec,,iLBC Codec,))
255 $(eval $(call BuildPlugin,ilbcwebrtc,,iLBC Codec from the WebRTC project,))
256 $(eval $(call BuildPlugin,isaccodec,,internet Speech Audio Codec,))
257 $(eval $(call BuildPlugin,isupmangler,sig,ISUP parameter mangling in a STP,))
258 $(eval $(call BuildPlugin,jabberclient,client,Jabber Client,))
259 $(eval $(call BuildPlugin,jabberserver,jabber,Jabber Server,))
260 $(eval $(call BuildPlugin,jbfeatures,jabber,Jabber Server Features,))
261 $(eval $(call BuildPlugin,javascript,,Routing using the embedded Javascript language,))
262 $(eval $(call BuildPlugin,lateroute,server,Last Chance Routing,))
263 $(eval $(call BuildPlugin,lksctp,server,SCTP sockets using linux kernel,@BROKEN)) # Missing libraries/header files
264 $(eval $(call BuildPlugin,mgcpca,server,Media Gateway Control Protocol Agent,))
265 $(eval $(call BuildPlugin,mgcpgw,server,Media Gateway Control Protocol Gateway,))
266 $(eval $(call BuildPlugin,moh,,On Hold (music) Generator,))
267 $(eval $(call BuildPlugin,monitoring,server,Monitoring/gathering Information,))
268 $(eval $(call BuildPlugin,mrcpspeech,server,MRCP v2 Voice/Tone Detector and Synthesizer,))
269 $(eval $(call BuildPlugin,msgsniff,,Sample Message Sniffer,))
270 $(eval $(call BuildPlugin,mux,,Data Multiplexor,))
271 $(eval $(call BuildPlugin,mysqldb,server,MySQL Backend DB,+libmysqlclient-r))
272 $(eval $(call BuildPlugin,openssl,,Encrypted transport (OpenSSL),+libopenssl))
273 $(eval $(call BuildPlugin,osschan,client,OSS Sound Channel,))
274 $(eval $(call BuildPlugin,park,server,Call Parking,))
275 $(eval $(call BuildPlugin,pbx,,PBX Message Handlers,))
276 $(eval $(call BuildPlugin,pbxassist,server,Full featured PBX and IVR,))
277 $(eval $(call BuildPlugin,pgsqldb,server,PostgrestSQL Backend DB,+libpq))
278 $(eval $(call BuildPlugin,presence,server,Presence,))
279 $(eval $(call BuildPlugin,regfile,server,Registration based on users in file,))
280 $(eval $(call BuildPlugin,register,server,Call Detail Record to a database,))
281 $(eval $(call BuildPlugin,queues,server,Call Distribution and Queues from Database,))
282 $(eval $(call BuildPlugin,queuesnotify,server,Notify when queued call status changes,))
283 $(eval $(call BuildPlugin,regexroute,,Regular Expression Based Routing,))
284 $(eval $(call BuildPlugin,rmanager,,Yate Remote Management,))
285 $(eval $(call BuildPlugin,sip_cnam_lnp,sip,Query CNAM and LNP databases using SIP INVITE,))
286 $(eval $(call BuildPlugin,sigtransport,server,SIGTRAN (SS7 over IP) connection provider,))
287 $(eval $(call BuildPlugin,sipfeatures,server,SIP Features (SUBSCRIBE/NOTIFY),))
288 $(eval $(call BuildPlugin,speexcodec,,Speex Codec,+libspeex))
289 $(eval $(call BuildPlugin,subscription,server,Subcription handler and presence notifier,))
290 $(eval $(call BuildPlugin,tdmcard,server,TDM Cards Signalling and Data Driver,@BROKEN)) # Missing TDM libraries
291 $(eval $(call BuildPlugin,tonedetect,,Detectors for Various Tones,))
292 $(eval $(call BuildPlugin,tonegen,,Tones Generator,))
293 $(eval $(call BuildPlugin,users,server,Users,))
294 $(eval $(call BuildPlugin,wavefile,,Wav file Record and Playback,))
295 $(eval $(call BuildPlugin,wpcard,server,Wanpipe PRI cards Signalling and Data Driver,@BROKEN)) # Mising wanpipe and PRI libraries
296 $(eval $(call BuildPlugin,yiaxchan,,IAX Channel,))
297 $(eval $(call BuildPlugin,yjinglechan,,Jingle Channel,))
298 $(eval $(call BuildPlugin,yrtpchan,,RTP Channel and Other Data Helper,))
299 $(eval $(call BuildPlugin,yradius,server,RADIUS Client,))
300 $(eval $(call BuildPlugin,ysigchan,server,SS7/ISDN Protocols - Yate Signalling Library,))
301 $(eval $(call BuildPlugin,ysipchan,,SIP Channel,))
302 $(eval $(call BuildPlugin,ysockschan,,SOCKS Channel,))
303 $(eval $(call BuildPlugin,ysnmpagent,server,SNMP Protocol Agent,,/usr/share/yate/data/NULL-TEAM-MIB.txt /usr/share/yate/data/snmp_mib.conf /usr/share/yate/data/YATE-MIB.txt))
304 $(eval $(call BuildPlugin,ystunchan,,STUN Support,))
305 $(eval $(call BuildPlugin,zlibcompress,,Zlib Compression,+zlib))