aboutsummaryrefslogtreecommitdiff
path: root/net/strongswan/Makefile
blob: 5e6ba93becc2c93892522b4c8e95dff3d04ca4cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
#
# Copyright (C) 2012-2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=strongswan
PKG_VERSION:=5.9.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
PKG_HASH:=72b47a385da5d1532b816d9fe04c50d074c29ed42ea3f0878fbd66335917bb66
PKG_LICENSE:=GPL-2.0-or-later
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
PKG_CPE_ID:=cpe:/a:strongswan:strongswan

PKG_MOD_AVAILABLE:= \
	addrblock \
	aes \
	af-alg \
	agent \
	attr \
	attr-sql \
	blowfish \
	ccm \
	cmac \
	constraints \
	connmark \
	coupling \
	ctr \
	curl \
	curve25519 \
	des \
	dhcp \
	dnskey \
	duplicheck \
	eap-identity \
	eap-md5 \
	eap-mschapv2 \
	eap-radius \
	eap-tls \
	farp \
	fips-prf \
	forecast \
	gcm \
	gcrypt \
	gmp \
	gmpdh \
	ha \
	hmac \
	kernel-libipsec \
	kernel-netlink \
	ldap \
	led \
	load-tester \
	nonce \
	md4 \
	md5 \
	mysql \
	openssl \
	pem \
	pgp \
	pkcs1 \
	pkcs7 \
	pkcs8 \
	pkcs11 \
	pkcs12 \
	pubkey \
	random \
	rc2 \
	resolve \
	revocation \
	sha1 \
	sha2 \
	smp \
	socket-default \
	socket-dynamic \
	sql \
	sqlite \
	sshkey \
	stroke \
	test-vectors \
	unity \
	uci \
	updown \
	vici \
	whitelist \
	x509 \
	xauth-eap \
	xauth-generic \
	xcbc

PKG_CONFIG_DEPENDS:= \
	CONFIG_STRONGSWAN_ROUTING_TABLE \
	CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
	$(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \

PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk
# strongswan-mod-mysql needs iconv
include $(INCLUDE_DIR)/nls.mk

define Package/strongswan/Default
  SUBMENU:=VPN
  SECTION:=net
  CATEGORY:=Network
  TITLE:=StrongSwan
  URL:=http://www.strongswan.org/
endef

define Package/strongswan/description/Default
 StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
endef

define Package/strongswan
$(call Package/strongswan/Default)
  MENU:=1
  DEPENDS:= +libpthread +ip \
	+kmod-crypto-authenc \
	+kmod-ipsec +kmod-ipsec4 +IPV6:kmod-ipsec6 \
	+kmod-ipt-ipsec +iptables-mod-ipsec
endef

define Package/strongswan/config
  source "$(SOURCE)/Config.in"
endef

define Package/strongswan/description
$(call Package/strongswan/description/Default)
 This package contains shared libraries and scripts.
endef

define Package/strongswan-full
$(call Package/strongswan/Default)
  TITLE+= (full)
  DEPENDS:= strongswan \
	+strongswan-charon \
	+strongswan-charon-cmd \
	+strongswan-ipsec \
	+strongswan-mod-addrblock \
	+strongswan-mod-aes \
	+strongswan-mod-af-alg \
	+strongswan-mod-agent \
	+strongswan-mod-attr \
	+strongswan-mod-attr-sql \
	+strongswan-mod-blowfish \
	+strongswan-mod-ccm \
	+strongswan-mod-cmac \
	+strongswan-mod-constraints \
	+strongswan-mod-connmark \
	+strongswan-mod-coupling \
	+strongswan-mod-ctr \
	+strongswan-mod-curl \
	+strongswan-mod-curve25519 \
	+strongswan-mod-des \
	+strongswan-mod-dhcp \
	+strongswan-mod-dnskey \
	+strongswan-mod-duplicheck \
	+strongswan-mod-eap-identity \
	+strongswan-mod-eap-md5 \
	+strongswan-mod-eap-mschapv2 \
	+strongswan-mod-eap-radius \
	+strongswan-mod-eap-tls \
	+strongswan-mod-farp \
	+strongswan-mod-fips-prf \
	+strongswan-mod-forecast \
	+strongswan-mod-gcm \
	+strongswan-mod-gcrypt \
	+strongswan-mod-gmp \
	+strongswan-mod-ha \
	+strongswan-mod-hmac \
	+strongswan-mod-kernel-netlink \
	+strongswan-mod-ldap \
	+strongswan-mod-led \
	+strongswan-mod-load-tester \
	+strongswan-mod-nonce \
	+strongswan-mod-md4 \
	+strongswan-mod-md5 \
	+strongswan-mod-mysql \
	+strongswan-mod-openssl \
	+strongswan-mod-pem \
	+strongswan-mod-pgp \
	+strongswan-mod-pkcs1 \
	+strongswan-mod-pkcs7 \
	+strongswan-mod-pkcs8 \
	+strongswan-mod-pkcs11 \
	+strongswan-mod-pkcs12 \
	+strongswan-mod-pubkey \
	+strongswan-mod-random \
	+strongswan-mod-rc2 \
	+strongswan-mod-resolve \
	+strongswan-mod-revocation \
	+strongswan-mod-sha1 \
	+strongswan-mod-sha2 \
	+strongswan-mod-smp \
	+strongswan-mod-socket-default \
	+strongswan-mod-sql \
	+strongswan-mod-sqlite \
	+strongswan-mod-sshkey \
	+strongswan-mod-stroke \
	+strongswan-mod-test-vectors \
	+strongswan-mod-uci \
	+strongswan-mod-unity \
	+strongswan-mod-updown \
	+strongswan-mod-vici \
	+strongswan-mod-whitelist \
	+strongswan-mod-x509 \
	+strongswan-mod-xauth-eap \
	+strongswan-mod-xauth-generic \
	+strongswan-mod-xcbc \
	+strongswan-pki \
	+strongswan-scepclient \
	+strongswan-swanctl \
	@DEVEL
endef

define Package/strongswan-full/description
$(call Package/strongswan/description/Default)
 This meta-package contains dependencies for all of the strongswan plugins
 except kernel-libipsec,
 socket-dynamic and which are omitted in favor of the kernel-netlink and
 socket-default plugins.
endef


define Package/strongswan-default
$(call Package/strongswan/Default)
  TITLE+= (default)
  DEPENDS:= strongswan \
	+strongswan-charon \
	+strongswan-ipsec \
	+strongswan-mod-aes \
	+strongswan-mod-attr \
	+strongswan-mod-connmark \
	+strongswan-mod-constraints \
	+strongswan-mod-des \
	+strongswan-mod-dnskey \
	+strongswan-mod-fips-prf \
	+strongswan-mod-gmp \
	+strongswan-mod-hmac \
	+strongswan-mod-kernel-netlink \
	+strongswan-mod-md5 \
	+strongswan-mod-nonce \
	+strongswan-mod-pem \
	+strongswan-mod-pgp \
	+strongswan-mod-pkcs1 \
	+strongswan-mod-pubkey \
	+strongswan-mod-random \
	+strongswan-mod-rc2 \
	+strongswan-mod-resolve \
	+strongswan-mod-revocation \
	+strongswan-mod-sha1 \
	+strongswan-mod-sha2 \
	+strongswan-mod-socket-default \
	+strongswan-mod-sshkey \
	+strongswan-mod-stroke \
	+strongswan-mod-updown \
	+strongswan-mod-x509 \
	+strongswan-mod-xauth-generic \
	+strongswan-mod-xcbc
endef

define Package/strongswan-default/description
$(call Package/strongswan/description/Default)
 This meta-package contains only dependencies to match upstream defaults.
endef


define Package/strongswan-isakmp
$(call Package/strongswan/Default)
  TITLE+= (isakmp)
  DEPENDS:= strongswan \
	+strongswan-charon \
	+strongswan-ipsec \
	+strongswan-mod-aes \
	+strongswan-mod-des \
	+strongswan-mod-gmpdh \
	+strongswan-mod-hmac \
	+strongswan-mod-kernel-netlink \
	+strongswan-mod-md5 \
	+strongswan-mod-nonce \
	+strongswan-mod-pubkey \
	+strongswan-mod-random \
	+strongswan-mod-sha1 \
	+strongswan-mod-socket-default \
	+strongswan-mod-stroke \
	+strongswan-mod-uci \
	+strongswan-mod-updown
endef

define Package/strongswan-isakmp/description
$(call Package/strongswan/description/Default)
 This meta-package contains only dependencies to establish  ISAKMP /
 IKE PSK connections, dropping other capabilities in favor of small size 
 Can fit most routers even with 4Mb flash (after removing IPv6 support).
endef


define Package/strongswan-minimal
$(call Package/strongswan/Default)
  TITLE+= (minimal)
  DEPENDS:= strongswan \
	+strongswan-charon \
	+strongswan-mod-aes \
	+strongswan-mod-gmp \
	+strongswan-mod-hmac \
	+strongswan-mod-kernel-netlink \
	+strongswan-mod-nonce \
	+strongswan-mod-pubkey \
	+strongswan-mod-random \
	+strongswan-mod-sha1 \
	+strongswan-mod-socket-default \
	+strongswan-mod-stroke \
	+strongswan-mod-updown \
	+strongswan-mod-x509 \
	+strongswan-mod-xcbc
endef

define Package/strongswan-minimal/description
$(call Package/strongswan/description/Default)
 This meta-package contains only dependencies for a minimal IKEv2 setup.
endef

define Package/strongswan-charon
$(call Package/strongswan/Default)
  TITLE+= IKEv1/IKEv2 keying daemon
  DEPENDS:= strongswan
endef

define Package/strongswan-charon/description
$(call Package/strongswan/description/Default)
 This package contains charon, an IKEv2 keying daemon.
endef

define Package/strongswan-charon-cmd
$(call Package/strongswan/Default)
  TITLE+= charon-cmd utility
  DEPENDS:= strongswan +strongswan-charon
endef

define Package/strongswan-charon-cmd/description
$(call Package/strongswan/description/Default)
 This package contains the charon-cmd utility.
endef

define Package/strongswan-ipsec
$(call Package/strongswan/Default)
  TITLE+= utilities
  DEPENDS:= strongswan
endef

define Package/strongswan-ipsec/description
$(call Package/strongswan/description/Default)
 This package contains the ipsec utility.
endef

define Package/strongswan-pki
$(call Package/strongswan/Default)
  TITLE+= PKI tool
  DEPENDS:= strongswan
endef

define Package/strongswan-pki/description
$(call Package/strongswan/description/Default)
 This package contains the pki tool.
endef

define Package/strongswan-scepclient
$(call Package/strongswan/Default)
  TITLE+= SCEP client
  DEPENDS:= strongswan
endef

define Package/strongswan-scepclient/description
$(call Package/strongswan/description/Default)
 This package contains the SCEP client.
endef

define Package/strongswan-swanctl
$(call Package/strongswan/Default)
  TITLE+= swanctl utility
  DEPENDS:= strongswan +strongswan-mod-vici
endef

define Package/strongswan-swanctl/description
$(call Package/strongswan/description/Default)
 This package contains the swanctl utility.
endef

define Package/strongswan-libtls
$(call Package/strongswan/Default)
  TITLE+= libtls
  DEPENDS:= strongswan
endef

define Package/strongswan-libtls/description
$(call Package/strongswan/description/Default)
 This package contains libtls for strongSwan plugins eap-tls, eap-ttls,
 eap-peap, tnc-tnccs
endef

define BuildPlugin
  define Package/strongswan-mod-$(1)
    $$(call Package/strongswan/Default)
    TITLE:= StrongSwan $(2) plugin
    DEPENDS:= strongswan $(3)
  endef

  define Package/strongswan-mod-$(1)/install
	$(INSTALL_DIR) $$(1)/etc/strongswan.d/charon
	if [ -f $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf ]; then \
		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf $$(1)/etc/strongswan.d/charon/; fi
	$(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
		$$(1)/usr/lib/ipsec/plugins/
	$(call Plugin/$(1)/install,$$(1))
  endef

  $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
endef

CONFIGURE_ARGS+= \
	--disable-scripts \
	--disable-static \
	--disable-fast \
	--enable-mediation \
	--with-systemdsystemunitdir=no \
	$(if $(CONFIG_PACKAGE_strongswan-charon-cmd),--enable-cmd,--disable-cmd) \
	$(if $(CONFIG_PACKAGE_strongswan-pki),--enable-pki,--disable-pki) \
	$(if $(CONFIG_PACKAGE_strongswan-scepclient),--enable-scepclient,--disable-scepclient) \
	--with-random-device=/dev/random \
	--with-urandom-device=/dev/urandom \
	--with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
	--with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
	$(foreach m,$(PKG_MOD_AVAILABLE), \
	  $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \
	) \
	ac_cv_search___atomic_load=no

EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib

define Package/strongswan/conffiles
/etc/strongswan.conf
/etc/strongswan.d/
endef

define Package/strongswan/install
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libstrongswan.so.* $(1)/usr/lib/ipsec/
	$(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
	$(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
endef

define Package/strongswan-default/install
	true
endef

define Package/strongswan-full/install
	true
endef

define Package/strongswan-isakmp/install
	true
endef

define Package/strongswan-minimal/install
	true
endef

define Package/strongswan-charon/install
	$(INSTALL_DIR) $(1)/etc/strongswan.d
	$(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon.conf $(1)/etc/strongswan.d
	$(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon-logging.conf $(1)/etc/strongswan.d
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
endef

define Package/strongswan-charon-cmd/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/charon-cmd $(1)/usr/sbin/
endef

define Package/strongswan-ipsec/conffiles
/etc/ipsec.d/
/etc/ipsec.conf
/etc/ipsec.secrets
/etc/ipsec.user
endef

define Package/strongswan-ipsec/install
	$(INSTALL_DIR) $(1)/etc/ $(1)/usr/sbin
	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
endef

define Package/strongswan-pki/install
	$(INSTALL_DIR) $(1)/etc/strongswan.d
	$(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/pki.conf $(1)/etc/strongswan.d/
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
endef

define Package/strongswan-scepclient/install
	$(INSTALL_DIR) $(1)/etc/strongswan.d
	$(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/scepclient.conf $(1)/etc/strongswan.d/
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
endef

define Package/strongswan-swanctl/conffiles
/etc/swanctl/
endef

define Package/strongswan-swanctl/install
	$(INSTALL_DIR) $(1)/etc/swanctl/{bliss,ecdsa,pkcs{12,8},private,pubkey,rsa}
	$(INSTALL_DIR) $(1)/etc/swanctl/x509{,aa,ac,ca,crl,ocsp}
	$(CP) $(PKG_INSTALL_DIR)/etc/swanctl/swanctl.conf $(1)/etc/swanctl/
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/swanctl $(1)/usr/sbin/
endef

define Package/strongswan-libtls/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libtls.so.* $(1)/usr/lib/ipsec/
endef

define Plugin/duplicheck/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/
endef

define Plugin/eap-radius/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libradius.so.* $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-eap-radius.so $(1)/usr/lib/ipsec/plugins/
endef

define Plugin/attr-sql/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/
endef

define Plugin/stroke/install
	$(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts
	$(INSTALL_DIR) $(1)/etc/ipsec.d/acerts
	$(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts
	$(INSTALL_DIR) $(1)/etc/ipsec.d/certs
	$(INSTALL_DIR) $(1)/etc/ipsec.d/crls
	$(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts
	$(INSTALL_DIR) $(1)/etc/ipsec.d/private
	$(INSTALL_DIR) $(1)/etc/ipsec.d/reqs

	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/
endef

define Plugin/updown/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
	$(INSTALL_DIR) $(1)/etc/hotplug.d/ipsec
	$(CP) ./files/etc/hotplug.d/ipsec/01-user \
		$(1)/etc/hotplug.d/ipsec/01-user
endef

define Plugin/vici/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libvici.so.* $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-vici.so $(1)/usr/lib/ipsec/plugins/
endef

define Plugin/whitelist/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/
endef

define Plugin/kernel-libipsec/install
	$(INSTALL_DIR) $(1)/usr/lib/ipsec
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libipsec.so.* $(1)/usr/lib/ipsec/
endef

$(eval $(call BuildPackage,strongswan))
$(eval $(call BuildPackage,strongswan-default))
$(eval $(call BuildPackage,strongswan-full))
$(eval $(call BuildPackage,strongswan-minimal))
$(eval $(call BuildPackage,strongswan-isakmp))
$(eval $(call BuildPackage,strongswan-charon))
$(eval $(call BuildPackage,strongswan-charon-cmd))
$(eval $(call BuildPackage,strongswan-ipsec))
$(eval $(call BuildPackage,strongswan-pki))
$(eval $(call BuildPackage,strongswan-scepclient))
$(eval $(call BuildPackage,strongswan-swanctl))
$(eval $(call BuildPackage,strongswan-libtls))
$(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
$(eval $(call BuildPlugin,aes,AES crypto,))
$(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
$(eval $(call BuildPlugin,agent,SSH agent signing,))
$(eval $(call BuildPlugin,attr,file based config,))
$(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-charon))
$(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
$(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
$(eval $(call BuildPlugin,cmac,CMAC crypto,))
$(eval $(call BuildPlugin,connmark,netfilter connection marking,))
$(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
$(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
$(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
$(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
$(eval $(call BuildPlugin,curve25519,Curve25519 Diffie-Hellman,))
$(eval $(call BuildPlugin,des,DES crypto,))
$(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
$(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
$(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,))
$(eval $(call BuildPlugin,eap-identity,EAP identity helper,))
$(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
$(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,+strongswan-mod-md4 +strongswan-mod-des))
$(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
$(eval $(call BuildPlugin,eap-tls,EAP TLS auth,+strongswan-libtls))
$(eval $(call BuildPlugin,farp,fake arp respsonses,))
$(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
$(eval $(call BuildPlugin,forecast,forward multi/broadcast traffic,+kmod-ipt-conntrack-extra))
$(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
$(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt))
$(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp))
$(eval $(call BuildPlugin,gmpdh,DH-Groups; no libgmp dep,))
$(eval $(call BuildPlugin,ha,high availability cluster,))
$(eval $(call BuildPlugin,hmac,HMAC crypto,))
$(eval $(call BuildPlugin,kernel-libipsec,libipsec kernel interface,))
$(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
$(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap))
$(eval $(call BuildPlugin,led,LED blink on IKE activity,))
$(eval $(call BuildPlugin,load-tester,load testing,))
$(eval $(call BuildPlugin,nonce,nonce genereation,))
$(eval $(call BuildPlugin,md4,MD4 crypto,))
$(eval $(call BuildPlugin,md5,MD5 crypto,))
$(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-mysql:libmysqlclient-r))
$(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl))
$(eval $(call BuildPlugin,pem,PEM decoding,))
$(eval $(call BuildPlugin,pgp,PGP key decoding,))
$(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
$(eval $(call BuildPlugin,pkcs7,PKCS7 key decoding,))
$(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,))
$(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,))
$(eval $(call BuildPlugin,pkcs12,PKCS12 key decoding,))
$(eval $(call BuildPlugin,pubkey,raw public key,))
$(eval $(call BuildPlugin,random,RNG,))
$(eval $(call BuildPlugin,rc2,RC2 crypto,))
$(eval $(call BuildPlugin,resolve,DNS resolver,))
$(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,))
$(eval $(call BuildPlugin,sha1,SHA1 crypto,))
$(eval $(call BuildPlugin,sha2,SHA2 crypto,))
$(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2))
$(eval $(call BuildPlugin,socket-default,default socket implementation for charon,))
$(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,))
$(eval $(call BuildPlugin,sql,SQL database interface,))
$(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
$(eval $(call BuildPlugin,sshkey,SSH key decoding,))
$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-charon +strongswan-ipsec))
$(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
$(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
$(eval $(call BuildPlugin,unity,Cisco Unity extension,))
$(eval $(call BuildPlugin,updown,updown firewall,))
$(eval $(call BuildPlugin,vici,Versatile IKE Configuration Interface,))
$(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
$(eval $(call BuildPlugin,x509,x509 certificate,))
$(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
$(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,))
$(eval $(call BuildPlugin,xcbc,xcbc crypto,))