[packages] glibmm: remove missing macros patch
[openwrt/svn-archive/archive.git] / net / strongswan4 / Makefile
1 #
2 # Copyright (C) 2010 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:=strongswan
11 PKG_VERSION:=4.3.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://download.strongswan.org/
16 PKG_MD5SUM:=02adcea934ef536e704d03c5d0f934f8
17
18 PKG_MOD_AVAILABLE:= \
19 aes \
20 agent \
21 attr \
22 attr-sql \
23 blowfish \
24 curl \
25 des \
26 dnskey \
27 eap-md5 \
28 eap-mschapv2 \
29 eap-radius \
30 fips-prf \
31 gcrypt \
32 gmp \
33 hmac \
34 kernel-klips \
35 kernel-netlink \
36 kernel-pfkey \
37 ldap \
38 load-tester \
39 md5 \
40 medcli \
41 medsrv \
42 mysql \
43 padlock \
44 pem \
45 pgp \
46 pkcs1 \
47 pubkey \
48 random \
49 resolve \
50 sha1 \
51 sha2 \
52 smp \
53 sql \
54 sqlite \
55 stroke \
56 uci \
57 updown \
58 x509 \
59 xcbc \
60
61 PKG_BUILD_DEPENDS:= \
62 clearsilver \
63 fcgi \
64
65 PKG_CONFIG_DEPENDS:= \
66 CONFIG_STRONGSWAN4_ENABLE_CISCO_QUIRKS \
67 CONFIG_STRONGSWAN4_ENABLE_NAT_TRANSPORT \
68 CONFIG_STRONGSWAN4_ENABLE_VENDOR_ID \
69 CONFIG_STRONGSWAN4_ENABLE_XAUTH_VID \
70 CONFIG_STRONGSWAN4_DEVICE_RANDOM \
71 CONFIG_STRONGSWAN4_DEVICE_URANDOM \
72 CONFIG_STRONGSWAN4_ROUTING_TABLE \
73 CONFIG_STRONGSWAN4_ROUTING_TABLE_PRIO \
74 $(patsubst %,CONFIG_PACKAGE_strongswan4-mod-%,$(PKG_MOD_AVAILABLE)) \
75
76 PKG_FIXUP:=libtool
77 PKG_INSTALL:=1
78 PKG_BUILD_PARALLEL:=1
79
80 include $(INCLUDE_DIR)/package.mk
81
82
83 define Package/strongswan4/Default
84 SUBMENU:=VPN
85 SECTION:=net
86 CATEGORY:=Network
87 TITLE:=StrongSwan
88 URL:=http://www.strongswan.org/
89 endef
90
91 define Package/strongswan4/description/Default
92 StrongSwan is an OpenSource IPsec implementation for the Linux
93 operating system.
94 endef
95
96
97 define Package/strongswan4
98 $(call Package/strongswan4/Default)
99 DEPENDS:= +libpthread +ip \
100 +kmod-crypto-authenc \
101 +kmod-ipsec +kmod-ipsec4 \
102 +kmod-ipt-ipsec +iptables-mod-ipsec
103 MENU:=1
104 endef
105
106 define Package/strongswan4/config
107 source "$(SOURCE)/Config.in"
108 endef
109
110 define Package/strongswan4/description
111 $(call Package/strongswan4/description/Default)
112 .
113 This package contains shared libraries and scripts.
114 endef
115
116
117 define Package/strongswan4-full
118 $(call Package/strongswan4/Default)
119 TITLE+= (full)
120 DEPENDS:= strongswan4 \
121 +strongswan4-app-charon \
122 +strongswan4-app-pluto \
123 +strongswan4-mod-aes \
124 +strongswan4-mod-agent \
125 +strongswan4-mod-attr \
126 +strongswan4-mod-attr-sql \
127 +strongswan4-mod-blowfish \
128 +strongswan4-mod-curl \
129 +strongswan4-mod-des \
130 +strongswan4-mod-dnskey \
131 +strongswan4-mod-eap-md5 \
132 +strongswan4-mod-eap-mschapv2 \
133 +strongswan4-mod-eap-radius \
134 +strongswan4-mod-fips-prf \
135 +strongswan4-mod-gcrypt \
136 +strongswan4-mod-gmp \
137 +strongswan4-mod-hmac \
138 +strongswan4-mod-kernel-klips \
139 +strongswan4-mod-kernel-netlink \
140 +strongswan4-mod-kernel-pfkey \
141 +strongswan4-mod-ldap \
142 +strongswan4-mod-load-tester \
143 +strongswan4-mod-md5 \
144 +strongswan4-mod-medcli \
145 +strongswan4-mod-medsrv \
146 +strongswan4-mod-mysql \
147 +TARGET_x86:strongswan4-mod-padlock \
148 +strongswan4-mod-pem \
149 +strongswan4-mod-pgp \
150 +strongswan4-mod-pkcs1 \
151 +strongswan4-mod-pubkey \
152 +strongswan4-mod-random \
153 +strongswan4-mod-resolve \
154 +strongswan4-mod-sha1 \
155 +strongswan4-mod-sha2 \
156 +strongswan4-mod-smp \
157 +strongswan4-mod-sql \
158 +strongswan4-mod-sqlite \
159 +strongswan4-mod-stroke \
160 +strongswan4-mod-uci \
161 +strongswan4-mod-updown \
162 +strongswan4-mod-x509 \
163 +strongswan4-mod-xcbc \
164 +strongswan4-utils
165 endef
166
167 define Package/strongswan4-full/description
168 $(call Package/strongswan4/description/Default)
169 .
170 This meta-package contains only dependencies for a complete setup.
171 endef
172
173
174 define Package/strongswan4-default
175 $(call Package/strongswan4/Default)
176 TITLE+= (default)
177 DEPENDS:= strongswan4 \
178 +strongswan4-app-charon \
179 +strongswan4-app-pluto \
180 +strongswan4-mod-aes \
181 +strongswan4-mod-attr \
182 +strongswan4-mod-des \
183 +strongswan4-mod-dnskey \
184 +strongswan4-mod-fips-prf \
185 +strongswan4-mod-gmp \
186 +strongswan4-mod-hmac \
187 +strongswan4-mod-md5 \
188 +strongswan4-mod-pem \
189 +strongswan4-mod-pgp \
190 +strongswan4-mod-pkcs1 \
191 +strongswan4-mod-pubkey \
192 +strongswan4-mod-random \
193 +strongswan4-mod-resolve \
194 +strongswan4-mod-sha1 \
195 +strongswan4-mod-sha2 \
196 +strongswan4-mod-stroke \
197 +strongswan4-mod-updown \
198 +strongswan4-mod-x509 \
199 +strongswan4-mod-xcbc \
200 +strongswan4-utils
201 endef
202
203 define Package/strongswan4-default/description
204 $(call Package/strongswan4/description/Default)
205 .
206 This meta-package contains only dependencies to match upstream
207 defaults.
208 endef
209
210
211 define Package/strongswan4-minimal
212 $(call Package/strongswan4/Default)
213 TITLE+= (minimal)
214 DEPENDS:= strongswan4 \
215 +strongswan4-app-charon \
216 +strongswan4-mod-aes \
217 +strongswan4-mod-gmp \
218 +strongswan4-mod-hmac \
219 +strongswan4-mod-pubkey \
220 +strongswan4-mod-random \
221 +strongswan4-mod-sha1 \
222 +strongswan4-mod-stroke \
223 +strongswan4-mod-updown \
224 +strongswan4-mod-x509 \
225 +strongswan4-mod-xcbc
226 endef
227
228 define Package/strongswan4-minimal/description
229 $(call Package/strongswan4/description/Default)
230 .
231 This meta-package contains only dependencies for a minimal setup.
232 endef
233
234
235 define Package/strongswan4-app-charon
236 $(call Package/strongswan4/Default)
237 TITLE+= IKEv2 keying daemon
238 DEPENDS:= strongswan4
239 endef
240
241 define Package/strongswan4-app-charon/description
242 $(call Package/strongswan4/description/Default)
243 .
244 This package contains charon, an IKEv2 keying daemon.
245 endef
246
247
248 define Package/strongswan4-app-pluto
249 $(call Package/strongswan4/Default)
250 TITLE+= IKEv1 keying daemon
251 DEPENDS:= strongswan4
252 endef
253
254 define Package/strongswan4-app-pluto/description
255 $(call Package/strongswan4/description/Default)
256 .
257 This package contains pluto, an IKEv1 keying daemon.
258 endef
259
260
261 define Package/strongswan4-utils
262 $(call Package/strongswan4/Default)
263 TITLE+= utilities
264 DEPENDS:= strongswan4
265 endef
266
267 define Package/strongswan4-utils/description
268 $(call Package/strongswan4/description/Default)
269 .
270 This package contains the openac, pki & scepclient utilities.
271 endef
272
273
274 # 1. Name
275 # 2. Title
276 # 3. Depends
277 define BuildPlugin
278 define Package/strongswan4-mod-$(1)
279 $$(call Package/strongswan4/Default)
280 TITLE:= StrongSwan $(2) plugin
281 DEPENDS:= strongswan4 $(3)
282 endef
283
284 define Package/strongswan4-mod-$(1)/install
285 $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
286 $(CP) \
287 $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
288 $$(1)/usr/lib/ipsec/plugins/ ;
289 $(call Plugin/$(1)/install,$$(1))
290 endef
291
292 $$(eval $$(call BuildPackage,strongswan4-mod-$(1)))
293 endef
294
295
296 CONFIGURE_ARGS+= \
297 $(if $(CONFIG_STRONGSWAN4_ENABLE_CISCO_QUIRKS),--enable-cisco-quirks,--disable-cisco-quirks) \
298 $(if $(CONFIG_STRONGSWAN4_ENABLE_NAT_TRANSPORT),--enable-nat-transport,--disable-nat-transport) \
299 $(if $(CONFIG_STRONGSWAN4_ENABLE_VENDOR_ID),--enable-vendor-id,--disable-vendor-id) \
300 $(if $(CONFIG_STRONGSWAN4_ENABLE_XAUTH_VID),--enable-xauth-vid,--disable-xauth-vid) \
301 --disable-scripts \
302 --disable-static \
303 $(if $(CONFIG_PACKAGE_strongswan4-utils),--enable-tools,--disable-tools) \
304 --with-random-device="$(call qstrip,$(CONFIG_STRONGSWAN4_DEVICE_RANDOM))" \
305 --with-urandom-device="$(call qstrip,$(CONFIG_STRONGSWAN4_DEVICE_URANDOM))" \
306 --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN4_ROUTING_TABLE))" \
307 --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN4_ROUTING_TABLE_PRIO))" \
308 $(foreach m,$(PKG_MOD_AVAILABLE), \
309 $(if $(CONFIG_PACKAGE_strongswan4-mod-$(m)),--enable-$(m),--disable-$(m)) \
310 ) \
311
312 EXTRA_CPPFLAGS+= -I$(STAGING_DIR)/usr/include/ClearSilver
313
314 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
315
316
317 define Package/strongswan4/conffiles
318 /etc/ipsec.conf
319 /etc/ipsec.secrets
320 /etc/strongswan.conf
321 endef
322
323 define Package/strongswan4/install
324 $(INSTALL_DIR) $(1)/etc
325 $(CP) -R $(PKG_INSTALL_DIR)/etc/ipsec.d $(1)/etc/
326 $(INSTALL_DIR) $(1)/usr/lib
327 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrongswan.so.* $(1)/usr/lib/
328 $(INSTALL_DIR) $(1)/usr/sbin
329 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
330 $(INSTALL_DIR) $(1)/usr/lib/ipsec
331 $(CP) \
332 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_copyright \
333 $(PKG_INSTALL_DIR)/usr/lib/ipsec/starter \
334 $(PKG_INSTALL_DIR)/usr/lib/ipsec/whack \
335 $(1)/usr/lib/ipsec/
336 $(INSTALL_CONF) \
337 ./files/ipsec.conf \
338 ./files/ipsec.secrets \
339 ./files/strongswan.conf \
340 $(1)/etc/
341 endef
342
343
344 define Package/strongswan4-default/install
345 true
346 endef
347
348
349 define Package/strongswan4-full/install
350 true
351 endef
352
353
354 define Package/strongswan4-minimal/install
355 true
356 endef
357
358
359 define Package/strongswan4-app-charon/install
360 $(INSTALL_DIR) $(1)/usr/lib/ipsec
361 $(CP) \
362 $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon \
363 $(PKG_INSTALL_DIR)/usr/lib/ipsec/stroke \
364 $(1)/usr/lib/ipsec/
365 endef
366
367
368 define Package/strongswan4-app-pluto/install
369 $(INSTALL_DIR) $(1)/usr/lib/ipsec
370 $(CP) \
371 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pluto \
372 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_pluto_adns \
373 $(1)/usr/lib/ipsec/
374 endef
375
376
377 define Package/strongswan4-utils/install
378 $(INSTALL_DIR) $(1)/usr/lib/ipsec
379 $(CP) \
380 $(PKG_INSTALL_DIR)/usr/lib/ipsec/openac \
381 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pki \
382 $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient \
383 $(1)/usr/lib/ipsec/
384 endef
385
386
387 define Plugin/attr-sql/install
388 $(INSTALL_DIR) $(1)/usr/lib/ipsec
389 $(CP) \
390 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool \
391 $(1)/usr/lib/ipsec/
392 endef
393
394 define Plugin/updown/install
395 $(INSTALL_DIR) $(1)/usr/lib/ipsec
396 $(CP) \
397 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown \
398 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown_espmark \
399 $(1)/usr/lib/ipsec/
400 endef
401
402
403 $(eval $(call BuildPackage,strongswan4))
404 $(eval $(call BuildPackage,strongswan4-default))
405 $(eval $(call BuildPackage,strongswan4-full))
406 $(eval $(call BuildPackage,strongswan4-minimal))
407 $(eval $(call BuildPackage,strongswan4-app-charon))
408 $(eval $(call BuildPackage,strongswan4-app-pluto))
409 $(eval $(call BuildPackage,strongswan4-utils))
410
411 $(eval $(call BuildPlugin,aes,AES crypto,))
412 $(eval $(call BuildPlugin,agent,SSH agent signing,))
413 $(eval $(call BuildPlugin,attr,File-based config attr,))
414 $(eval $(call BuildPlugin,attr-sql,SQL-based config attrib,+strongswan4-mod-sql))
415 $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
416 $(eval $(call BuildPlugin,curl,cURL,+libcurl))
417 $(eval $(call BuildPlugin,des,DES crypto,))
418 $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
419 $(eval $(call BuildPlugin,eap-md5,MD5 EAP (CHAP) auth,))
420 $(eval $(call BuildPlugin,eap-mschapv2,MS-CHAPv2 EAP auth,))
421 $(eval $(call BuildPlugin,eap-radius,RADIUS proxy auth,))
422 $(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,))
423 $(eval $(call BuildPlugin,gcrypt,libgcrypt,+libgcrypt))
424 $(eval $(call BuildPlugin,gmp,libgmp,+libgmp))
425 $(eval $(call BuildPlugin,hmac,HMAC crypto,))
426 $(eval $(call BuildPlugin,kernel-klips,KLIPS kernel interface,))
427 $(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
428 $(eval $(call BuildPlugin,kernel-pfkey,PK_KEY kernel interface,))
429 $(eval $(call BuildPlugin,ldap,LDAP,+libopenldap))
430 $(eval $(call BuildPlugin,load-tester,load testing,))
431 $(eval $(call BuildPlugin,md5,MD5 crypto,))
432 $(eval $(call BuildPlugin,medcli,mediation client configuration database,))
433 $(eval $(call BuildPlugin,medsrv,mediation server configuration database,))
434 $(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan4-mod-sql +PACKAGE_strongswan4-mod-mysql:libmysqlclient))
435 $(eval $(call BuildPlugin,padlock,VIA PadLock crypto,@TARGET_x86))
436 $(eval $(call BuildPlugin,pem,PEM decoding,))
437 $(eval $(call BuildPlugin,pgp,PGP key decoding,))
438 $(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
439 $(eval $(call BuildPlugin,pubkey,raw public key,))
440 $(eval $(call BuildPlugin,random,RNG,))
441 $(eval $(call BuildPlugin,resolve,DNS resolver,))
442 $(eval $(call BuildPlugin,sha1,SHA1 crypto,))
443 $(eval $(call BuildPlugin,sha2,SHA2 crypto,))
444 $(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan4-mod-smp:libxml2))
445 $(eval $(call BuildPlugin,sql,SQL database interface,))
446 $(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan4-mod-sql +PACKAGE_strongswan4-mod-sqlite:libsqlite3))
447 $(eval $(call BuildPlugin,stroke,Stroke,))
448 $(eval $(call BuildPlugin,uci,UCI config interface,+libuci))
449 $(eval $(call BuildPlugin,updown,updown firewall,))
450 $(eval $(call BuildPlugin,x509,x509 certificate,))
451 $(eval $(call BuildPlugin,xcbc,xcbc crypto,))