yate: Update yate script to use an nftables set
[feed/telephony.git] / net / yate / Makefile
1 #
2 # Copyright (C) 2006-2018 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 PKG_NAME:=yate
12 PKG_VERSION:=6.4.0-1
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate6/
17 PKG_HASH:=8c23dc6bffbf8d478db3a85964b5019771c8f6c9acf5220f3465516a748a03b0
18
19 PKG_LICENSE:=GPL-2.0
20 PKG_LICENSE_FILES:=COPYING
21 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
22
23 PKG_FIXUP:=autoreconf
24 # Sporadic build failures on the build bots
25 PKG_BUILD_PARALLEL:=0
26 PKG_INSTALL:=1
27
28 PKG_BUILD_DEPENDS:=HOST_OS_MACOS:fakeuname/host
29
30 # Yate currently does not compile with FORTIFY_SOURCE enabled
31 PKG_FORTIFY_SOURCE:=0
32
33 PKG_CONFIG_DEPENDS:= \
34 CONFIG_PACKAGE_$(PKG_NAME)-mod-faxchan \
35 CONFIG_PACKAGE_$(PKG_NAME)-mod-g722webrtc \
36 CONFIG_PACKAGE_$(PKG_NAME)-mod-ilbccodec \
37 CONFIG_PACKAGE_$(PKG_NAME)-mod-ilbcwebrtc \
38 CONFIG_PACKAGE_$(PKG_NAME)-mod-isaccodec \
39 CONFIG_PACKAGE_$(PKG_NAME)-mod-mysqldb \
40 CONFIG_PACKAGE_$(PKG_NAME)-mod-openssl \
41 CONFIG_PACKAGE_$(PKG_NAME)-mod-pgsqldb \
42 CONFIG_PACKAGE_$(PKG_NAME)-mod-speexcodec \
43 CONFIG_PACKAGE_$(PKG_NAME)-mod-sqlitedb \
44 CONFIG_PACKAGE_$(PKG_NAME)-mod-zapcard \
45 CONFIG_PACKAGE_$(PKG_NAME)-mod-zlibcompress \
46 CONFIG_SOFT_FLOAT
47
48 include $(INCLUDE_DIR)/package.mk
49 include $(INCLUDE_DIR)/nls.mk
50 ifeq ($(CONFIG_HOST_OS_MACOS),y)
51 include $(TOPDIR)/feeds/packages/utils/fakeuname/fakeuname.mk
52 endif
53
54 TAR_OPTIONS+= --strip-components 1
55 TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
56
57 define Package/$(PKG_NAME)/Default
58 SUBMENU:=Telephony
59 SECTION:=net
60 CATEGORY:=Network
61 URL:=http://yate.null.ro/
62 endef
63
64 define Package/$(PKG_NAME)
65 $(call Package/yate/Default)
66 DEPENDS:=+libpthread +libstdcpp
67 TITLE:=Yet Another Telephony Engine
68 MENU:=1
69 endef
70
71 define Package/$(PKG_NAME)/conffiles
72 /etc/yate/yate.conf
73 /etc/init.d/yate
74 endef
75
76 define Package/$(PKG_NAME)/Default/description
77 Is a next-generation telephony engine focused on the VoIP and PSTN. It does
78 SIP, H.323, IAX, PSTN, and more.
79 endef
80
81 define Package/$(PKG_NAME)-scripts-perl
82 $(call Package/yate/Default)
83 DEPENDS += $(PKG_NAME) \
84 +PACKAGE_$(PKG_NAME)-scripts-perl:$(PKG_NAME)-mod-extmodule \
85 +PACKAGE_$(PKG_NAME)-scripts-perl:perlbase-data \
86 @!arc
87 TITLE:= Perl module for Yate
88 endef
89
90 define Package/$(PKG_NAME)-sounds
91 $(call Package/yate/Default)
92 DEPENDS += $(PKG_NAME)
93 TITLE := Sounds for Yate
94 endef
95
96 # Otherwise yate ignores CPPFLAGS
97 TARGET_CFLAGS += $(TARGET_CPPFLAGS)
98
99 CONFIGURE_VARS+= \
100 $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(TARGET_PATH_PKG))
101
102 CONFIGURE_ARGS+= \
103 --disable-sctp \
104 --disable-tdmcard \
105 --disable-wanpipe \
106 --disable-wpcard \
107 --without-amrnb \
108 --without-coredumper \
109 --without-doxygen \
110 --without-kdoc \
111 --without-libgsm \
112 --without-libqt4 \
113 --without-openh323 \
114 --without-pwlib \
115 --without-qtstatic \
116 --without-wphwec \
117 $(if $(CONFIG_x86_64),--enable-sse2) \
118 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-faxchan),--with-spandsp="$(STAGING_DIR)/usr/include",--without-spandsp) \
119 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-g722webrtc),--enable-g722-webrtc,--disable-g722-webrtc) \
120 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-ilbccodec),--enable-ilbc,--disable-ilbc) \
121 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-ilbcwebrtc),--enable-ilbc-webrtc,--disable-ilbc-webrtc) \
122 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-mysqldb),--with-mysql=yes,--without-mysql) \
123 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-openssl),--with-openssl,--without-openssl) \
124 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-pgsqldb),--with-libpq="$(STAGING_DIR)/usr",--without-libpq) \
125 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-speexcodec),--with-libspeex="$(STAGING_DIR)/usr/include",--without-libspeex) \
126 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-sqlitedb),--with-sqlite,--without-sqlite) \
127 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-zapcard),,--disable-dahdi --disable-zaptel) \
128 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-zlibcompress),--with-zlib="$(STAGING_DIR)/usr",--without-zlib)
129
130 # The regexp implementation of musl 1.1.24 is not fully compatible with yate
131 CONFIGURE_ARGS+= \
132 --enable-internalregex
133
134 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-isaccodec),)
135 CONFIGURE_ARGS+=$(if $(CONFIG_SOFT_FLOAT),--disable-isac-float --enable-isac-fixed,--disable-isac-fixed --enable-isac-float)
136 else
137 CONFIGURE_ARGS+= \
138 --disable-isac-fixed \
139 --disable-isac-float
140 endif
141
142 define Package/$(PKG_NAME)/install
143 $(INSTALL_DIR) $(1)/usr/lib
144
145 for yatelib in "" asn sig mgcp jabber script; do \
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyate$$$${yatelib}.so* $(1)/usr/lib ;\
147 done
148
149 $(INSTALL_DIR) $(1)/usr/bin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yate $(1)/usr/bin/
151 $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
152 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/yate/yate.conf $(1)/etc/$(PKG_NAME)/yate.conf
153 $(INSTALL_DIR) $(1)/etc/init.d
154 $(INSTALL_BIN) ./files/yate.init $(1)/etc/init.d/yate
155 endef
156
157 define Package/$(PKG_NAME)-scripts-perl/install
158 $(INSTALL_DIR) $(1)/usr/share/yate/scripts
159 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/Yate.pm $(1)/usr/share/yate/scripts/
160 $(INSTALL_BIN) ./files/banbrutes.pl $(1)/usr/share/yate/scripts/
161 endef
162
163 define Package/$(PKG_NAME)-sounds/install
164 $(INSTALL_DIR) $(1)/usr/share/yate/sounds
165 $(CP) $(PKG_INSTALL_DIR)/usr/share/yate/sounds/ $(1)/usr/share/yate/
166 endef
167
168 define Build/InstallDev
169 $(INSTALL_DIR) $(STAGING_DIR)/usr/include
170 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(STAGING_DIR)/usr/include/
171 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib/
173 endef
174
175 define BuildPlugin
176 define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))
177 $(call Package/yate/Default)
178 DEPENDS:= $(PKG_NAME) $(patsubst +%,+PACKAGE_$(PKG_NAME)-mod-$(subst _,-,$(1)):%,$(4))
179 TITLE:=$(3)
180 endef
181
182 define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))/conffiles
183 $(if $(6),/etc/yate/$(1).conf)
184 endef
185
186 define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))/description
187 $(3) module for $(PKG_NAME)
188 endef
189
190 define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))/install
191 $$(INSTALL_DIR) $$(1)/usr/lib/yate/$(2)
192 $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/lib/yate/$(2)/$(1).yate $$(1)/usr/lib/yate/$(2)/$(1).yate
193 if [ -f $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf ]; then \
194 $$(INSTALL_DIR) $$(1)/etc/yate ;\
195 $$(INSTALL_CONF) $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf $$(1)/etc/yate/ ;\
196 fi
197 $(if $(5),$(foreach extra_file,$(5),\
198 $(INSTALL_DIR) $$(1)$(dir $(extra_file)) ; \
199 $(CP) $(PKG_INSTALL_DIR)$(extra_file) $$(1)$(extra_file) ; \
200 ),)
201 endef
202
203 $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(subst _,-,$(1))))
204 endef
205
206 $(eval $(call BuildPackage,$(PKG_NAME)))
207 $(eval $(call BuildPackage,$(PKG_NAME)-scripts-perl))
208 $(eval $(call BuildPackage,$(PKG_NAME)-sounds))
209
210 ############################
211 # 1: plugin
212 # 2: client, server or empty
213 # 3: description
214 # 4: depends
215 # 5: extra files
216 # 6: has a config sample (y)
217 # ##########################
218 $(eval $(call BuildPlugin,accfile,server,SIP or H.323 client (from file),,,y))
219 $(eval $(call BuildPlugin,alsachan,client,ALSA Sound Channel,+alsa-lib))
220 $(eval $(call BuildPlugin,amrnbcodec,,AMR-NB Codec,@BROKEN)) # Missing amr-nb library
221 $(eval $(call BuildPlugin,analog,server,Analog (e.g. POTS) Channel,,,y))
222 $(eval $(call BuildPlugin,analogdetect,server,Analog Data Detector,))
223 $(eval $(call BuildPlugin,analyzer,,Test Call Generator and AQ Analyzer,))
224 $(eval $(call BuildPlugin,cache,server,CNAM and LNP memory caches,,,y))
225 $(eval $(call BuildPlugin,callcounters,server,Count Active Call Legs,,,y))
226 $(eval $(call BuildPlugin,callfork,,Call Forker,,,y))
227 $(eval $(call BuildPlugin,callgen,,Call Generator,))
228 $(eval $(call BuildPlugin,camel_map,sig,MAP/CAMEL TCAP <-> XML translators,,,y))
229 $(eval $(call BuildPlugin,ccongestion,server,Accept Status from Installed Engine Monitors,,,y))
230 $(eval $(call BuildPlugin,cdrbuild,,Call Detail Record Builder,,,y))
231 $(eval $(call BuildPlugin,cdrcombine,,Call Detail Records per call instead of per call leg,))
232 $(eval $(call BuildPlugin,cdrfile,,Call Detail Record to File,,,y))
233 $(eval $(call BuildPlugin,ciscosm,server,SS7 Support,,,y))
234 $(eval $(call BuildPlugin,clustering,server,Clustering Server Support,,,y))
235 $(eval $(call BuildPlugin,conference,,Conference Room Mixer,))
236 $(eval $(call BuildPlugin,cpuload,server,Monitor CPU load and Inform Yate,,,y))
237 $(eval $(call BuildPlugin,dbpbx,server,PBX IVR and Multi-routing from Database,,,y))
238 $(eval $(call BuildPlugin,dbwave,server,Wav Media for DB Storage,+$(PKG_NAME)-mod-wavefile))
239 $(eval $(call BuildPlugin,dumbchan,,Dummy Channel,))
240 $(eval $(call BuildPlugin,enumroute,,ENUM Routing,,,y))
241 $(eval $(call BuildPlugin,eventlogs,server,Write events and alarms to log files,,,y))
242 $(eval $(call BuildPlugin,extmodule,,External Module Handler,,/usr/share/yate/scripts/echo.sh,y))
243 $(eval $(call BuildPlugin,faxchan,,Spandsp Fax Channel,+libspandsp))
244 $(eval $(call BuildPlugin,fileinfo,,File Info Holder,,,y))
245 $(eval $(call BuildPlugin,filetransfer,,File Transfer Driver,,,y))
246 $(eval $(call BuildPlugin,g722webrtc,,G.722 codec using library based on WebRTC project,))
247 $(eval $(call BuildPlugin,gvoice,,Google Voice support,,,y))
248 $(eval $(call BuildPlugin,heartbeat,server,Linux-HA compatible heartbeat,,,y))
249 $(eval $(call BuildPlugin,ilbccodec,,iLBC Codec,))
250 $(eval $(call BuildPlugin,ilbcwebrtc,,iLBC Codec from the WebRTC project,))
251 $(eval $(call BuildPlugin,isaccodec,,internet Speech Audio Codec,))
252 $(eval $(call BuildPlugin,isupmangler,sig,ISUP parameter mangling in a STP,,,y))
253 $(eval $(call BuildPlugin,jabberclient,client,Jabber Client,,,y))
254 $(eval $(call BuildPlugin,jabberserver,jabber,Jabber Server,,,y))
255 $(eval $(call BuildPlugin,javascript,,Routing using the embedded Javascript language,,,y))
256 $(eval $(call BuildPlugin,jbfeatures,jabber,Jabber Server Features,,,y))
257 $(eval $(call BuildPlugin,lateroute,server,Last Chance Routing,,,y))
258 $(eval $(call BuildPlugin,mgcpca,server,Media Gateway Control Protocol Agent,,,y))
259 $(eval $(call BuildPlugin,mgcpgw,server,Media Gateway Control Protocol Gateway,,,y))
260 $(eval $(call BuildPlugin,moh,,On Hold (music) Generator,,,y))
261 $(eval $(call BuildPlugin,monitoring,server,Monitoring/gathering Information,,,y))
262 $(eval $(call BuildPlugin,mrcpspeech,server,MRCP v2 Voice/Tone Detector and Synthesizer,))
263 $(eval $(call BuildPlugin,msgsniff,,Sample Message Sniffer,))
264 $(eval $(call BuildPlugin,mux,,Data Multiplexor,,,y))
265 $(eval $(call BuildPlugin,mysqldb,server,MySQL Backend DB,+libmysqlclient-r,,y))
266 $(eval $(call BuildPlugin,openssl,,Encrypted transport (OpenSSL),+libopenssl,,y))
267 $(eval $(call BuildPlugin,osschan,client,OSS Sound Channel,))
268 $(eval $(call BuildPlugin,park,server,Call Parking,))
269 $(eval $(call BuildPlugin,pbx,,PBX Message Handlers,))
270 $(eval $(call BuildPlugin,pbxassist,server,Full featured PBX and IVR,,,y))
271 $(eval $(call BuildPlugin,pgsqldb,server,PostgrestSQL Backend DB,+libpq))
272 $(eval $(call BuildPlugin,presence,server,Presence,,,y))
273 $(eval $(call BuildPlugin,queues,server,Call Distribution and Queues from Database,,,y))
274 $(eval $(call BuildPlugin,queuesnotify,server,Notify when queued call status changes,,,y))
275 $(eval $(call BuildPlugin,regexroute,,Regular Expression Based Routing,,,y))
276 $(eval $(call BuildPlugin,regfile,server,Registration based on users in file,,,y))
277 $(eval $(call BuildPlugin,register,server,Call Detail Record to a database,,,y))
278 $(eval $(call BuildPlugin,rmanager,,Yate Remote Management,,,y))
279 $(eval $(call BuildPlugin,sigtransport,server,SIGTRAN (SS7 over IP) connection provider,,,y))
280 $(eval $(call BuildPlugin,sip_cnam_lnp,sip,Query CNAM and LNP databases using SIP INVITE,,,y))
281 $(eval $(call BuildPlugin,sipfeatures,server,SIP Features (SUBSCRIBE/NOTIFY),,,y))
282 $(eval $(call BuildPlugin,speexcodec,,Speex codec module written by Olaf Conradi,+libspeex))
283 $(eval $(call BuildPlugin,sqlitedb,server,SQLite Support,+libsqlite3,,y))
284 $(eval $(call BuildPlugin,ss7_lnp_ansi,sig,Query LNP Databases,,,y))
285 $(eval $(call BuildPlugin,subscription,server,Subcription handler and presence notifier,,,y))
286 $(eval $(call BuildPlugin,tdmcard,server,TDM Cards Signalling and Data Driver,@BROKEN)) # Missing TDM libraries
287 $(eval $(call BuildPlugin,tonedetect,,Detectors for Various Tones,))
288 $(eval $(call BuildPlugin,tonegen,,Tones Generator,,,y))
289 $(eval $(call BuildPlugin,users,server,Users,,,y))
290 $(eval $(call BuildPlugin,wavefile,,Wav file Record and Playback,))
291 $(eval $(call BuildPlugin,wiresniff,,Capture interface for YATE messages,,,y))
292 $(eval $(call BuildPlugin,wpcard,server,Wanpipe PRI cards Signalling and Data Driver,@BROKEN)) # Mising wanpipe and PRI libraries
293 $(eval $(call BuildPlugin,yiaxchan,,IAX Channel,,,y))
294 $(eval $(call BuildPlugin,yjinglechan,,Jingle Channel,,,y))
295 $(eval $(call BuildPlugin,yradius,server,RADIUS Client,,,y))
296 $(eval $(call BuildPlugin,yrtpchan,,RTP Channel and Other Data Helper,,,y))
297 $(eval $(call BuildPlugin,ysigchan,server,SS7/ISDN Protocols - Yate Signalling Library,,,y))
298 $(eval $(call BuildPlugin,ysipchan,,SIP Channel,,,y))
299 $(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,y))
300 $(eval $(call BuildPlugin,ysockschan,,SOCKS Channel,,,y))
301 $(eval $(call BuildPlugin,ystunchan,,STUN Support,,,y))
302 $(eval $(call BuildPlugin,zapcard,server,Zaptel PRI/TDM/FXS/FXO cards,@!aarch64 +kmod-dahdi,,y))
303 $(eval $(call BuildPlugin,zlibcompress,,Zlib Compression,+zlib,,y))