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