Update sipp to 3.1 (#3652)
[openwrt/svn-archive/archive.git] / net / openser / Makefile
1 #
2 # Copyright (C) 2006 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:=openser
12 PKG_VERSION:=1.0.1
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=eebc16665003ee92daf96b216d6f9563
15 # PKG_VARIANT:=-tls # for tls version
16 PKG_VARIANT:=
17
18 PKG_SOURCE_URL:=http://openser.org/pub/openser/$(PKG_VERSION)/src
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/openser
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=Configurable, free SIP server
30 URL:=http://www.openser.org
31 MENU:=1
32 endef
33
34 define Package/openser/conffiles
35 /etc/openser/openser.cfg
36 endef
37
38 define Package/openser-mod-acc
39 SECTION:=net
40 CATEGORY:=Network
41 DEPENDS:=openser
42 TITLE:=Accounting support
43 MENU:=0
44 endef
45
46 define Package/openser-mod-auth
47 SECTION:=net
48 CATEGORY:=Network
49 DEPENDS:=openser
50 TITLE:=Authentication support
51 endef
52
53 define Package/openser-mod-auth-db
54 SECTION:=net
55 CATEGORY:=Network
56 DEPENDS:=openser
57 TITLE:=Authentication with database support
58 endef
59
60 define Package/openser-mod-auth-radius
61 SECTION:=net
62 CATEGORY:=Network
63 DEPENDS:=openser +libradiusclient-ng
64 TITLE:=Authentication with RADIUS support
65 endef
66
67 define Package/openser-mod-avp-radius
68 SECTION:=net
69 CATEGORY:=Network
70 DEPENDS:=openser +libradiusclient-ng
71 TITLE:=AVP with RADIUS support
72 endef
73
74 define Package/openser-mod-avpops
75 SECTION:=net
76 CATEGORY:=Network
77 DEPENDS:=openser
78 TITLE:=AVP options support
79 endef
80
81 define Package/openser-mod-dispatcher
82 SECTION:=net
83 CATEGORY:=Network
84 DEPENDS:=openser
85 TITLE:=Dispatcher support
86 endef
87
88 define Package/openser-mod-diversion
89 SECTION:=net
90 CATEGORY:=Network
91 DEPENDS:=openser
92 TITLE:=Diversion support
93 endef
94
95 define Package/openser-mod-flatstore
96 SECTION:=net
97 CATEGORY:=Network
98 DEPENDS:=openser
99 TITLE:=Flatstore support
100 endef
101
102 define Package/openser-mod-gflags
103 SECTION:=net
104 CATEGORY:=Network
105 DEPENDS:=openser
106 TITLE:=Gflags support
107 endef
108
109 define Package/openser-mod-group
110 SECTION:=net
111 CATEGORY:=Network
112 DEPENDS:=openser
113 TITLE:=Group support
114 endef
115
116 define Package/openser-mod-group-radius
117 SECTION:=net
118 CATEGORY:=Network
119 DEPENDS:=openser +libradiusclient-ng
120 TITLE:=Group with RADIUS support
121 endef
122
123 define Package/openser-mod-lcr
124 SECTION:=net
125 CATEGORY:=Network
126 DEPENDS:=openser openser-mod-mysql
127 TITLE:=Least Cost Routing support
128 endef
129
130 define Package/openser-mod-mediaproxy
131 SECTION:=net
132 CATEGORY:=Network
133 DEPENDS:=openser
134 TITLE:=Mediaproxy support
135 endef
136
137 define Package/openser-mod-msilo
138 SECTION:=net
139 CATEGORY:=Network
140 DEPENDS:=openser
141 TITLE:=MSilo support
142 endef
143
144 define Package/openser-mod-mysql
145 SECTION:=net
146 CATEGORY:=Network
147 DEPENDS:=openser +libmysqlclient
148 TITLE:=MySQL support
149 endef
150
151 define Package/openser-mod-nathelper
152 SECTION:=net
153 CATEGORY:=Network
154 DEPENDS:=openser
155 TITLE:=NAT helper support
156 endef
157
158 define Package/openser-mod-options
159 SECTION:=net
160 CATEGORY:=Network
161 DEPENDS:=openser
162 TITLE:=Options support
163 endef
164
165 define Package/openser-mod-pdt
166 SECTION:=net
167 CATEGORY:=Network
168 DEPENDS:=openser
169 TITLE:=PDT support
170 endef
171
172 define Package/openser-mod-permissions
173 SECTION:=net
174 CATEGORY:=Network
175 DEPENDS:=openser
176 TITLE:=Permissions support
177 endef
178
179 define Package/openser-mod-pike
180 SECTION:=net
181 CATEGORY:=Network
182 DEPENDS:=openser
183 TITLE:=PIKE support
184 endef
185
186 define Package/openser-mod-sms
187 SECTION:=net
188 CATEGORY:=Network
189 DEPENDS:=openser
190 TITLE:=SMS support
191 endef
192
193 define Package/openser-mod-speeddial
194 SECTION:=net
195 CATEGORY:=Network
196 DEPENDS:=openser
197 TITLE:=Speeddial supporte
198 endef
199
200 define Package/openser-mod-uac
201 SECTION:=net
202 CATEGORY:=Network
203 DEPENDS:=openser
204 TITLE:=UAC support
205 endef
206
207 define Package/openser-mod-uac-redirect
208 SECTION:=net
209 CATEGORY:=Network
210 DEPENDS:=openser
211 TITLE:=UAC with redirect support
212 endef
213
214 define Package/openser-mod-uri
215 SECTION:=net
216 CATEGORY:=Network
217 DEPENDS:=openser
218 TITLE:=URI support
219 endef
220
221 define Package/openser-mod-uri-db
222 SECTION:=net
223 CATEGORY:=Network
224 DEPENDS:=openser +openser-mod-mysql
225 TITLE:=URI with database support
226 endef
227
228 define Package/openser-mod-uri-radius
229 SECTION:=net
230 CATEGORY:=Network
231 DEPENDS:=openser +libradiusclient-ng
232 TITLE:=URI with RADIUS support
233 endef
234
235 define Package/openser-mod-xlog
236 SECTION:=net
237 CATEGORY:=Network
238 DEPENDS:=openser
239 TITLE:=Advanced logging support
240 endef
241
242 # Select here the modules for the ipk package
243 OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec
244
245 OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),modules/$(module)/$(module).so)
246 OPENSER_MODULES := $(patsubst %,modules/%,$(OPENSER_MODULES))
247
248 define Build/Compile
249 $(MAKE) -C $(PKG_BUILD_DIR) \
250 prefix=/ \
251 extra_defs="-DUSE_PTHREAD_MUTEX " \
252 CC="$(TARGET_CC)" \
253 ARCH="$(ARCH)" \
254 CFLAGS="$(TARGET_CFLAGS)" \
255 LOCALBASE="$(STAGING_DIR)/usr" \
256 all utils/gen_ha1/gen_ha1
257 endef
258
259 define Package/openser/install
260 mkdir -p $(1)/usr/sbin
261 $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
262 $(CP) $(PKG_BUILD_DIR)/utils/gen_ha1/gen_ha1 $(1)/usr/sbin/openser_gen_ha1
263 $(CP) $(PKG_BUILD_DIR)/scripts/sc $(1)/usr/sbin/openserctl
264 chmod 744 $(1)/usr/sbin/openserctl
265 $(CP) $(PKG_BUILD_DIR)/scripts/sc.dbtext $(1)/usr/sbin/dbtextctl
266 chmod 744 $(1)/usr/sbin/dbtextctl
267 mkdir -p $(1)/usr/lib/openser/modules
268 (cd $(PKG_BUILD_DIR);\
269 $(CP) $(OPENSER_MODULE_FILES) $(1)/usr/lib/openser/modules/; \
270 )
271 mkdir -p $(1)/etc/openser
272 $(CP) $(PKG_BUILD_DIR)/etc/openser.cfg $(1)/etc/openser/
273 endef
274
275 define BuildPlugin
276 define Package/$(1)/install
277 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/openser/modules/
278 $(CP) $(PKG_BUILD_DIR)/modules/$(2)/$(2).so \
279 $$(1)/usr/lib/openser/modules/ ;
280 endef
281
282 $$(eval $$(call BuildPackage,$(1)))
283 endef
284
285 $(eval $(call BuildPackage,openser))
286 $(eval $(call BuildPlugin,openser-mod-acc,acc))
287 $(eval $(call BuildPlugin,openser-mod-auth,auth))
288 $(eval $(call BuildPlugin,openser-mod-auth-db,auth_db))
289 $(eval $(call BuildPlugin,openser-mod-auth-radius,auth_radius))
290 $(eval $(call BuildPlugin,openser-mod-avp-radius,avp_radius))
291 $(eval $(call BuildPlugin,openser-mod-avpops,avpops))
292 $(eval $(call BuildPlugin,openser-mod-dispatcher,dispatcher))
293 $(eval $(call BuildPlugin,openser-mod-diversion,diversion))
294 $(eval $(call BuildPlugin,openser-mod-flatstore,flatstore))
295 $(eval $(call BuildPlugin,openser-mod-gflags,gflags))
296 $(eval $(call BuildPlugin,openser-mod-group,group))
297 $(eval $(call BuildPlugin,openser-mod-group-radius,group_radius))
298 $(eval $(call BuildPlugin,openser-mod-lcr,lcr))
299 $(eval $(call BuildPlugin,openser-mod-mediaproxy,mediaproxy))
300 $(eval $(call BuildPlugin,openser-mod-msilo,msilo))
301 $(eval $(call BuildPlugin,openser-mod-mysql,mysql))
302 $(eval $(call BuildPlugin,openser-mod-nathelper,nathelper))
303 $(eval $(call BuildPlugin,openser-mod-options,options))
304 $(eval $(call BuildPlugin,openser-mod-pdt,pdt))
305 $(eval $(call BuildPlugin,openser-mod-permissions,permissions))
306 $(eval $(call BuildPlugin,openser-mod-pike,pike))
307 $(eval $(call BuildPlugin,openser-mod-sms,sms))
308 $(eval $(call BuildPlugin,openser-mod-speeddial,speeddial))
309 $(eval $(call BuildPlugin,openser-mod-uac,uac))
310 $(eval $(call BuildPlugin,openser-mod-uac-redirect,uac_redirect))
311 $(eval $(call BuildPlugin,openser-mod-uri,uri))
312 $(eval $(call BuildPlugin,openser-mod-uri-db,uri_db))
313 $(eval $(call BuildPlugin,openser-mod-uri-radius,uri_radius))
314 $(eval $(call BuildPlugin,openser-mod-xlog,xlog))