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