2 # Copyright (C) 2012-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
16 PKG_MD5SUM:=e3af3d493d22286be3cd794533a8966a
88 PKG_CONFIG_DEPENDS:= \
89 CONFIG_STRONGSWAN_DEVICE_RANDOM \
90 CONFIG_STRONGSWAN_DEVICE_URANDOM \
91 CONFIG_STRONGSWAN_ROUTING_TABLE \
92 CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
93 $(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \
99 include $(INCLUDE_DIR)/package.mk
101 define Package/strongswan/Default
106 URL:=http://www.strongswan.org/
109 define Package/strongswan/description/Default
110 StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
113 define Package/strongswan
114 $(call Package/strongswan/Default)
115 DEPENDS:= +libpthread +ip \
116 +kmod-crypto-authenc \
117 +kmod-ipsec +kmod-ipsec4 +kmod-ipsec6 \
118 +kmod-ipt-ipsec +iptables-mod-ipsec
121 define Package/strongswan/config
122 source "$(SOURCE)/Config.in"
125 define Package/strongswan/description
126 $(call Package/strongswan/description/Default)
127 This package contains shared libraries and scripts.
130 define Package/strongswan-full
131 $(call Package/strongswan/Default)
133 DEPENDS:= +strongswan \
135 +strongswan-libfast \
136 +strongswan-mod-addrblock \
137 +strongswan-mod-aes \
138 +strongswan-mod-af-alg \
139 +strongswan-mod-agent \
140 +strongswan-mod-attr \
141 +strongswan-mod-attr-sql \
142 +strongswan-mod-blowfish \
143 +strongswan-mod-ccm \
144 +strongswan-mod-cmac \
145 +strongswan-mod-constraints \
146 +strongswan-mod-coupling \
147 +strongswan-mod-ctr \
148 +strongswan-mod-curl \
149 +strongswan-mod-des \
150 +strongswan-mod-dhcp \
151 +strongswan-mod-dnskey \
152 +strongswan-mod-duplicheck \
153 +strongswan-mod-eap-identity \
154 +strongswan-mod-eap-md5 \
155 +strongswan-mod-eap-mschapv2 \
156 +strongswan-mod-eap-radius \
157 +strongswan-mod-farp \
158 +strongswan-mod-fips-prf \
159 +strongswan-mod-gcm \
160 +strongswan-mod-gcrypt \
161 +strongswan-mod-gmp \
163 +strongswan-mod-hmac \
164 +strongswan-mod-kernel-netlink \
165 +strongswan-mod-ldap \
166 +strongswan-mod-led \
167 +strongswan-mod-load-tester \
168 +strongswan-mod-nonce \
169 +strongswan-mod-md4 \
170 +strongswan-mod-md5 \
171 +strongswan-mod-mysql \
172 +strongswan-mod-openssl \
173 +TARGET_x86:strongswan-mod-padlock \
174 +strongswan-mod-pem \
175 +strongswan-mod-pgp \
176 +strongswan-mod-pkcs1 \
177 +strongswan-mod-pkcs8 \
178 +strongswan-mod-pkcs11 \
179 +strongswan-mod-pubkey \
180 +strongswan-mod-random \
181 +strongswan-mod-resolve \
182 +strongswan-mod-revocation \
183 +strongswan-mod-sha1 \
184 +strongswan-mod-sha2 \
185 +strongswan-mod-smp \
186 +strongswan-mod-socket-default \
187 +strongswan-mod-sql \
188 +strongswan-mod-sqlite \
189 +strongswan-mod-stroke \
190 +strongswan-mod-test-vectors \
191 +strongswan-mod-uci \
192 +strongswan-mod-unity \
193 +strongswan-mod-updown \
194 +strongswan-mod-whitelist \
195 +strongswan-mod-x509 \
196 +strongswan-mod-xauth-eap \
197 +strongswan-mod-xauth-generic \
198 +strongswan-mod-xcbc \
203 define Package/strongswan-full/description
204 $(call Package/strongswan/description/Default)
205 This meta-package contains dependencies for all of the strongswan plugins
206 except kernel-klips, kernel-libipsec, kernel-pfkey, kernel-pfroute,
207 socket-dynamic and which are ommitted in favor of the kernel-netlink and
208 socket-default plugins.
212 define Package/strongswan-default
213 $(call Package/strongswan/Default)
215 DEPENDS:= +strongswan \
217 +strongswan-mod-aes \
218 +strongswan-mod-attr \
219 +strongswan-mod-constraints \
220 +strongswan-mod-des \
221 +strongswan-mod-dnskey \
222 +strongswan-mod-fips-prf \
223 +strongswan-mod-gmp \
224 +strongswan-mod-hmac \
225 +strongswan-mod-kernel-netlink \
226 +strongswan-mod-md5 \
227 +strongswan-mod-nonce \
228 +strongswan-mod-pem \
229 +strongswan-mod-pgp \
230 +strongswan-mod-pkcs1 \
231 +strongswan-mod-pubkey \
232 +strongswan-mod-random \
233 +strongswan-mod-resolve \
234 +strongswan-mod-revocation \
235 +strongswan-mod-sha1 \
236 +strongswan-mod-sha2 \
237 +strongswan-mod-socket-default \
238 +strongswan-mod-stroke \
239 +strongswan-mod-updown \
240 +strongswan-mod-x509 \
241 +strongswan-mod-xauth-generic \
242 +strongswan-mod-xcbc \
246 define Package/strongswan-default/description
247 $(call Package/strongswan/description/Default)
248 This meta-package contains only dependencies to match upstream defaults.
251 define Package/strongswan-minimal
252 $(call Package/strongswan/Default)
254 DEPENDS:= +strongswan \
256 +strongswan-mod-aes \
257 +strongswan-mod-gmp \
258 +strongswan-mod-hmac \
259 +strongswan-mod-kernel-netlink \
260 +strongswan-mod-nonce \
261 +strongswan-mod-pubkey \
262 +strongswan-mod-random \
263 +strongswan-mod-sha1 \
264 +strongswan-mod-socket-default \
265 +strongswan-mod-stroke \
266 +strongswan-mod-updown \
267 +strongswan-mod-x509 \
271 define Package/strongswan-minimal/description
272 $(call Package/strongswan/description/Default)
273 This meta-package contains only dependencies for a minimal IKEv2 setup.
276 define Package/strongswan-charon
277 $(call Package/strongswan/Default)
278 TITLE+= IKEv1/IKEv2 keying daemon
279 DEPENDS:= +strongswan
282 define Package/strongswan-charon/description
283 $(call Package/strongswan/description/Default)
284 This package contains charon, an IKEv2 keying daemon.
287 define Package/strongswan-libfast
288 $(call Package/strongswan/Default)
290 DEPENDS:= +strongswan \
291 +PACKAGE_strongswan-libfast:zlib \
292 +PACKAGE_strongswan-libfast:fcgi \
293 +PACKAGE_strongswan-libfast:clearsilver
296 define Package/strongswan-libfast/description
297 $(call Package/strongswan/description/Default)
298 This package contains libfast, a lightweight framework to build native web
299 applications using ClearSilver and FastCGI.
302 define Package/strongswan-utils
303 $(call Package/strongswan/Default)
305 DEPENDS:= +strongswan
308 define Package/strongswan-utils/description
309 $(call Package/strongswan/description/Default)
310 This package contains the openac, pki & scepclient utilities.
314 define Package/strongswan-mod-$(1)
315 $$(call Package/strongswan/Default)
316 TITLE:= StrongSwan $(2) plugin
317 DEPENDS:= +strongswan $(3)
320 define Package/strongswan-mod-$(1)/install
321 $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
322 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
323 $$(1)/usr/lib/ipsec/plugins/
324 $(call Plugin/$(1)/install,$$(1))
327 $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
333 $(if $(CONFIG_PACKAGE_strongswan-libfast),--enable-fast,--disable-fast) \
334 $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-tools,--disable-tools) \
335 --with-random-device="$(call qstrip,$(CONFIG_STRONGSWAN_DEVICE_RANDOM))" \
336 --with-urandom-device="$(call qstrip,$(CONFIG_STRONGSWAN_DEVICE_URANDOM))" \
337 --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
338 --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
339 $(foreach m,$(PKG_MOD_AVAILABLE), \
340 $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \
343 ifneq ($(CONFIG_PACKAGE_strongswan-libfast),)
344 EXTRA_CPPFLAGS+= -I$(STAGING_DIR)/usr/include/ClearSilver
347 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
349 define Package/strongswan/conffiles
356 define Package/strongswan/install
357 $(INSTALL_DIR) $(1)/etc
358 $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
359 $(INSTALL_DIR) $(1)/usr/lib/ipsec
360 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
361 $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
362 $(INSTALL_DIR) $(1)/etc/init.d
363 $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
366 define Package/strongswan-default/install
370 define Package/strongswan-full/install
374 define Package/strongswan-minimal/install
378 define Package/strongswan-charon/install
379 $(INSTALL_DIR) $(1)/usr/lib/ipsec
380 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
381 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
384 define Package/strongswan-libfast/install
385 $(INSTALL_DIR) $(1)/usr/lib/ipsec
386 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libfast.so.* $(1)/usr/lib/ipsec/
389 define Package/strongswan-utils/install
390 $(INSTALL_DIR) $(1)/usr/sbin
391 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
392 $(INSTALL_DIR) $(1)/usr/bin
393 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
394 $(INSTALL_DIR) $(1)/usr/lib/ipsec
395 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{openac,scepclient} $(1)/usr/lib/ipsec/
398 define Plugin/duplicheck/install
399 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
400 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/
401 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/
404 define Plugin/eap-radius/install
405 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
406 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libradius.so.* $(1)/usr/lib/ipsec/
407 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-eap-radius.so $(1)/usr/lib/ipsec/plugins/
410 define Plugin/attr-sql/install
411 $(INSTALL_DIR) $(1)/usr/lib/ipsec
412 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/
415 define Plugin/stroke/install
416 $(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts
417 $(INSTALL_DIR) $(1)/etc/ipsec.d/acerts
418 $(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts
419 $(INSTALL_DIR) $(1)/etc/ipsec.d/certs
420 $(INSTALL_DIR) $(1)/etc/ipsec.d/crls
421 $(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts
422 $(INSTALL_DIR) $(1)/etc/ipsec.d/private
423 $(INSTALL_DIR) $(1)/etc/ipsec.d/reqs
425 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/
427 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
428 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/
429 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/
432 define Plugin/updown/install
433 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
434 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{_updown,_updown_espmark} $(1)/usr/lib/ipsec/
435 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
436 $(INSTALL_DIR) $(1)/etc
437 $(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
440 define Plugin/whitelist/install
441 $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
442 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
443 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/
446 $(eval $(call BuildPackage,strongswan))
447 $(eval $(call BuildPackage,strongswan-default))
448 $(eval $(call BuildPackage,strongswan-full))
449 $(eval $(call BuildPackage,strongswan-minimal))
450 $(eval $(call BuildPackage,strongswan-charon))
451 $(eval $(call BuildPackage,strongswan-libfast))
452 $(eval $(call BuildPackage,strongswan-utils))
453 $(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
454 $(eval $(call BuildPlugin,aes,AES crypto,))
455 $(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
456 $(eval $(call BuildPlugin,agent,SSH agent signing,))
457 $(eval $(call BuildPlugin,attr,file based config,))
458 $(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-mod-sql))
459 $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
460 $(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
461 $(eval $(call BuildPlugin,cmac,CMAC crypto,))
462 $(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
463 $(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
464 $(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
465 $(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
466 $(eval $(call BuildPlugin,des,DES crypto,))
467 $(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
468 $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
469 $(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,))
470 $(eval $(call BuildPlugin,eap-identity,EAP identity helper,))
471 $(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
472 $(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,))
473 $(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
474 $(eval $(call BuildPlugin,farp,fake arp respsonses,))
475 $(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
476 $(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
477 $(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt))
478 $(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp))
479 $(eval $(call BuildPlugin,ha,high availability cluster,))
480 $(eval $(call BuildPlugin,hmac,HMAC crypto,))
481 $(eval $(call BuildPlugin,kernel-klips,KLIPS kernel interface,))
482 $(eval $(call BuildPlugin,kernel-libipsec,libipsec kernel interface,))
483 $(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
484 $(eval $(call BuildPlugin,kernel-pfkey,PK_KEY kernel interface,))
485 $(eval $(call BuildPlugin,kernel-pfroute,PF_ROUTE kernel interface,))
486 $(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap))
487 $(eval $(call BuildPlugin,led,LED blink on IKE activity,))
488 $(eval $(call BuildPlugin,load-tester,load testing,))
489 $(eval $(call BuildPlugin,nonce,nonce genereation,))
490 $(eval $(call BuildPlugin,md4,MD4 crypto,))
491 $(eval $(call BuildPlugin,md5,MD5 crypto,))
492 $(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-mysql:libmysqlclient-r))
493 $(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl))
494 $(eval $(call BuildPlugin,padlock,VIA PadLock crypto,@TARGET_x86))
495 $(eval $(call BuildPlugin,pem,PEM decoding,))
496 $(eval $(call BuildPlugin,pgp,PGP key decoding,))
497 $(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
498 $(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,))
499 $(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,))
500 $(eval $(call BuildPlugin,pubkey,raw public key,))
501 $(eval $(call BuildPlugin,random,RNG,))
502 $(eval $(call BuildPlugin,resolve,DNS resolver,))
503 $(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,))
504 $(eval $(call BuildPlugin,sha1,SHA1 crypto,))
505 $(eval $(call BuildPlugin,sha2,SHA2 crypto,))
506 $(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2))
507 $(eval $(call BuildPlugin,socket-default,default socket implementation for charon,))
508 $(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,))
509 $(eval $(call BuildPlugin,sql,SQL database interface,))
510 $(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
511 $(eval $(call BuildPlugin,stroke,Stroke,+strongswan-utils))
512 $(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
513 $(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
514 $(eval $(call BuildPlugin,unity,Cisco Unity extension,))
515 $(eval $(call BuildPlugin,updown,updown firewall,))
516 $(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
517 $(eval $(call BuildPlugin,x509,x509 certificate,))
518 $(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
519 $(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,))
520 $(eval $(call BuildPlugin,xcbc,xcbc crypto,))