strongswan: update to 5.3.1, cleanup broken modules
[feed/packages.git] / net / strongswan / Makefile
1 #
2 # Copyright (C) 2012-2015 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:=5.3.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
16 PKG_MD5SUM:=66f258901a3d6c271da1a0c7fb3e5013
17 PKG_LICENSE:=GPL-2.0+
18 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
19
20 PKG_MOD_AVAILABLE:= \
21 addrblock \
22 aes \
23 af-alg \
24 agent \
25 attr \
26 attr-sql \
27 blowfish \
28 ccm \
29 cmac \
30 constraints \
31 coupling \
32 ctr \
33 curl \
34 des \
35 dhcp \
36 dnskey \
37 duplicheck \
38 eap-identity \
39 eap-md5 \
40 eap-mschapv2 \
41 eap-radius \
42 farp \
43 fips-prf \
44 gcm \
45 gcrypt \
46 gmp \
47 ha \
48 hmac \
49 kernel-libipsec \
50 kernel-netlink \
51 ldap \
52 led \
53 load-tester \
54 nonce \
55 md4 \
56 md5 \
57 mysql \
58 openssl \
59 pem \
60 pgp \
61 pkcs1 \
62 pkcs8 \
63 pkcs11 \
64 pubkey \
65 random \
66 resolve \
67 revocation \
68 sha1 \
69 sha2 \
70 smp \
71 socket-default \
72 socket-dynamic \
73 sqlite \
74 stroke \
75 test-vectors \
76 unity \
77 uci \
78 updown \
79 whitelist \
80 x509 \
81 xauth-eap \
82 xauth-generic \
83 xcbc
84
85 PKG_CONFIG_DEPENDS:= \
86 CONFIG_STRONGSWAN_ROUTING_TABLE \
87 CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
88 $(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \
89
90 PKG_FIXUP:=autoreconf
91 PKG_INSTALL:=1
92 PKG_BUILD_PARALLEL:=1
93
94 include $(INCLUDE_DIR)/package.mk
95
96 define Package/strongswan/Default
97 SUBMENU:=VPN
98 SECTION:=net
99 CATEGORY:=Network
100 TITLE:=StrongSwan
101 URL:=http://www.strongswan.org/
102 endef
103
104 define Package/strongswan/description/Default
105 StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
106 endef
107
108 define Package/strongswan
109 $(call Package/strongswan/Default)
110 DEPENDS:= +libpthread +ip \
111 +kmod-crypto-authenc \
112 +kmod-ipsec +kmod-ipsec4 +kmod-ipsec6 \
113 +kmod-ipt-ipsec +iptables-mod-ipsec
114 endef
115
116 define Package/strongswan/config
117 source "$(SOURCE)/Config.in"
118 endef
119
120 define Package/strongswan/description
121 $(call Package/strongswan/description/Default)
122 This package contains shared libraries and scripts.
123 endef
124
125 define Package/strongswan-full
126 $(call Package/strongswan/Default)
127 TITLE+= (full)
128 DEPENDS:= +strongswan \
129 +strongswan-charon \
130 +strongswan-mod-addrblock \
131 +strongswan-mod-aes \
132 +strongswan-mod-af-alg \
133 +strongswan-mod-agent \
134 +strongswan-mod-attr \
135 +strongswan-mod-attr-sql \
136 +strongswan-mod-blowfish \
137 +strongswan-mod-ccm \
138 +strongswan-mod-cmac \
139 +strongswan-mod-constraints \
140 +strongswan-mod-coupling \
141 +strongswan-mod-ctr \
142 +strongswan-mod-curl \
143 +strongswan-mod-des \
144 +strongswan-mod-dhcp \
145 +strongswan-mod-dnskey \
146 +strongswan-mod-duplicheck \
147 +strongswan-mod-eap-identity \
148 +strongswan-mod-eap-md5 \
149 +strongswan-mod-eap-mschapv2 \
150 +strongswan-mod-eap-radius \
151 +strongswan-mod-farp \
152 +strongswan-mod-fips-prf \
153 +strongswan-mod-gcm \
154 +strongswan-mod-gcrypt \
155 +strongswan-mod-gmp \
156 +strongswan-mod-ha \
157 +strongswan-mod-hmac \
158 +strongswan-mod-kernel-netlink \
159 +strongswan-mod-ldap \
160 +strongswan-mod-led \
161 +strongswan-mod-load-tester \
162 +strongswan-mod-nonce \
163 +strongswan-mod-md4 \
164 +strongswan-mod-md5 \
165 +strongswan-mod-mysql \
166 +strongswan-mod-openssl \
167 +strongswan-mod-pem \
168 +strongswan-mod-pgp \
169 +strongswan-mod-pkcs1 \
170 +strongswan-mod-pkcs8 \
171 +strongswan-mod-pkcs11 \
172 +strongswan-mod-pubkey \
173 +strongswan-mod-random \
174 +strongswan-mod-resolve \
175 +strongswan-mod-revocation \
176 +strongswan-mod-sha1 \
177 +strongswan-mod-sha2 \
178 +strongswan-mod-smp \
179 +strongswan-mod-socket-default \
180 +strongswan-mod-sqlite \
181 +strongswan-mod-stroke \
182 +strongswan-mod-test-vectors \
183 +strongswan-mod-uci \
184 +strongswan-mod-unity \
185 +strongswan-mod-updown \
186 +strongswan-mod-whitelist \
187 +strongswan-mod-x509 \
188 +strongswan-mod-xauth-eap \
189 +strongswan-mod-xauth-generic \
190 +strongswan-mod-xcbc \
191 +strongswan-utils \
192 @DEVEL
193 endef
194
195 define Package/strongswan-full/description
196 $(call Package/strongswan/description/Default)
197 This meta-package contains dependencies for all of the strongswan plugins
198 except kernel-libipsec,
199 socket-dynamic and which are ommitted in favor of the kernel-netlink and
200 socket-default plugins.
201 endef
202
203
204 define Package/strongswan-default
205 $(call Package/strongswan/Default)
206 TITLE+= (default)
207 DEPENDS:= +strongswan \
208 +strongswan-charon \
209 +strongswan-mod-aes \
210 +strongswan-mod-attr \
211 +strongswan-mod-constraints \
212 +strongswan-mod-des \
213 +strongswan-mod-dnskey \
214 +strongswan-mod-fips-prf \
215 +strongswan-mod-gmp \
216 +strongswan-mod-hmac \
217 +strongswan-mod-kernel-netlink \
218 +strongswan-mod-md5 \
219 +strongswan-mod-nonce \
220 +strongswan-mod-pem \
221 +strongswan-mod-pgp \
222 +strongswan-mod-pkcs1 \
223 +strongswan-mod-pubkey \
224 +strongswan-mod-random \
225 +strongswan-mod-resolve \
226 +strongswan-mod-revocation \
227 +strongswan-mod-sha1 \
228 +strongswan-mod-sha2 \
229 +strongswan-mod-socket-default \
230 +strongswan-mod-stroke \
231 +strongswan-mod-updown \
232 +strongswan-mod-x509 \
233 +strongswan-mod-xauth-generic \
234 +strongswan-mod-xcbc \
235 +strongswan-utils
236 endef
237
238 define Package/strongswan-default/description
239 $(call Package/strongswan/description/Default)
240 This meta-package contains only dependencies to match upstream defaults.
241 endef
242
243 define Package/strongswan-minimal
244 $(call Package/strongswan/Default)
245 TITLE+= (minimal)
246 DEPENDS:= +strongswan \
247 +strongswan-charon \
248 +strongswan-mod-aes \
249 +strongswan-mod-gmp \
250 +strongswan-mod-hmac \
251 +strongswan-mod-kernel-netlink \
252 +strongswan-mod-nonce \
253 +strongswan-mod-pubkey \
254 +strongswan-mod-random \
255 +strongswan-mod-sha1 \
256 +strongswan-mod-socket-default \
257 +strongswan-mod-stroke \
258 +strongswan-mod-updown \
259 +strongswan-mod-x509 \
260 +strongswan-mod-xcbc
261 endef
262
263 define Package/strongswan-minimal/description
264 $(call Package/strongswan/description/Default)
265 This meta-package contains only dependencies for a minimal IKEv2 setup.
266 endef
267
268 define Package/strongswan-charon
269 $(call Package/strongswan/Default)
270 TITLE+= IKEv1/IKEv2 keying daemon
271 DEPENDS:= +strongswan
272 endef
273
274 define Package/strongswan-charon/description
275 $(call Package/strongswan/description/Default)
276 This package contains charon, an IKEv2 keying daemon.
277 endef
278
279 define Package/strongswan-utils
280 $(call Package/strongswan/Default)
281 TITLE+= utilities
282 DEPENDS:= +strongswan
283 endef
284
285 define Package/strongswan-utils/description
286 $(call Package/strongswan/description/Default)
287 This package contains the pki & scepclient utilities.
288 endef
289
290 define BuildPlugin
291 define Package/strongswan-mod-$(1)
292 $$(call Package/strongswan/Default)
293 TITLE:= StrongSwan $(2) plugin
294 DEPENDS:= +strongswan $(3)
295 endef
296
297 define Package/strongswan-mod-$(1)/install
298 $(INSTALL_DIR) $$(1)/etc/strongswan.d/charon
299 if [ -f $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf ]; then \
300 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf $$(1)/etc/strongswan.d/charon/; fi
301 $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
302 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
303 $$(1)/usr/lib/ipsec/plugins/
304 $(call Plugin/$(1)/install,$$(1))
305 endef
306
307 $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
308 endef
309
310 CONFIGURE_ARGS+= \
311 --disable-scripts \
312 --disable-static \
313 --disable-fast \
314 --with-systemdsystemunitdir=no \
315 $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
316 --with-random-device=/dev/random \
317 --with-urandom-device=/dev/urandom \
318 --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
319 --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
320 $(foreach m,$(PKG_MOD_AVAILABLE), \
321 $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \
322 )
323
324 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
325
326 define Package/strongswan/conffiles
327 /etc/ipsec.conf
328 /etc/ipsec.secrets
329 /etc/ipsec.user
330 /etc/strongswan.conf
331 endef
332
333 define Package/strongswan/install
334 $(INSTALL_DIR) $(1)/etc
335 $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
336 $(INSTALL_DIR) $(1)/usr/lib/ipsec
337 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
338 $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
339 $(INSTALL_DIR) $(1)/etc/init.d
340 $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
341 endef
342
343 define Package/strongswan-default/install
344 true
345 endef
346
347 define Package/strongswan-full/install
348 true
349 endef
350
351 define Package/strongswan-minimal/install
352 true
353 endef
354
355 define Package/strongswan-charon/install
356 $(INSTALL_DIR) $(1)/usr/lib/ipsec
357 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
358 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
359 endef
360
361 define Package/strongswan-utils/install
362 $(INSTALL_DIR) $(1)/usr/sbin
363 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
364 $(INSTALL_DIR) $(1)/usr/bin
365 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
366 $(INSTALL_DIR) $(1)/usr/lib/ipsec
367 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
368 endef
369
370 define Plugin/duplicheck/install
371 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
372 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/
373 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/
374 endef
375
376 define Plugin/eap-radius/install
377 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
378 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libradius.so.* $(1)/usr/lib/ipsec/
379 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-eap-radius.so $(1)/usr/lib/ipsec/plugins/
380 endef
381
382 define Plugin/attr-sql/install
383 $(INSTALL_DIR) $(1)/usr/lib/ipsec
384 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/
385 endef
386
387 define Plugin/stroke/install
388 $(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts
389 $(INSTALL_DIR) $(1)/etc/ipsec.d/acerts
390 $(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts
391 $(INSTALL_DIR) $(1)/etc/ipsec.d/certs
392 $(INSTALL_DIR) $(1)/etc/ipsec.d/crls
393 $(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts
394 $(INSTALL_DIR) $(1)/etc/ipsec.d/private
395 $(INSTALL_DIR) $(1)/etc/ipsec.d/reqs
396
397 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/
398
399 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
400 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/
401 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/
402 endef
403
404 define Plugin/updown/install
405 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
406 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown $(1)/usr/lib/ipsec/
407 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
408 $(INSTALL_DIR) $(1)/etc
409 $(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
410 endef
411
412 define Plugin/whitelist/install
413 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
414 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
415 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/
416 endef
417
418 define Plugin/kernel-libipsec/install
419 $(INSTALL_DIR) $(1)/usr/lib/ipsec
420 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libipsec.so.* $(1)/usr/lib/ipsec/
421 endef
422
423 $(eval $(call BuildPackage,strongswan))
424 $(eval $(call BuildPackage,strongswan-default))
425 $(eval $(call BuildPackage,strongswan-full))
426 $(eval $(call BuildPackage,strongswan-minimal))
427 $(eval $(call BuildPackage,strongswan-charon))
428 $(eval $(call BuildPackage,strongswan-utils))
429 $(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
430 $(eval $(call BuildPlugin,aes,AES crypto,))
431 $(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
432 $(eval $(call BuildPlugin,agent,SSH agent signing,))
433 $(eval $(call BuildPlugin,attr,file based config,))
434 $(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-charon))
435 $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
436 $(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
437 $(eval $(call BuildPlugin,cmac,CMAC crypto,))
438 $(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
439 $(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
440 $(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
441 $(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
442 $(eval $(call BuildPlugin,des,DES crypto,))
443 $(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
444 $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
445 $(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,))
446 $(eval $(call BuildPlugin,eap-identity,EAP identity helper,))
447 $(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
448 $(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,+strongswan-mod-md4 +strongswan-mod-des))
449 $(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
450 $(eval $(call BuildPlugin,farp,fake arp respsonses,))
451 $(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
452 $(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
453 $(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt))
454 $(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp))
455 $(eval $(call BuildPlugin,ha,high availability cluster,))
456 $(eval $(call BuildPlugin,hmac,HMAC crypto,))
457 $(eval $(call BuildPlugin,kernel-libipsec,libipsec kernel interface,))
458 $(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
459 $(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap))
460 $(eval $(call BuildPlugin,led,LED blink on IKE activity,))
461 $(eval $(call BuildPlugin,load-tester,load testing,))
462 $(eval $(call BuildPlugin,nonce,nonce genereation,))
463 $(eval $(call BuildPlugin,md4,MD4 crypto,))
464 $(eval $(call BuildPlugin,md5,MD5 crypto,))
465 $(eval $(call BuildPlugin,mysql,MySQL database interface,+PACKAGE_strongswan-mod-mysql:libmysqlclient-r))
466 $(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl))
467 $(eval $(call BuildPlugin,pem,PEM decoding,))
468 $(eval $(call BuildPlugin,pgp,PGP key decoding,))
469 $(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
470 $(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,))
471 $(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,))
472 $(eval $(call BuildPlugin,pubkey,raw public key,))
473 $(eval $(call BuildPlugin,random,RNG,))
474 $(eval $(call BuildPlugin,resolve,DNS resolver,))
475 $(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,))
476 $(eval $(call BuildPlugin,sha1,SHA1 crypto,))
477 $(eval $(call BuildPlugin,sha2,SHA2 crypto,))
478 $(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2))
479 $(eval $(call BuildPlugin,socket-default,default socket implementation for charon,))
480 $(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,))
481 $(eval $(call BuildPlugin,sqlite,SQLite database interface,+PACKAGE_strongswan-mod-sqlite:libsqlite3))
482 $(eval $(call BuildPlugin,stroke,Stroke,+strongswan-utils))
483 $(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
484 $(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
485 $(eval $(call BuildPlugin,unity,Cisco Unity extension,))
486 $(eval $(call BuildPlugin,updown,updown firewall,))
487 $(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
488 $(eval $(call BuildPlugin,x509,x509 certificate,))
489 $(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
490 $(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,))
491 $(eval $(call BuildPlugin,xcbc,xcbc crypto,))