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