2 # Copyright (C) 2012-2015 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
:=fab014be1477ef4ebf9a765e10f8802c
18 PKG_MAINTAINER
:=Steven Barth
<cyrus@openwrt.org
>
91 PKG_CONFIG_DEPENDS
:= \
92 CONFIG_STRONGSWAN_ROUTING_TABLE \
93 CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
94 $(patsubst %,CONFIG_PACKAGE_strongswan-mod-
%,$(PKG_MOD_AVAILABLE
)) \
100 include $(INCLUDE_DIR
)/package.mk
102 define Package
/strongswan
/Default
107 URL
:=http
://www.strongswan.org
/
110 define Package
/strongswan
/description
/Default
111 StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
114 define Package
/strongswan
115 $(call Package
/strongswan
/Default
)
116 DEPENDS
:= +libpthread
+ip \
117 +kmod-crypto-authenc \
118 +kmod-ipsec
+kmod-ipsec4
+IPV6
:kmod-ipsec6 \
119 +kmod-ipt-ipsec
+iptables-mod-ipsec
122 define Package
/strongswan
/config
123 source
"$(SOURCE)/Config.in"
126 define Package
/strongswan
/description
127 $(call Package
/strongswan
/description
/Default
)
128 This package contains shared libraries and scripts.
131 define Package
/strongswan-full
132 $(call Package
/strongswan
/Default
)
134 DEPENDS
:= +strongswan \
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-eap-tls \
158 +strongswan-mod-farp \
159 +strongswan-mod-fips-prf \
160 +strongswan-mod-gcm \
161 +strongswan-mod-gcrypt \
162 +strongswan-mod-gmp \
164 +strongswan-mod-hmac \
165 +strongswan-mod-kernel-netlink \
166 +strongswan-mod-ldap \
167 +strongswan-mod-led \
168 +strongswan-mod-load-tester \
169 +strongswan-mod-nonce \
170 +strongswan-mod-md4 \
171 +strongswan-mod-md5 \
172 +strongswan-mod-mysql \
173 +strongswan-mod-openssl \
174 +strongswan-mod-pem \
175 +strongswan-mod-pgp \
176 +strongswan-mod-pkcs1 \
177 +strongswan-mod-pkcs7 \
178 +strongswan-mod-pkcs8 \
179 +strongswan-mod-pkcs11 \
180 +strongswan-mod-pkcs12 \
181 +strongswan-mod-pubkey \
182 +strongswan-mod-random \
183 +strongswan-mod-rc2 \
184 +strongswan-mod-resolve \
185 +strongswan-mod-revocation \
186 +strongswan-mod-sha1 \
187 +strongswan-mod-sha2 \
188 +strongswan-mod-smp \
189 +strongswan-mod-socket-default \
190 +strongswan-mod-sql \
191 +strongswan-mod-sqlite \
192 +strongswan-mod-sshkey \
193 +strongswan-mod-stroke \
194 +strongswan-mod-test-vectors \
195 +strongswan-mod-uci \
196 +strongswan-mod-unity \
197 +strongswan-mod-updown \
198 +strongswan-mod-whitelist \
199 +strongswan-mod-x509 \
200 +strongswan-mod-xauth-eap \
201 +strongswan-mod-xauth-generic \
202 +strongswan-mod-xcbc \
207 define Package
/strongswan-full
/description
208 $(call Package
/strongswan
/description
/Default
)
209 This meta-package contains dependencies for
all of the strongswan plugins
210 except kernel-libipsec
,
211 socket-dynamic and which are ommitted in favor of the kernel-netlink and
212 socket-default plugins.
216 define Package
/strongswan-default
217 $(call Package
/strongswan
/Default
)
219 DEPENDS
:= +strongswan \
221 +strongswan-mod-aes \
222 +strongswan-mod-attr \
223 +strongswan-mod-constraints \
224 +strongswan-mod-des \
225 +strongswan-mod-dnskey \
226 +strongswan-mod-fips-prf \
227 +strongswan-mod-gmp \
228 +strongswan-mod-hmac \
229 +strongswan-mod-kernel-netlink \
230 +strongswan-mod-md5 \
231 +strongswan-mod-nonce \
232 +strongswan-mod-pem \
233 +strongswan-mod-pgp \
234 +strongswan-mod-pkcs1 \
235 +strongswan-mod-pubkey \
236 +strongswan-mod-random \
237 +strongswan-mod-rc2 \
238 +strongswan-mod-resolve \
239 +strongswan-mod-revocation \
240 +strongswan-mod-sha1 \
241 +strongswan-mod-sha2 \
242 +strongswan-mod-socket-default \
243 +strongswan-mod-sshkey \
244 +strongswan-mod-stroke \
245 +strongswan-mod-updown \
246 +strongswan-mod-x509 \
247 +strongswan-mod-xauth-generic \
248 +strongswan-mod-xcbc \
252 define Package
/strongswan-default
/description
253 $(call Package
/strongswan
/description
/Default
)
254 This meta-package contains only dependencies to match upstream defaults.
257 define Package
/strongswan-minimal
258 $(call Package
/strongswan
/Default
)
260 DEPENDS
:= +strongswan \
262 +strongswan-mod-aes \
263 +strongswan-mod-gmp \
264 +strongswan-mod-hmac \
265 +strongswan-mod-kernel-netlink \
266 +strongswan-mod-nonce \
267 +strongswan-mod-pubkey \
268 +strongswan-mod-random \
269 +strongswan-mod-sha1 \
270 +strongswan-mod-socket-default \
271 +strongswan-mod-stroke \
272 +strongswan-mod-updown \
273 +strongswan-mod-x509 \
277 define Package
/strongswan-minimal
/description
278 $(call Package
/strongswan
/description
/Default
)
279 This meta-package contains only dependencies for a minimal IKEv2 setup.
282 define Package
/strongswan-charon
283 $(call Package
/strongswan
/Default
)
284 TITLE
+= IKEv1
/IKEv2 keying daemon
285 DEPENDS
:= +strongswan
288 define Package
/strongswan-charon
/description
289 $(call Package
/strongswan
/description
/Default
)
290 This package contains charon
, an IKEv2 keying daemon.
293 define Package
/strongswan-utils
294 $(call Package
/strongswan
/Default
)
296 DEPENDS
:= +strongswan
299 define Package
/strongswan-utils
/description
300 $(call Package
/strongswan
/description
/Default
)
301 This package contains the pki
& scepclient utilities.
304 define Package
/strongswan-libtls
305 $(call Package
/strongswan
/Default
)
307 DEPENDS
:= +strongswan
310 define Package
/strongswan-libtls
/description
311 $(call Package
/strongswan
/description
/Default
)
312 This package contains libtls for strongSwan plugins eap-tls
, eap-ttls
,
317 define Package
/strongswan-mod-
$(1)
318 $$(call Package
/strongswan
/Default
)
319 TITLE
:= StrongSwan
$(2) plugin
320 DEPENDS
:= +strongswan
$(3)
323 define Package
/strongswan-mod-
$(1)/install
324 $(INSTALL_DIR
) $$(1)/etc
/strongswan.d
/charon
325 if
[ -f
$(PKG_INSTALL_DIR
)/etc
/strongswan.d
/charon
/$(1).conf
]; then \
326 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/etc
/strongswan.d
/charon
/$(1).conf
$$(1)/etc
/strongswan.d
/charon
/; fi
327 $(INSTALL_DIR
) $$(1)/usr
/lib
/ipsec
/plugins
328 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-
$(1).so \
329 $$(1)/usr
/lib
/ipsec
/plugins
/
330 $(call Plugin
/$(1)/install,$$(1))
333 $$(eval
$$(call BuildPackage
,strongswan-mod-
$(1)))
340 --with-systemdsystemunitdir
=no \
341 $(if
$(CONFIG_PACKAGE_strongswan-utils
),--enable-pki
--enable-scepclient
,--disable-pki
--disable-scepclient
) \
342 --with-random-device
=/dev
/random \
343 --with-urandom-device
=/dev
/urandom \
344 --with-routing-table
="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
345 --with-routing-table-prio
="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
346 $(foreach m
,$(PKG_MOD_AVAILABLE
), \
347 $(if
$(CONFIG_PACKAGE_strongswan-mod-
$(m
)),--enable-
$(m
),--disable-
$(m
)) \
350 EXTRA_LDFLAGS
+= -Wl
,-rpath-link
,$(STAGING_DIR
)/usr
/lib
352 define Package
/strongswan
/conffiles
359 define Package
/strongswan
/install
360 $(INSTALL_DIR
) $(1)/etc
361 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/etc
/ipsec.conf
$(1)/etc
/
362 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/etc
/strongswan.conf
$(1)/etc
/
363 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
364 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/{libstrongswan.so.
*,libhydra.so.
*} $(1)/usr
/lib
/ipsec
/
365 $(INSTALL_CONF
) .
/files
/ipsec.secrets
$(1)/etc
/
366 $(INSTALL_CONF
) .
/files
/ipsec.user
$(1)/etc
/
367 $(INSTALL_DIR
) $(1)/etc
/init.d
368 $(INSTALL_BIN
) .
/files
/ipsec.init
$(1)/etc
/init.d
/ipsec
371 define Package
/strongswan-default
/install
375 define Package
/strongswan-full
/install
379 define Package
/strongswan-minimal
/install
383 define Package
/strongswan-charon
/install
384 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
385 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/charon
$(1)/usr
/lib
/ipsec
/
386 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/libcharon.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
/scepclient
$(1)/usr
/lib
/ipsec
/
398 define Package
/strongswan-libtls
/install
399 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
400 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/libtls.so.
* $(1)/usr
/lib
/ipsec
/
403 define Plugin
/duplicheck
/install
404 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
/plugins
405 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/duplicheck
$(1)/usr
/lib
/ipsec
/
406 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-duplicheck.so
$(1)/usr
/lib
/ipsec
/plugins
/
409 define Plugin
/eap-radius
/install
410 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
/plugins
411 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/libradius.so.
* $(1)/usr
/lib
/ipsec
/
412 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-eap-radius.so
$(1)/usr
/lib
/ipsec
/plugins
/
415 define Plugin
/attr-sql
/install
416 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
417 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/pool
$(1)/usr
/lib
/ipsec
/
420 define Plugin
/stroke
/install
421 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/aacerts
422 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/acerts
423 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/cacerts
424 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/certs
425 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/crls
426 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/ocspcerts
427 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/private
428 $(INSTALL_DIR
) $(1)/etc
/ipsec.d
/reqs
430 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
/plugins
431 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/{starter
,stroke
} $(1)/usr
/lib
/ipsec
/
432 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-stroke.so
$(1)/usr
/lib
/ipsec
/plugins
/
435 define Plugin
/updown
/install
436 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
/plugins
437 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/_updown
$(1)/usr
/lib
/ipsec
/
438 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-updown.so
$(1)/usr
/lib
/ipsec
/plugins
/
439 $(INSTALL_DIR
) $(1)/etc
442 define Plugin
/whitelist
/install
443 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
/plugins
444 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/whitelist
$(1)/usr
/lib
/ipsec
/
445 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/plugins
/libstrongswan-whitelist.so
$(1)/usr
/lib
/ipsec
/plugins
/
448 define Plugin
/kernel-libipsec
/install
449 $(INSTALL_DIR
) $(1)/usr
/lib
/ipsec
450 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/ipsec
/libipsec.so.
* $(1)/usr
/lib
/ipsec
/
453 $(eval
$(call BuildPackage
,strongswan
))
454 $(eval
$(call BuildPackage
,strongswan-default
))
455 $(eval
$(call BuildPackage
,strongswan-full
))
456 $(eval
$(call BuildPackage
,strongswan-minimal
))
457 $(eval
$(call BuildPackage
,strongswan-charon
))
458 $(eval
$(call BuildPackage
,strongswan-utils
))
459 $(eval
$(call BuildPackage
,strongswan-libtls
))
460 $(eval
$(call BuildPlugin
,addrblock
,RFC
3779 address block constraint support
,))
461 $(eval
$(call BuildPlugin
,aes
,AES crypto
,))
462 $(eval
$(call BuildPlugin
,af-alg
,AF_ALG crypto interface to Linux Crypto API
,+kmod-crypto-user
))
463 $(eval
$(call BuildPlugin
,agent
,SSH agent signing
,))
464 $(eval
$(call BuildPlugin
,attr
,file based config
,))
465 $(eval
$(call BuildPlugin
,attr-sql
,SQL based config
,+strongswan-charon
))
466 $(eval
$(call BuildPlugin
,blowfish
,Blowfish crypto
,))
467 $(eval
$(call BuildPlugin
,ccm
,CCM AEAD wrapper crypto
,))
468 $(eval
$(call BuildPlugin
,cmac
,CMAC crypto
,))
469 $(eval
$(call BuildPlugin
,constraints
,advanced X509 constraint checking
,))
470 $(eval
$(call BuildPlugin
,coupling
,IKEv2 plugin to couple peer certificates permanently to authentication
,))
471 $(eval
$(call BuildPlugin
,ctr
,Counter Mode wrapper crypto
,))
472 $(eval
$(call BuildPlugin
,curl
,cURL fetcher plugin
,+PACKAGE_strongswan-mod-curl
:libcurl
))
473 $(eval
$(call BuildPlugin
,des
,DES crypto
,))
474 $(eval
$(call BuildPlugin
,dhcp
,DHCP based attribute provider
,))
475 $(eval
$(call BuildPlugin
,dnskey
,DNS RR key decoding
,))
476 $(eval
$(call BuildPlugin
,duplicheck
,advanced duplicate checking
,))
477 $(eval
$(call BuildPlugin
,eap-identity
,EAP identity helper
,))
478 $(eval
$(call BuildPlugin
,eap-md5
,EAP MD5
(CHAP
) EAP auth
,))
479 $(eval
$(call BuildPlugin
,eap-mschapv2
,EAP MS-CHAPv2 EAP auth
,+strongswan-mod-md4
+strongswan-mod-des
))
480 $(eval
$(call BuildPlugin
,eap-radius
,EAP RADIUS auth
,))
481 $(eval
$(call BuildPlugin
,eap-tls
,EAP TLS auth
,+strongswan-libtls
))
482 $(eval
$(call BuildPlugin
,farp
,fake arp respsonses
,))
483 $(eval
$(call BuildPlugin
,fips-prf
,FIPS PRF crypto
,+strongswan-mod-sha1
))
484 $(eval
$(call BuildPlugin
,gcm
,GCM AEAD wrapper crypto
,))
485 $(eval
$(call BuildPlugin
,gcrypt
,libgcrypt
,+PACKAGE_strongswan-mod-gcrypt
:libgcrypt
))
486 $(eval
$(call BuildPlugin
,gmp
,libgmp
,+PACKAGE_strongswan-mod-gmp
:libgmp
))
487 $(eval
$(call BuildPlugin
,ha
,high availability cluster
,))
488 $(eval
$(call BuildPlugin
,hmac
,HMAC crypto
,))
489 $(eval
$(call BuildPlugin
,kernel-libipsec
,libipsec kernel interface
,))
490 $(eval
$(call BuildPlugin
,kernel-netlink
,netlink kernel interface
,))
491 $(eval
$(call BuildPlugin
,ldap
,LDAP
,+PACKAGE_strongswan-mod-ldap
:libopenldap
))
492 $(eval
$(call BuildPlugin
,led
,LED blink on IKE activity
,))
493 $(eval
$(call BuildPlugin
,load-tester
,load testing
,))
494 $(eval
$(call BuildPlugin
,nonce
,nonce genereation
,))
495 $(eval
$(call BuildPlugin
,md4
,MD4 crypto
,))
496 $(eval
$(call BuildPlugin
,md5
,MD5 crypto
,))
497 $(eval
$(call BuildPlugin
,mysql
,MySQL database interface
,+strongswan-mod-sql
+PACKAGE_strongswan-mod-mysql
:libmysqlclient-r
))
498 $(eval
$(call BuildPlugin
,openssl
,OpenSSL crypto
,+PACKAGE_strongswan-mod-openssl
:libopenssl
))
499 $(eval
$(call BuildPlugin
,pem
,PEM decoding
,))
500 $(eval
$(call BuildPlugin
,pgp
,PGP key decoding
,))
501 $(eval
$(call BuildPlugin
,pkcs1
,PKCS1 key decoding
,))
502 $(eval
$(call BuildPlugin
,pkcs7
,PKCS7 key decoding
,))
503 $(eval
$(call BuildPlugin
,pkcs8
,PKCS8 key decoding
,))
504 $(eval
$(call BuildPlugin
,pkcs11
,PKCS11 key decoding
,))
505 $(eval
$(call BuildPlugin
,pkcs12
,PKCS12 key decoding
,))
506 $(eval
$(call BuildPlugin
,pubkey
,raw public key
,))
507 $(eval
$(call BuildPlugin
,random
,RNG
,))
508 $(eval
$(call BuildPlugin
,rc2
,RC2 crypto
,))
509 $(eval
$(call BuildPlugin
,resolve
,DNS resolver
,))
510 $(eval
$(call BuildPlugin
,revocation
,X509 CRL
/OCSP revocation
,))
511 $(eval
$(call BuildPlugin
,sha1
,SHA1 crypto
,))
512 $(eval
$(call BuildPlugin
,sha2
,SHA2 crypto
,))
513 $(eval
$(call BuildPlugin
,smp
,SMP configuration and control interface
,+PACKAGE_strongswan-mod-smp
:libxml2
))
514 $(eval
$(call BuildPlugin
,socket-default
,default socket implementation for charon
,))
515 $(eval
$(call BuildPlugin
,socket-dynamic
,dynamic socket implementation for charon
,))
516 $(eval
$(call BuildPlugin
,sql
,SQL database interface
,))
517 $(eval
$(call BuildPlugin
,sqlite
,SQLite database interface
,+strongswan-mod-sql
+PACKAGE_strongswan-mod-sqlite
:libsqlite3
))
518 $(eval
$(call BuildPlugin
,sshkey
,SSH key decoding
,))
519 $(eval
$(call BuildPlugin
,stroke
,Stroke
,+strongswan-utils
))
520 $(eval
$(call BuildPlugin
,test-vectors
,crypto
test vectors
,))
521 $(eval
$(call BuildPlugin
,uci
,UCI config interface
,+PACKAGE_strongswan-mod-uci
:libuci
))
522 $(eval
$(call BuildPlugin
,unity
,Cisco Unity extension
,))
523 $(eval
$(call BuildPlugin
,updown
,updown firewall
,))
524 $(eval
$(call BuildPlugin
,whitelist
,peer identity whitelisting
,))
525 $(eval
$(call BuildPlugin
,x509
,x509 certificate
,))
526 $(eval
$(call BuildPlugin
,xauth-eap
,EAP XAuth backend
,))
527 $(eval
$(call BuildPlugin
,xauth-generic
,generic XAuth backend
,))
528 $(eval
$(call BuildPlugin
,xcbc
,xcbc crypto
,))