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