summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb')
-rw-r--r--meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb194
1 files changed, 194 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb b/meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb
new file mode 100644
index 000000000..2e2da8274
--- /dev/null
+++ b/meta-networking/recipes-support/strongswan/strongswan_5.9.14.bb
@@ -0,0 +1,194 @@
1DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \
2Linux operating system."
3SUMMARY = "strongSwan is an OpenSource IPsec implementation"
4HOMEPAGE = "http://www.strongswan.org"
5SECTION = "net"
6LICENSE = "GPL-2.0-only"
7LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
8DEPENDS = "flex-native flex bison-native"
9DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}"
10
11SRC_URI = "https://download.strongswan.org/strongswan-${PV}.tar.bz2 \
12 "
13
14SRC_URI[sha256sum] = "728027ddda4cb34c67c4cec97d3ddb8c274edfbabdaeecf7e74693b54fc33678"
15
16UPSTREAM_CHECK_REGEX = "strongswan-(?P<pver>\d+(\.\d+)+)\.tar"
17
18EXTRA_OECONF = " \
19 --without-lib-prefix \
20 --with-dev-headers=${includedir}/strongswan \
21"
22
23EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
24
25PACKAGECONFIG ?= "curl gmp openssl sqlite3 swanctl curve25519\
26 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-charon', 'charon', d)} \
27 ${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'tpm2', '', d)} \
28 ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'tnc-imc imc-hcd imc-os imc-scanner imc-attestation', '', d)} \
29 ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'tnc-imv imv-hcd imv-os imv-scanner imv-attestation', '', d)} \
30"
31
32PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
33PACKAGECONFIG[bfd] = "--enable-bfd-backtraces,--disable-bfd-backtraces,binutils"
34PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
35PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
36PACKAGECONFIG[eap-identity] = "--enable-eap-identity,--disable-eap-identity,,${PN}-plugin-eap-identity"
37PACKAGECONFIG[eap-mschapv2] = "--enable-eap-mschapv2,--disable-eap-mschapv2,,${PN}-plugin-eap-mschapv2"
38PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
39PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap"
40PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql"
41PACKAGECONFIG[nm] = "--enable-nm,--disable-nm,networkmanager,${PN}-nm"
42PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl"
43PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup"
44PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite"
45PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke"
46PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
47PACKAGECONFIG[curve25519] = "--enable-curve25519,--disable-curve25519,, ${PN}-plugin-curve25519"
48
49# requires swanctl
50PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd,"
51
52# tpm needs meta-tpm layer
53PACKAGECONFIG[tpm2] = "--enable-tpm,--disable-tpm,,${PN}-plugin-tpm"
54
55
56# integraty configuration needs meta-integraty
57#imc
58PACKAGECONFIG[tnc-imc] = "--enable-tnc-imc,--disable-tnc-imc,, ${PN}-plugin-tnc-imc ${PN}-plugin-tnc-tnccs"
59PACKAGECONFIG[imc-test] = "--enable-imc-test,--disable-imc-test,,"
60PACKAGECONFIG[imc-scanner] = "--enable-imc-scanner,--disable-imc-scanner,,"
61PACKAGECONFIG[imc-os] = "--enable-imc-os,--disable-imc-os,,"
62PACKAGECONFIG[imc-attestation] = "--enable-imc-attestation,--disable-imc-attestation,,"
63PACKAGECONFIG[imc-swima] = "--enable-imc-swima, --disable-imc-swima, json-c,"
64PACKAGECONFIG[imc-hcd] = "--enable-imc-hcd, --disable-imc-hcd,,"
65
66#imv set
67PACKAGECONFIG[tnc-imv] = "--enable-tnc-imv,--disable-tnc-imv,, ${PN}-plugin-tnc-imv ${PN}-plugin-tnc-tnccs"
68PACKAGECONFIG[imv-test] = "--enable-imv-test,--disable-imv-test,,"
69PACKAGECONFIG[imv-scanner] = "--enable-imv-scanner,--disable-imv-scanner,,"
70PACKAGECONFIG[imv-os] = "--enable-imv-os,--disable-imv-os,,"
71PACKAGECONFIG[imv-attestation] = "--enable-imv-attestation,--disable-imv-attestation,,"
72PACKAGECONFIG[imv-swima] = "--enable-imv-swima, --disable-imv-swima, json-c,"
73PACKAGECONFIG[imv-hcd] = "--enable-imv-hcd, --disable-imv-hcd,,"
74
75PACKAGECONFIG[tnc-ifmap] = "--enable-tnc-ifmap,--disable-tnc-ifmap, libxml2, ${PN}-plugin-tnc-ifmap"
76PACKAGECONFIG[tnc-pdp] = "--enable-tnc-pdp,--disable-tnc-pdp,, ${PN}-plugin-tnc-pdp"
77
78PACKAGECONFIG[tnccs-11] = "--enable-tnccs-11,--disable-tnccs-11,libxml2, ${PN}-plugin-tnccs-11"
79PACKAGECONFIG[tnccs-20] = "--enable-tnccs-20,--disable-tnccs-20,, ${PN}-plugin-tnccs-20"
80PACKAGECONFIG[tnccs-dynamic] = "--enable-tnccs-dynamic,--disable-tnccs-dynamic,,${PN}-plugin-tnccs-dynamic"
81
82inherit autotools systemd pkgconfig
83
84RRECOMMENDS:${PN} = "kernel-module-ah4 \
85 kernel-module-esp4 \
86 kernel-module-xfrm-user \
87 "
88
89FILES:${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
90FILES:${PN}-dbg += "${bindir}/.debug ${sbindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
91FILES:${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/include/config.h"
92FILES:${PN}-staticdev += "${libdir}/ipsec/*.a"
93
94CONFFILES:${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf"
95
96PACKAGES += "${PN}-plugins"
97ALLOW_EMPTY:${PN}-plugins = "1"
98
99PACKAGE_BEFORE_PN = "${PN}-imcvs ${PN}-imcvs-dbg"
100ALLOW_EMPTY:${PN}-imcvs = "1"
101
102FILES:${PN}-imcvs = "${libdir}/ipsec/imcvs/*.so"
103FILES:${PN}-imcvs-dbg += "${libdir}/ipsec/imcvs/.debug"
104
105PACKAGES =+ "${PN}-nm ${PN}-nm-dbg"
106FILES:${PN}-nm = "${libexecdir}/ipsec/charon-nm ${datadir}/dbus-1/system.d/nm-strongswan-service.conf"
107FILES:${PN}-nm-dbg = "${libexecdir}/ipsec/.debug/charon-nm"
108
109PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
110NOAUTOPACKAGEDEBUG = "1"
111
112python split_strongswan_plugins () {
113 sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
114 libdir = d.expand('${libdir}/ipsec/plugins')
115 dbglibdir = os.path.join(libdir, '.debug')
116
117 def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
118 dvar = d.getVar('PKGD')
119 oldfiles = d.getVar('CONFFILES:' + pkg)
120 newfile = '/' + os.path.relpath(f, dvar)
121
122 if not oldfiles:
123 d.setVar('CONFFILES:' + pkg, newfile)
124 else:
125 d.setVar('CONFFILES:' + pkg, oldfiles + " " + newfile)
126
127 split_packages = do_split_packages(d, libdir, r'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
128 do_split_packages(d, sysconfdir, r'(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)
129
130 split_dbg_packages = do_split_packages(d, dbglibdir, r'libstrongswan-(.*)\.so', '${PN}-plugin-%s-dbg', 'strongSwan %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
131 split_dev_packages = do_split_packages(d, libdir, r'libstrongswan-(.*)\.la', '${PN}-plugin-%s-dev', 'strongSwan %s plugin - Development files', prepend=True, extra_depends='${PN}-dev')
132 split_staticdev_packages = do_split_packages(d, libdir, r'libstrongswan-(.*)\.a', '${PN}-plugin-%s-staticdev', 'strongSwan %s plugin - Development files (Static Libraries)', prepend=True, extra_depends='${PN}-staticdev')
133
134 if split_packages:
135 pn = d.getVar('PN')
136 d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages))
137 d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
138 d.appendVar('RRECOMMENDS:' + pn + '-dev', ' ' + ' '.join(split_dev_packages))
139 d.appendVar('RRECOMMENDS:' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages))
140}
141
142PACKAGESPLITFUNCS:prepend = "split_strongswan_plugins "
143
144# Install some default plugins based on default strongSwan ./configure options
145# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
146RDEPENDS:${PN} += "\
147 ${PN}-plugin-aes \
148 ${PN}-plugin-attr \
149 ${PN}-plugin-cmac \
150 ${PN}-plugin-constraints \
151 ${PN}-plugin-des \
152 ${PN}-plugin-dnskey \
153 ${PN}-plugin-drbg \
154 ${PN}-plugin-fips-prf \
155 ${PN}-plugin-gcm \
156 ${PN}-plugin-hmac \
157 ${PN}-plugin-kdf \
158 ${PN}-plugin-kernel-netlink \
159 ${PN}-plugin-md5 \
160 ${PN}-plugin-mgf1 \
161 ${PN}-plugin-nonce \
162 ${PN}-plugin-pem \
163 ${PN}-plugin-pgp \
164 ${PN}-plugin-pkcs1 \
165 ${PN}-plugin-pkcs7 \
166 ${PN}-plugin-pkcs8 \
167 ${PN}-plugin-pkcs12 \
168 ${PN}-plugin-pubkey \
169 ${PN}-plugin-random \
170 ${PN}-plugin-rc2 \
171 ${PN}-plugin-resolve \
172 ${PN}-plugin-revocation \
173 ${PN}-plugin-sha1 \
174 ${PN}-plugin-sha2 \
175 ${PN}-plugin-socket-default \
176 ${PN}-plugin-sshkey \
177 ${PN}-plugin-updown \
178 ${PN}-plugin-vici \
179 ${PN}-plugin-x509 \
180 ${PN}-plugin-xauth-generic \
181 ${PN}-plugin-xcbc \
182 "
183
184RPROVIDES:${PN} += "${PN}-systemd"
185RREPLACES:${PN} += "${PN}-systemd"
186RCONFLICTS:${PN} += "${PN}-systemd"
187
188# The deprecated legacy 'strongswan-starter' service should only be used when charon and
189# stroke are enabled. When swanctl is in use, 'strongswan.service' is needed.
190# See: https://wiki.strongswan.org/projects/strongswan/wiki/Charon-systemd
191SYSTEMD_SERVICE:${PN} = " \
192 ${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}.service', '', d)} \
193 ${@bb.utils.contains('PACKAGECONFIG', 'charon', '${BPN}-starter.service', '', d)} \
194"