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