summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Vincent <freesilicon@gmail.com>2017-04-20 15:57:35 +0200
committerJoe MacDonald <joe_macdonald@mentor.com>2017-04-27 12:02:13 -0400
commit57d3b5c5c8e6b649f0b029ce5a2a4c51387e3882 (patch)
tree7946da9395e907ab6736b5b927289b25914c799d
parentbe327baf0e5d9db51787efba73d948d5002e9c6e (diff)
downloadmeta-openembedded-57d3b5c5c8e6b649f0b029ce5a2a4c51387e3882.tar.gz
strongswan: Split plugins
strongSwan offers a plugin mechanism therefore it should not be mandatory to install all of them when installing the package. Each plugin is now a self-contained package with the library and its configuration. To remain compatible with the current configuration, a default set of plugins has been selected as RDEPENDS of the main package. This default list is based on the default strongSwan list minus some plugins enabled via PACKAGECONFIG (see https://wiki.strongswan.org/projects/strongswan/PluginList). Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb101
1 files changed, 88 insertions, 13 deletions
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb b/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb
index f9e7ae3c1..d63214ba4 100644
--- a/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb
+++ b/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb
@@ -24,17 +24,17 @@ EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-syst
24PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \ 24PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
25 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \ 25 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
26" 26"
27PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni," 27PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
28PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," 28PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
29PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl," 29PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
30PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp," 30PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
31PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap," 31PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap"
32PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," 32PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql"
33PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl," 33PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl"
34PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient," 34PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"
35PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4," 35PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup"
36PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3," 36PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite"
37PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke," 37PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke"
38PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc" 38PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
39 39
40# requires swanctl 40# requires swanctl
@@ -44,10 +44,85 @@ inherit autotools systemd pkgconfig
44 44
45RRECOMMENDS_${PN} = "kernel-module-ipsec" 45RRECOMMENDS_${PN} = "kernel-module-ipsec"
46 46
47FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so" 47FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
48FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug" 48FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
49FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la" 49FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"
50FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a" 50FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
51
52CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf"
53
54PACKAGES += "${PN}-plugins"
55ALLOW_EMPTY_${PN}-plugins = "1"
56
57PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
58NOAUTOPACKAGEDEBUG = "1"
59
60python split_strongswan_plugins () {
61 sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
62 libdir = d.expand('${libdir}/ipsec/plugins')
63 dbglibdir = os.path.join(libdir, '.debug')
64
65 def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
66 dvar = d.getVar('PKGD', True)
67 oldfiles = d.getVar('CONFFILES_' + pkg, True)
68 newfile = '/' + os.path.relpath(f, dvar)
69
70 if not oldfiles:
71 d.setVar('CONFFILES_' + pkg, newfile)
72 else:
73 d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
74
75 split_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
76 do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)
77
78 split_dbg_packages = do_split_packages(d, dbglibdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s-dbg', 'strongSwan %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
79 split_dev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.la', '${PN}-plugin-%s-dev', 'strongSwan %s plugin - Development files', prepend=True, extra_depends='${PN}-dev')
80 split_staticdev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.a', '${PN}-plugin-%s-staticdev', 'strongSwan %s plugin - Development files (Static Libraries)', prepend=True, extra_depends='${PN}-staticdev')
81
82 if split_packages:
83 pn = d.getVar('PN', True)
84 d.setVar('RRECOMMENDS_' + pn + '-plugins', ' '.join(split_packages))
85 d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
86 d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + ' '.join(split_dev_packages))
87 d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages))
88}
89
90PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
91
92# Install some default plugins based on default strongSwan ./configure options
93# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
94RDEPENDS_${PN} += "\
95 ${PN}-plugin-aes \
96 ${PN}-plugin-attr \
97 ${PN}-plugin-cmac \
98 ${PN}-plugin-constraints \
99 ${PN}-plugin-des \
100 ${PN}-plugin-dnskey \
101 ${PN}-plugin-hmac \
102 ${PN}-plugin-kernel-netlink \
103 ${PN}-plugin-md5 \
104 ${PN}-plugin-nonce \
105 ${PN}-plugin-pem \
106 ${PN}-plugin-pgp \
107 ${PN}-plugin-pkcs1 \
108 ${PN}-plugin-pkcs7 \
109 ${PN}-plugin-pkcs8 \
110 ${PN}-plugin-pkcs12 \
111 ${PN}-plugin-pubkey \
112 ${PN}-plugin-random \
113 ${PN}-plugin-rc2 \
114 ${PN}-plugin-resolve \
115 ${PN}-plugin-revocation \
116 ${PN}-plugin-sha1 \
117 ${PN}-plugin-sha2 \
118 ${PN}-plugin-socket-default \
119 ${PN}-plugin-sshkey \
120 ${PN}-plugin-updown \
121 ${PN}-plugin-vici \
122 ${PN}-plugin-x509 \
123 ${PN}-plugin-xauth-generic \
124 ${PN}-plugin-xcbc \
125 "
51 126
52RPROVIDES_${PN} += "${PN}-systemd" 127RPROVIDES_${PN} += "${PN}-systemd"
53RREPLACES_${PN} += "${PN}-systemd" 128RREPLACES_${PN} += "${PN}-systemd"