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