[packages] add opensips (openser fork)
[openwrt/svn-archive/archive.git] / net / opensips / Makefile
1 #
2 # Copyright (C) 2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=opensips
11 PKG_VERSION:=1.5.3
12 PKG_RELEASE:=1
13 PKG_VARIANT:=-tls
14
15 PKG_SOURCE_URL:=http://opensips.org/pub/opensips/$(PKG_VERSION)/src
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
17 PKG_MD5SUM:=8a03167420c31da15405bed7630ed3e2
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)
20
21 PKG_BUILD_DEPENDS:=curl expat libxml2 mysql openldap openssl pcre postgresql radiusclient-ng
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/opensips/Default
26 SECTION:=net
27 CATEGORY:=Network
28 URL:=http://www.opensips.org/
29 endef
30
31
32 define Package/opensips
33 $(call Package/opensips/Default)
34 TITLE:=Open SIP Server
35 MENU:=1
36 endef
37
38 define Package/opensips-example
39 $(call Package/opensips/Default)
40 TITLE:=OpenSIPS example config
41 DEPENDS:=opensips \
42 +opensips-mod-acc \
43 +opensips-mod-maxfwd \
44 +opensips-mod-mi-fifo \
45 +opensips-mod-registrar \
46 +opensips-mod-rr \
47 +opensips-mod-signaling \
48 +opensips-mod-sl \
49 +opensips-mod-textops \
50 +opensips-mod-tm \
51 +opensips-mod-uri \
52 +opensips-mod-uri-db \
53 +opensips-mod-usrloc \
54 +opensips-mod-xlog
55 endef
56
57 define Package/opensips-example/conffiles
58 /etc/default/opensips
59 /etc/opensips/opensips.cfg
60 endef
61
62
63 define Package/opensips-tools
64 $(call Package/opensips/Default)
65 TITLE:=OpenSIPS control tools
66 DEPENDS:=opensips
67 endef
68
69 define Package/opensips-tools/conffiles
70 /etc/opensips/opensipsctlrc
71 endef
72
73
74 PKG_EXCL_MODULES:= \
75 auth_diameter \
76 carrierroute \
77 db_berkeley \
78 db_oracle \
79 db_unixodbc \
80 mediaproxy \
81 mi_xmlrpc \
82 mmgeoip \
83 osp \
84 perl \
85 perlvdb \
86 snmpstats \
87
88 PKG_MAKE_ARGS:= \
89 cfg-dir="etc/opensips/" \
90 bin-dir="usr/sbin/" \
91 data-dir="var/lib/opensips/" \
92 lib-dir="usr/lib/opensips/" \
93 modules-dir="usr/lib/opensips/modules/" \
94 exclude_modules="$(PKG_EXCL_MODULES)" \
95
96
97 define Build/Compile
98 $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \
99 prefix=/ \
100 extra_defs="-DUSE_PTHREAD_MUTEX " \
101 CC="$(TARGET_CC)" \
102 ARCH="$(ARCH)" \
103 CFLAGS="$(TARGET_CFLAGS)" \
104 ISSMP="no" \
105 LOCALBASE="$(STAGING_DIR)/usr" \
106 SYSBASE="$(STAGING_DIR)/usr" \
107 PCRECFG= \
108 all
109 $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 install
112 endef
113
114 define Package/opensips/install
115 $(INSTALL_DIR) $(1)/usr/sbin
116 $(CP) \
117 $(PKG_INSTALL_DIR)/usr/sbin/opensips \
118 $(1)/usr/sbin/
119 $(INSTALL_DIR) $(1)/usr/lib/opensips/modules
120 endef
121
122 define Package/opensips-example/install
123 $(INSTALL_DIR) $(1)/etc/opensips
124 $(CP) \
125 $(PKG_INSTALL_DIR)/etc/opensips/opensips.cfg \
126 $(1)/etc/opensips/
127 $(SED) 's,$(PKG_INSTALL_DIR),,g' \
128 $(1)/etc/opensips/opensips.cfg
129 $(INSTALL_DIR) $(1)/etc/default
130 $(INSTALL_DATA) ./files/opensips.default $(1)/etc/default/opensips
131 $(INSTALL_DIR) $(1)/etc/init.d
132 $(INSTALL_BIN) ./files/opensips.init $(1)/etc/init.d/opensips
133 endef
134
135 define Package/opensips-tools/install
136 $(INSTALL_DIR) $(1)/etc/opensips
137 $(CP) \
138 $(PKG_INSTALL_DIR)/etc/opensips/opensipsctlrc \
139 $(1)/etc/opensips/
140 $(INSTALL_DIR) $(1)/usr/sbin
141 $(CP) \
142 $(PKG_INSTALL_DIR)/usr/sbin/opensips{ctl,dbctl,unix} \
143 $(1)/usr/sbin/
144 $(INSTALL_DIR) $(1)/usr/lib/opensips
145 $(CP) \
146 $(PKG_INSTALL_DIR)/usr/lib/opensips/opensipsctl \
147 $(1)/usr/lib/opensips/
148 $(SED) 's,/bin/bash,/bin/sh,g' \
149 -e 's,$(PKG_INSTALL_DIR),,g' \
150 $(1)/usr/sbin/opensips{ctl,dbctl}
151 endef
152
153 define BuildPlugin
154 define Package/opensips-mod-$(1)
155 $$(call Package/opensips/Default)
156 TITLE:= OpenSIPS $(3) module
157 DEPENDS:=opensips $$(foreach m,$(4),+opensips-mod-$$m) $(5)
158 endef
159
160 define Package/opensips-mod-$(1)/install
161 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/opensips/modules/
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensips/modules/$(2).so \
163 $$(1)/usr/lib/opensips/modules/ ;
164 endef
165
166 $$(eval $$(call BuildPackage,opensips-mod-$(1)))
167 endef
168
169 $(eval $(call BuildPackage,opensips))
170 $(eval $(call BuildPackage,opensips-example))
171 $(eval $(call BuildPackage,opensips-tools))
172 $(eval $(call BuildPlugin,acc,acc,Accounting,tm,))
173 $(eval $(call BuildPlugin,alias-db,alias_db,Database-backend aliases,,))
174 $(eval $(call BuildPlugin,auth,auth,Authentication Framework,signaling,))
175 $(eval $(call BuildPlugin,auth-db,auth_db,Database-backend authentication,auth,))
176 $(eval $(call BuildPlugin,auth-radius,auth_radius,RADIUS-backend authentication,auth,+libradiusclient-ng))
177 $(eval $(call BuildPlugin,avp-radius,avp_radius,RADIUS-backend for AVP loading,,+libradiusclient-ng))
178 $(eval $(call BuildPlugin,avpops,avpops,AVP operation,,))
179 $(eval $(call BuildPlugin,benchmark,benchmark,Config benchmark,,))
180 $(eval $(call BuildPlugin,call-control,call_control,Prepair application,dialog,))
181 #$(eval $(call BuildPlugin,carrierroute,carrierroute,Carrier Routing,,+libconfuse))
182 $(eval $(call BuildPlugin,cfgutils,cfgutils,Config utilities,,))
183 $(eval $(call BuildPlugin,closeddial,closeddial,PBX-like features,,))
184 $(eval $(call BuildPlugin,cpl-c,cpl-c,Call Processing language interpreter,tm sl usrloc,+libxml2))
185 #$(eval $(call BuildPlugin,db-berkeley,db_berkeley,Berkeley DB Database-backend,,))
186 $(eval $(call BuildPlugin,db-flatstore,db_flatstore,Fast writing-only text database-backed,,))
187 $(eval $(call BuildPlugin,db-mysql,db_mysql,MySQL database-backend,,+libmysqlclient))
188 #$(eval $(call BuildPlugin,db-oracle,db_oracle,Oracle Database-backend,,))
189 $(eval $(call BuildPlugin,db-postgres,db_postgres,PostgreSQL Database-backend,,+libpq))
190 $(eval $(call BuildPlugin,db-text,db_text,Text database-backend,,))
191 #$(eval $(call BuildPlugin,db-unixodbc,db_unixodbc,UnixODBC Database-backend,,))
192 $(eval $(call BuildPlugin,dialog,dialog,Dialog support,rr tm,))
193 $(eval $(call BuildPlugin,dialplan,dialplan,Dialplan management,,))
194 $(eval $(call BuildPlugin,dispatcher,dispatcher,Dispatcher,,))
195 $(eval $(call BuildPlugin,diversion,diversion,Diversion header insertion,,))
196 $(eval $(call BuildPlugin,domain,domain,Multi-domain support,,))
197 $(eval $(call BuildPlugin,domainpolicy,domainpolicy,Domain policy,,))
198 $(eval $(call BuildPlugin,drouting,drouting,Dynaming routing,,))
199 $(eval $(call BuildPlugin,enum,enum,ENUM lookup,,))
200 $(eval $(call BuildPlugin,exec,exec,External exec,,))
201 $(eval $(call BuildPlugin,gflags,gflags,Global shared flags,,))
202 $(eval $(call BuildPlugin,group,group,Database-backend user-groups,,))
203 $(eval $(call BuildPlugin,group-radius,group_radius,RADIUS-backend user-groups,,))
204 $(eval $(call BuildPlugin,h350,h350,H.350,ldap,+libopenldap))
205 $(eval $(call BuildPlugin,identity,identity,Identity,,+libopenssl))
206 $(eval $(call BuildPlugin,imc,imc,IM conferencing,db-mysql tm,))
207 $(eval $(call BuildPlugin,jabber,jabber,Jabber,tm,+libexpat))
208 $(eval $(call BuildPlugin,lcr,lcr,Least Cost Routing,tm,))
209 $(eval $(call BuildPlugin,ldap,ldap,LDAP connector,,+libopenldap))
210 $(eval $(call BuildPlugin,load_balancer,load_balancer,Load balancer,dialog,))
211 $(eval $(call BuildPlugin,localcache,localcache,Local cache,,))
212 $(eval $(call BuildPlugin,mangler,mangler,SIP mangler,,))
213 $(eval $(call BuildPlugin,maxfwd,maxfwd,Max-Forward processor,,))
214 $(eval $(call BuildPlugin,mi-datagram,mi_datagram,Datagram support for Management Interface,,))
215 $(eval $(call BuildPlugin,mi-fifo,mi_fifo,FIFO support for Management Interface,,))
216 #$(eval $(call BuildPlugin,mi-xmlrpc,mi_xmlrpc,XML-RPC support for Management Interface,,+xmlrpc-c))
217 #$(eval $(call BuildPlugin,mediaproxy,mediaproxy,NAT traversal,,+mediaproxy))
218 #$(eval $(call BuildPlugin,mmgeoip,mmgeoip,MaxMind GeoIP,,+libgeoip))
219 $(eval $(call BuildPlugin,msilo,msilo,SIP message silo,tm,))
220 $(eval $(call BuildPlugin,nat_traversal,nat_traversal,NAT traversal,dialog sl tm,))
221 $(eval $(call BuildPlugin,nathelper,nathelper,NAT traversal helper,,+rtpproxy))
222 $(eval $(call BuildPlugin,options,options,OPTIONS server replier,sl,))
223 #$(eval $(call BuildPlugin,osp,osp,OSP peering,auth rr sl tm textops,+libosp))
224 $(eval $(call BuildPlugin,path,path,SIP path insertion,rr,))
225 $(eval $(call BuildPlugin,pdt,pdt,Prefix-to-Domain translator,,))
226 $(eval $(call BuildPlugin,peering,peering,Perring,,+libradiusclient-ng))
227 #$(eval $(call BuildPlugin,perl,perl,Perl,sl,+perl))
228 #$(eval $(call BuildPlugin,perlvdb,perlvdb,Perl Virtual DB,perl,))
229 $(eval $(call BuildPlugin,permissions,permissions,Permissions control,,))
230 $(eval $(call BuildPlugin,pike,pike,Flood detector,,))
231 $(eval $(call BuildPlugin,presence,presence,Presence server,signaling,+libxml2))
232 $(eval $(call BuildPlugin,presence-dialoginfo,presence_dialoginfo,Dialog Event presence,presence,))
233 $(eval $(call BuildPlugin,presence-mwi,presence_mwi,Message Waiting Indication presence,presence,))
234 $(eval $(call BuildPlugin,presence-xcapdiff,presence_xcapdiff,XCAP-Diff presence,presence pua,))
235 $(eval $(call BuildPlugin,presence-xml,presence_xml,XCAP presence,presence xcap-client,))
236 $(eval $(call BuildPlugin,pua,pua,Presence User Agent,tm,+libxml2))
237 $(eval $(call BuildPlugin,pua-bla,pua_bla,Bridged Line Appearence PUA,presence pua usrloc,))
238 $(eval $(call BuildPlugin,pua-dialoginfo,pua_dialoginfo,Dialog Event PUA,dialog pua,))
239 $(eval $(call BuildPlugin,pua-mi,pua_mi,PUA Management Interface,pua,))
240 $(eval $(call BuildPlugin,pua-usrloc,pua_usrloc,PUA User Location,pua usrloc,))
241 $(eval $(call BuildPlugin,pua-xmpp,pua_xmpp,PUA XMPP,presence pua xmpp,))
242 $(eval $(call BuildPlugin,qos,qos,QoS control,dialog,))
243 $(eval $(call BuildPlugin,ratelimit,ratelimit,Traffic shapping,,))
244 $(eval $(call BuildPlugin,regex,regex,Regular Expression,,+libpcre))
245 $(eval $(call BuildPlugin,registrar,registrar,SIP Registrar,signaling usrloc,))
246 $(eval $(call BuildPlugin,rls,rls,Resource List Server,presence pua signaling tm,+libxml2))
247 $(eval $(call BuildPlugin,rr,rr,Record-Route and Route,,))
248 $(eval $(call BuildPlugin,seas,seas,SIP Express Application Server,tm,))
249 $(eval $(call BuildPlugin,signaling,signaling,Signaling,sl tm,))
250 $(eval $(call BuildPlugin,siptrace,siptrace,SIP trace,,))
251 $(eval $(call BuildPlugin,sl,sl,Stateless replier,,))
252 $(eval $(call BuildPlugin,sms,sms,SIP-to-SMS IM gateway,tm,))
253 #$(eval $(call BuildPlugin,snmpstats,snmpstats,SNMP,presence usrloc,+libnetsnmp))
254 $(eval $(call BuildPlugin,speeddial,speeddial,Per-user speed-dial controller,,))
255 $(eval $(call BuildPlugin,statistics,statistics,Script statistics,,))
256 $(eval $(call BuildPlugin,sst,sst,SIP Session Timer,dialog sl,))
257 $(eval $(call BuildPlugin,textops,textops,Text operations,,))
258 $(eval $(call BuildPlugin,tlsops,tlsops,TLS operations,,+libopenssl))
259 $(eval $(call BuildPlugin,tm,tm,Transaction,,))
260 $(eval $(call BuildPlugin,uac,uac,User Agent Client,tm,))
261 $(eval $(call BuildPlugin,uac-redirect,uac_redirect,User Agent Client redirection,tm,))
262 $(eval $(call BuildPlugin,uri,uri,Generic URI operation,,))
263 $(eval $(call BuildPlugin,uri-db,uri_db,Database-backend SIP URI checking,,))
264 $(eval $(call BuildPlugin,uri-radius,uri_radius,RADIUS-backend SIP URI checking,,+libradiusclient-ng))
265 $(eval $(call BuildPlugin,userblacklist,userblacklist,User blacklists,,))
266 $(eval $(call BuildPlugin,usrloc,usrloc,User location,,))
267 $(eval $(call BuildPlugin,xcap-client,xcap_client,XCAP Client,,+libcurl +libxml2))
268 $(eval $(call BuildPlugin,xlog,xlog,Advanced logger,,))
269 $(eval $(call BuildPlugin,xmpp,xmpp,SIP-to-XMPP Gateway,tm,+libexpat))