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