diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2022-06-29 14:53:05 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-07-02 11:37:03 -0400 |
commit | 689e8422b836d804d9ab102cb3de0a4f6e1f24c8 (patch) | |
tree | aad561cead009269c0d68c5802fe92c3dad7e696 /meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb | |
parent | 13f0e9d6804fd2d78f7593147f9158c8842694da (diff) | |
download | meta-openembedded-689e8422b836d804d9ab102cb3de0a4f6e1f24c8.tar.gz |
strongswan: upgrade 5.9.5 -> 5.9.6
* Drop backport patch 0001-openssl-Don-t-unload-providers.patch
* Backport a patch to fix the build error:
src/libstrongswan/utils/enum.c: In function 'enum_flags_to_string':
src/libstrongswan/utils/enum.c:100:9: error: format not a string literal and no format arguments [-Werror=format-security]
100 | if (snprintf(buf, len, e->names[0]) >= len)
| ^~
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb')
-rw-r--r-- | meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb b/meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb new file mode 100644 index 000000000..1b82dceac --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb | |||
@@ -0,0 +1,186 @@ | |||
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 = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \ | ||
12 | file://0001-enum-Fix-compiler-warning.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI[sha256sum] = "91d0978ac448912759b85452d8ff0d578aafd4507aaf4f1c1719f9d0c7318ab7" | ||
16 | |||
17 | UPSTREAM_CHECK_REGEX = "strongswan-(?P<pver>\d+(\.\d+)+)\.tar" | ||
18 | |||
19 | EXTRA_OECONF = " \ | ||
20 | --without-lib-prefix \ | ||
21 | --with-dev-headers=${includedir}/strongswan \ | ||
22 | " | ||
23 | |||
24 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | ||
25 | |||
26 | PACKAGECONFIG ?= "curl gmp openssl sqlite3 swanctl curve25519\ | ||
27 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-charon', 'charon', d)} \ | ||
28 | ${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'tpm2', '', d)} \ | ||
29 | ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'tnc-imc imc-hcd imc-os imc-scanner imc-attestation', '', d)} \ | ||
30 | ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'tnc-imv imv-hcd imv-os imv-scanner imv-attestation', '', d)} \ | ||
31 | " | ||
32 | |||
33 | PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni" | ||
34 | PACKAGECONFIG[bfd] = "--enable-bfd-backtraces,--disable-bfd-backtraces,binutils" | ||
35 | PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," | ||
36 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl" | ||
37 | PACKAGECONFIG[eap-identity] = "--enable-eap-identity,--disable-eap-identity,,${PN}-plugin-eap-identity" | ||
38 | PACKAGECONFIG[eap-mschapv2] = "--enable-eap-mschapv2,--disable-eap-mschapv2,,${PN}-plugin-eap-mschapv2" | ||
39 | PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp" | ||
40 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap" | ||
41 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql" | ||
42 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl" | ||
43 | PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient," | ||
44 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup" | ||
45 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite" | ||
46 | PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke" | ||
47 | PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc" | ||
48 | PACKAGECONFIG[curve25519] = "--enable-curve25519,--disable-curve25519,, ${PN}-plugin-curve25519" | ||
49 | |||
50 | # requires swanctl | ||
51 | PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd," | ||
52 | |||
53 | # tpm needs meta-tpm layer | ||
54 | PACKAGECONFIG[tpm2] = "--enable-tpm,--disable-tpm,,${PN}-plugin-tpm" | ||
55 | |||
56 | |||
57 | # integraty configuration needs meta-integraty | ||
58 | #imc | ||
59 | PACKAGECONFIG[tnc-imc] = "--enable-tnc-imc,--disable-tnc-imc,, ${PN}-plugin-tnc-imc ${PN}-plugin-tnc-tnccs" | ||
60 | PACKAGECONFIG[imc-test] = "--enable-imc-test,--disable-imc-test,," | ||
61 | PACKAGECONFIG[imc-scanner] = "--enable-imc-scanner,--disable-imc-scanner,," | ||
62 | PACKAGECONFIG[imc-os] = "--enable-imc-os,--disable-imc-os,," | ||
63 | PACKAGECONFIG[imc-attestation] = "--enable-imc-attestation,--disable-imc-attestation,," | ||
64 | PACKAGECONFIG[imc-swima] = "--enable-imc-swima, --disable-imc-swima, json-c," | ||
65 | PACKAGECONFIG[imc-hcd] = "--enable-imc-hcd, --disable-imc-hcd,," | ||
66 | |||
67 | #imv set | ||
68 | PACKAGECONFIG[tnc-imv] = "--enable-tnc-imv,--disable-tnc-imv,, ${PN}-plugin-tnc-imv ${PN}-plugin-tnc-tnccs" | ||
69 | PACKAGECONFIG[imv-test] = "--enable-imv-test,--disable-imv-test,," | ||
70 | PACKAGECONFIG[imv-scanner] = "--enable-imv-scanner,--disable-imv-scanner,," | ||
71 | PACKAGECONFIG[imv-os] = "--enable-imv-os,--disable-imv-os,," | ||
72 | PACKAGECONFIG[imv-attestation] = "--enable-imv-attestation,--disable-imv-attestation,," | ||
73 | PACKAGECONFIG[imv-swima] = "--enable-imv-swima, --disable-imv-swima, json-c," | ||
74 | PACKAGECONFIG[imv-hcd] = "--enable-imv-hcd, --disable-imv-hcd,," | ||
75 | |||
76 | PACKAGECONFIG[tnc-ifmap] = "--enable-tnc-ifmap,--disable-tnc-ifmap, libxml2, ${PN}-plugin-tnc-ifmap" | ||
77 | PACKAGECONFIG[tnc-pdp] = "--enable-tnc-pdp,--disable-tnc-pdp,, ${PN}-plugin-tnc-pdp" | ||
78 | |||
79 | PACKAGECONFIG[tnccs-11] = "--enable-tnccs-11,--disable-tnccs-11,libxml2, ${PN}-plugin-tnccs-11" | ||
80 | PACKAGECONFIG[tnccs-20] = "--enable-tnccs-20,--disable-tnccs-20,, ${PN}-plugin-tnccs-20" | ||
81 | PACKAGECONFIG[tnccs-dynamic] = "--enable-tnccs-dynamic,--disable-tnccs-dynamic,,${PN}-plugin-tnccs-dynamic" | ||
82 | |||
83 | inherit autotools systemd pkgconfig | ||
84 | |||
85 | RRECOMMENDS:${PN} = "kernel-module-ah4 \ | ||
86 | kernel-module-esp4 \ | ||
87 | kernel-module-xfrm-user \ | ||
88 | " | ||
89 | |||
90 | FILES:${PN} += "${libdir}/ipsec/lib*${SOLIBS}" | ||
91 | FILES:${PN}-dbg += "${bindir}/.debug ${sbindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug" | ||
92 | FILES:${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/include/config.h" | ||
93 | FILES:${PN}-staticdev += "${libdir}/ipsec/*.a" | ||
94 | |||
95 | CONFFILES:${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf" | ||
96 | |||
97 | PACKAGES += "${PN}-plugins" | ||
98 | ALLOW_EMPTY:${PN}-plugins = "1" | ||
99 | |||
100 | PACKAGE_BEFORE_PN = "${PN}-imcvs ${PN}-imcvs-dbg" | ||
101 | ALLOW_EMPTY:${PN}-imcvs = "1" | ||
102 | |||
103 | FILES:${PN}-imcvs = "${libdir}/ipsec/imcvs/*.so" | ||
104 | FILES:${PN}-imcvs-dbg += "${libdir}/ipsec/imcvs/.debug" | ||
105 | |||
106 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" | ||
107 | NOAUTOPACKAGEDEBUG = "1" | ||
108 | |||
109 | python split_strongswan_plugins () { | ||
110 | sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon') | ||
111 | libdir = d.expand('${libdir}/ipsec/plugins') | ||
112 | dbglibdir = os.path.join(libdir, '.debug') | ||
113 | |||
114 | def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename): | ||
115 | dvar = d.getVar('PKGD') | ||
116 | oldfiles = d.getVar('CONFFILES:' + pkg) | ||
117 | newfile = '/' + os.path.relpath(f, dvar) | ||
118 | |||
119 | if not oldfiles: | ||
120 | d.setVar('CONFFILES:' + pkg, newfile) | ||
121 | else: | ||
122 | d.setVar('CONFFILES:' + pkg, oldfiles + " " + newfile) | ||
123 | |||
124 | split_packages = do_split_packages(d, libdir, r'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True) | ||
125 | do_split_packages(d, sysconfdir, r'(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf) | ||
126 | |||
127 | 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') | ||
128 | 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') | ||
129 | 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') | ||
130 | |||
131 | if split_packages: | ||
132 | pn = d.getVar('PN') | ||
133 | d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages)) | ||
134 | d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages)) | ||
135 | d.appendVar('RRECOMMENDS:' + pn + '-dev', ' ' + ' '.join(split_dev_packages)) | ||
136 | d.appendVar('RRECOMMENDS:' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages)) | ||
137 | } | ||
138 | |||
139 | PACKAGESPLITFUNCS:prepend = "split_strongswan_plugins " | ||
140 | |||
141 | # Install some default plugins based on default strongSwan ./configure options | ||
142 | # See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist | ||
143 | RDEPENDS:${PN} += "\ | ||
144 | ${PN}-plugin-aes \ | ||
145 | ${PN}-plugin-attr \ | ||
146 | ${PN}-plugin-cmac \ | ||
147 | ${PN}-plugin-constraints \ | ||
148 | ${PN}-plugin-des \ | ||
149 | ${PN}-plugin-dnskey \ | ||
150 | ${PN}-plugin-hmac \ | ||
151 | ${PN}-plugin-kernel-netlink \ | ||
152 | ${PN}-plugin-md5 \ | ||
153 | ${PN}-plugin-nonce \ | ||
154 | ${PN}-plugin-pem \ | ||
155 | ${PN}-plugin-pgp \ | ||
156 | ${PN}-plugin-pkcs1 \ | ||
157 | ${PN}-plugin-pkcs7 \ | ||
158 | ${PN}-plugin-pkcs8 \ | ||
159 | ${PN}-plugin-pkcs12 \ | ||
160 | ${PN}-plugin-pubkey \ | ||
161 | ${PN}-plugin-random \ | ||
162 | ${PN}-plugin-rc2 \ | ||
163 | ${PN}-plugin-resolve \ | ||
164 | ${PN}-plugin-revocation \ | ||
165 | ${PN}-plugin-sha1 \ | ||
166 | ${PN}-plugin-sha2 \ | ||
167 | ${PN}-plugin-socket-default \ | ||
168 | ${PN}-plugin-sshkey \ | ||
169 | ${PN}-plugin-updown \ | ||
170 | ${PN}-plugin-vici \ | ||
171 | ${PN}-plugin-x509 \ | ||
172 | ${PN}-plugin-xauth-generic \ | ||
173 | ${PN}-plugin-xcbc \ | ||
174 | " | ||
175 | |||
176 | RPROVIDES:${PN} += "${PN}-systemd" | ||
177 | RREPLACES:${PN} += "${PN}-systemd" | ||
178 | RCONFLICTS:${PN} += "${PN}-systemd" | ||
179 | |||
180 | # The deprecated legacy 'strongswan-starter' service should only be used when charon and | ||
181 | # stroke are enabled. When swanctl is in use, 'strongswan.service' is needed. | ||
182 | # See: https://wiki.strongswan.org/projects/strongswan/wiki/Charon-systemd | ||
183 | SYSTEMD_SERVICE:${PN} = " \ | ||
184 | ${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}.service', '', d)} \ | ||
185 | ${@bb.utils.contains('PACKAGECONFIG', 'charon', '${BPN}-starter.service', '', d)} \ | ||
186 | " | ||