Skip to contentSkip to conversation

strongswan: Split plugins

PATCH In review David Vincent 3 participants 4 messages Apr 20, 2017 – Apr 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

---
 .../recipes-support/strongswan/strongswan_5.5.1.bb | 101 ++++++++++++++++++---
 1 file changed, 88 insertions(+), 13 deletions(-)
meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +88 -13
index f9e7ae3c1..d63214ba4 100644
@@ -24,17 +24,17 @@ EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-syst
 PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
 "
-PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,"
+PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
 PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,"
-PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,"
-PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
+PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl"
 PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,"
-PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,"
-PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite"
+PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke"
 PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
 
 # requires swanctl
@@ -44,10 +44,85 @@ inherit autotools systemd pkgconfig
 
 RRECOMMENDS_${PN} = "kernel-module-ipsec"
 
-FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so"
-FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug"
-FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la"
-FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a"
+FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
+FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"
+FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
+
+CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf"
+
+PACKAGES += "${PN}-plugins"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+python split_strongswan_plugins () {
+    sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
+    libdir = d.expand('${libdir}/ipsec/plugins')
+    dbglibdir = os.path.join(libdir, '.debug')
+
+    def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
+        dvar = d.getVar('PKGD', True)
+        oldfiles = d.getVar('CONFFILES_' + pkg, True)
+        newfile = '/' + os.path.relpath(f, dvar)
+
+        if not oldfiles:
+            d.setVar('CONFFILES_' + pkg, newfile)
+        else:
+            d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
+
+    split_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
+    do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)
+
+    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')
+    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')
+    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')
+
+    if split_packages:
+        pn = d.getVar('PN', True)
+        d.setVar('RRECOMMENDS_' + pn + '-plugins', ' '.join(split_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + ' '.join(split_dev_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
+
+# Install some default plugins based on default strongSwan ./configure options
+# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
+RDEPENDS_${PN} += "\
+    ${PN}-plugin-aes \
+    ${PN}-plugin-attr \
+    ${PN}-plugin-cmac \
+    ${PN}-plugin-constraints \
+    ${PN}-plugin-des \
+    ${PN}-plugin-dnskey \
+    ${PN}-plugin-hmac \
+    ${PN}-plugin-kernel-netlink \
+    ${PN}-plugin-md5 \
+    ${PN}-plugin-nonce \
+    ${PN}-plugin-pem \
+    ${PN}-plugin-pgp \
+    ${PN}-plugin-pkcs1 \
+    ${PN}-plugin-pkcs7 \
+    ${PN}-plugin-pkcs8 \
+    ${PN}-plugin-pkcs12 \
+    ${PN}-plugin-pubkey \
+    ${PN}-plugin-random \
+    ${PN}-plugin-rc2 \
+    ${PN}-plugin-resolve \
+    ${PN}-plugin-revocation \
+    ${PN}-plugin-sha1 \
+    ${PN}-plugin-sha2 \
+    ${PN}-plugin-socket-default \
+    ${PN}-plugin-sshkey \
+    ${PN}-plugin-updown \
+    ${PN}-plugin-vici \
+    ${PN}-plugin-x509 \
+    ${PN}-plugin-xauth-generic \
+    ${PN}-plugin-xcbc \
+    "
 
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
Signature · 1 line
2.12.2
#1 lore raw

I think currently the preferred way is only one -dev/-dbg/-staticdev package per recipe.

Why not set RDEPENDS_${PN} based on plugins packaged in first do_split_packages call?

Just my 2c - I'm not using strongswan and Joe has last word for meta-networking.

Quoted 178 lines · David Vincent

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).

---
 .../recipes-support/strongswan/strongswan_5.5.1.bb | 101
++++++++++++++++++---
 1 file changed, 88 insertions(+), 13 deletions(-)
(quoted diff) +0 -0

5.5.1.bb b/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb index f9e7ae3c1..d63214ba4 100644

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +0 -0
@@ -24,17 +24,17 @@ EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES',

'systemd', '--with-syst
PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \

         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \

"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -1
-PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,"
+PACKAGECONFIG[aesni] = "--enable-aesni,--disable-

aesni,,${PN}-plugin-aesni"
PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -5
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,"
-PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,"
-PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,

curl,${PN}-plugin-curl"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -0
+PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,

openldap,${PN}-plugin-ldap"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable- mysql,mysql5,${PN}-plugin-mysql" +PACKAGECONFIG[openssl] = "--enable-openssl,--disable- openssl,openssl,${PN}-plugin-openssl"
PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -3
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,"
-PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,"
-PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,

libsoup-2.4,${PN}-plugin-soup"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable- sqlite,sqlite3,${PN}-plugin-sqlite"
+PACKAGECONFIG[stroke] = "--enable-stroke,--disable- stroke,,${PN}-plugin-stroke"
PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"

 # requires swanctl
meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +0 -1
@@ -44,10 +44,85 @@ inherit autotools systemd pkgconfig
 
 RRECOMMENDS_${PN} = "kernel-module-ipsec"
 
-FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}

${libdir}/ipsec/plugins/*.so"
-FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug"
-FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -1
-FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a"
+FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug

${libexecdir}/ipsec/.debug"
+FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +3 -0
+FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
+
+CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf

${sysconfdir}/strongswan.d/*.conf"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +23 -0
+
+PACKAGES += "${PN}-plugins"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+python split_strongswan_plugins () {
+    sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
+    libdir = d.expand('${libdir}/ipsec/plugins')
+    dbglibdir = os.path.join(libdir, '.debug')
+
+    def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
+        dvar = d.getVar('PKGD', True)
+        oldfiles = d.getVar('CONFFILES_' + pkg, True)
+        newfile = '/' + os.path.relpath(f, dvar)
+
+        if not oldfiles:
+            d.setVar('CONFFILES_' + pkg, newfile)
+        else:
+            d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
+
+    split_packages = do_split_packages(d, libdir,

'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
+ do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s',
'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -0
+
+    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')
+ 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')
+ 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')

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +4 -0
+
+    if split_packages:
+        pn = d.getVar('PN', True)
+        d.setVar('RRECOMMENDS_' + pn + '-plugins', '

'.join(split_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + '
'.join(split_dbg_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + '
'.join(split_dev_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + '
'.join(split_staticdev_packages))

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +5 -0
+}
+
+PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
+
+# Install some default plugins based on default strongSwan ./configure

options

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +33 -1
+# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
+RDEPENDS_${PN} += "\
+    ${PN}-plugin-aes \
+    ${PN}-plugin-attr \
+    ${PN}-plugin-cmac \
+    ${PN}-plugin-constraints \
+    ${PN}-plugin-des \
+    ${PN}-plugin-dnskey \
+    ${PN}-plugin-hmac \
+    ${PN}-plugin-kernel-netlink \
+    ${PN}-plugin-md5 \
+    ${PN}-plugin-nonce \
+    ${PN}-plugin-pem \
+    ${PN}-plugin-pgp \
+    ${PN}-plugin-pkcs1 \
+    ${PN}-plugin-pkcs7 \
+    ${PN}-plugin-pkcs8 \
+    ${PN}-plugin-pkcs12 \
+    ${PN}-plugin-pubkey \
+    ${PN}-plugin-random \
+    ${PN}-plugin-rc2 \
+    ${PN}-plugin-resolve \
+    ${PN}-plugin-revocation \
+    ${PN}-plugin-sha1 \
+    ${PN}-plugin-sha2 \
+    ${PN}-plugin-socket-default \
+    ${PN}-plugin-sshkey \
+    ${PN}-plugin-updown \
+    ${PN}-plugin-vici \
+    ${PN}-plugin-x509 \
+    ${PN}-plugin-xauth-generic \
+    ${PN}-plugin-xcbc \
+    "
 
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
--

2.12.2

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#2 lore raw
Quoted 8 lines · [Re: [oe] [meta-networking][PATCH] strongswan: Split plugins] On 17.04.20 (Thu…

I think currently the preferred way is only one -dev/-dbg/-staticdev package per recipe.

Why not set RDEPENDS_${PN} based on plugins packaged in first do_split_packages call?

Just my 2c - I'm not using strongswan and Joe has last word for meta-networking.

Yeah, I've been giving this some thought and I'm inclined to agree. The RDEPENDS_${PN} being set with a canned list that doesn't reflect what was configured for the build seems non-intuitive.

As for not breaking compatibility with the current configuration, if RDEPENDS_${PN} is set based on the build, won't that come essentially for free?

-J.

Quoted 181 lines
Quoted 178 lines · David Vincent

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).

---
 .../recipes-support/strongswan/strongswan_5.5.1.bb | 101
++++++++++++++++++---
 1 file changed, 88 insertions(+), 13 deletions(-)
(quoted diff) +0 -0

5.5.1.bb b/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb index f9e7ae3c1..d63214ba4 100644

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +0 -0
@@ -24,17 +24,17 @@ EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES',

'systemd', '--with-syst
PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \

         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \

"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -1
-PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,"
+PACKAGECONFIG[aesni] = "--enable-aesni,--disable-

aesni,,${PN}-plugin-aesni"
PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -5
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,"
-PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,"
-PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,

curl,${PN}-plugin-curl"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -0
+PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,

openldap,${PN}-plugin-ldap"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable- mysql,mysql5,${PN}-plugin-mysql" +PACKAGECONFIG[openssl] = "--enable-openssl,--disable- openssl,openssl,${PN}-plugin-openssl"
PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +1 -3
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,"
-PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,"
-PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,

libsoup-2.4,${PN}-plugin-soup"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable- sqlite,sqlite3,${PN}-plugin-sqlite"
+PACKAGECONFIG[stroke] = "--enable-stroke,--disable- stroke,,${PN}-plugin-stroke"
PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"

 # requires swanctl
meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +0 -1
@@ -44,10 +44,85 @@ inherit autotools systemd pkgconfig
 
 RRECOMMENDS_${PN} = "kernel-module-ipsec"
 
-FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}

${libdir}/ipsec/plugins/*.so"
-FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug"
-FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -1
-FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a"
+FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug

${libexecdir}/ipsec/.debug"
+FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +3 -0
+FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
+
+CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf

${sysconfdir}/strongswan.d/*.conf"

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +23 -0
+
+PACKAGES += "${PN}-plugins"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+python split_strongswan_plugins () {
+    sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
+    libdir = d.expand('${libdir}/ipsec/plugins')
+    dbglibdir = os.path.join(libdir, '.debug')
+
+    def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
+        dvar = d.getVar('PKGD', True)
+        oldfiles = d.getVar('CONFFILES_' + pkg, True)
+        newfile = '/' + os.path.relpath(f, dvar)
+
+        if not oldfiles:
+            d.setVar('CONFFILES_' + pkg, newfile)
+        else:
+            d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
+
+    split_packages = do_split_packages(d, libdir,

'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
+ do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s',
'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +2 -0
+
+    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')
+ 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')
+ 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')

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +4 -0
+
+    if split_packages:
+        pn = d.getVar('PN', True)
+        d.setVar('RRECOMMENDS_' + pn + '-plugins', '

'.join(split_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + '
'.join(split_dbg_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + '
'.join(split_dev_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + '
'.join(split_staticdev_packages))

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +5 -0
+}
+
+PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
+
+# Install some default plugins based on default strongSwan ./configure

options

meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb +33 -1
+# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
+RDEPENDS_${PN} += "\
+    ${PN}-plugin-aes \
+    ${PN}-plugin-attr \
+    ${PN}-plugin-cmac \
+    ${PN}-plugin-constraints \
+    ${PN}-plugin-des \
+    ${PN}-plugin-dnskey \
+    ${PN}-plugin-hmac \
+    ${PN}-plugin-kernel-netlink \
+    ${PN}-plugin-md5 \
+    ${PN}-plugin-nonce \
+    ${PN}-plugin-pem \
+    ${PN}-plugin-pgp \
+    ${PN}-plugin-pkcs1 \
+    ${PN}-plugin-pkcs7 \
+    ${PN}-plugin-pkcs8 \
+    ${PN}-plugin-pkcs12 \
+    ${PN}-plugin-pubkey \
+    ${PN}-plugin-random \
+    ${PN}-plugin-rc2 \
+    ${PN}-plugin-resolve \
+    ${PN}-plugin-revocation \
+    ${PN}-plugin-sha1 \
+    ${PN}-plugin-sha2 \
+    ${PN}-plugin-socket-default \
+    ${PN}-plugin-sshkey \
+    ${PN}-plugin-updown \
+    ${PN}-plugin-vici \
+    ${PN}-plugin-x509 \
+    ${PN}-plugin-xauth-generic \
+    ${PN}-plugin-xcbc \
+    "
 
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
--

2.12.2

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Signature · 2 lines
-Joe MacDonald.
:wq
#3 lore raw

Sorry for the late reply, I've seen the patch has been merged into master-next but I let this thread unanswered. Here are some thoughts to explain it.

Quoted 1 line · On mercredi 26 avril 2017 16:57:29 CEST Joe MacDonald wrote:

[Re: [oe] [meta-networking][PATCH] strongswan: Split plugins] On 17.04.20

Quoted 2 lines · (Thu 16:36) Martin Jansa wrote:
Quoted 2 lines

I think currently the preferred way is only one -dev/-dbg/-staticdev package per recipe.

OK, I didn't know about this rule but I can send a v2 to remove the -dev/- dbg/-staticdev split if it is preferred.

Quoted 10 lines
Quoted 6 lines

Why not set RDEPENDS_${PN} based on plugins packaged in first do_split_packages call?

Just my 2c - I'm not using strongswan and Joe has last word for meta-networking.

Yeah, I've been giving this some thought and I'm inclined to agree. The RDEPENDS_${PN} being set with a canned list that doesn't reflect what was configured for the build seems non-intuitive.

The list comes from strongswan default configuration. I agree the RDEPENDS seems to come out of nowhere and for now it just looks like the same list as the result of the first do_split_packages call.

My main reasoning was to not break compatibility with existing use cases while still offering the possibility to refine it in the near future if some plugins are not required.
There is also the possibility to enable the compilation of all plugins with '--enable-all' and only install the default set. Therefore, it will be up to the user to select its own set through IMAGE_INSTALL (or like perl does) One last possibility will be to use PACKAGECONFIGs for all plugins and build the RDEPENDS list automatically.

Quoted 7 lines

As for not breaking compatibility with the current configuration, if RDEPENDS_${PN} is set based on the build, won't that come essentially for free?

-J.

Please, let me know if modifications are required.

--
David