diff options
-rw-r--r-- | meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb | 101 |
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 | |||
24 | PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \ | 24 | PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \ |
25 | ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \ | 25 | ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \ |
26 | " | 26 | " |
27 | PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni," | 27 | PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni" |
28 | PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," | 28 | PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," |
29 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl," | 29 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl" |
30 | PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp," | 30 | PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp" |
31 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap," | 31 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap" |
32 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," | 32 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql" |
33 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl," | 33 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl" |
34 | PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient," | 34 | PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient," |
35 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4," | 35 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup" |
36 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3," | 36 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite" |
37 | PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke," | 37 | PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke" |
38 | PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc" | 38 | PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc" |
39 | 39 | ||
40 | # requires swanctl | 40 | # requires swanctl |
@@ -44,10 +44,85 @@ inherit autotools systemd pkgconfig | |||
44 | 44 | ||
45 | RRECOMMENDS_${PN} = "kernel-module-ipsec" | 45 | RRECOMMENDS_${PN} = "kernel-module-ipsec" |
46 | 46 | ||
47 | FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so" | 47 | FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}" |
48 | FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug" | 48 | FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug" |
49 | FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la" | 49 | FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la" |
50 | FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a" | 50 | FILES_${PN}-staticdev += "${libdir}/ipsec/*.a" |
51 | |||
52 | CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf" | ||
53 | |||
54 | PACKAGES += "${PN}-plugins" | ||
55 | ALLOW_EMPTY_${PN}-plugins = "1" | ||
56 | |||
57 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" | ||
58 | NOAUTOPACKAGEDEBUG = "1" | ||
59 | |||
60 | python 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 | |||
90 | PACKAGESPLITFUNCS_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 | ||
94 | RDEPENDS_${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 | ||
52 | RPROVIDES_${PN} += "${PN}-systemd" | 127 | RPROVIDES_${PN} += "${PN}-systemd" |
53 | RREPLACES_${PN} += "${PN}-systemd" | 128 | RREPLACES_${PN} += "${PN}-systemd" |