Condition the creation of some files and their consequences to a
PACKAGECONFIG, which can be overridden outside the meta layer.

It removes the sub package wireguard-tools-wg-quick as PACKAGECONFIG is
supposed to work to configure a package only, and not deal with
sub packages.

Signed-off-by: Daiane Angolini <[email protected]>
---
 .../wireguard/wireguard-tools_1.0.20210914.bb        | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20210914.bb 
b/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20210914.bb
index 20435338c..8def54ece 100644
--- a/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20210914.bb
+++ b/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20210914.bb
@@ -11,24 +11,22 @@ do_install () {
     oe_runmake DESTDIR="${D}" PREFIX="${prefix}" SYSCONFDIR="${sysconfdir}" \
         SYSTEMDUNITDIR="${systemd_system_unitdir}" \
         WITH_SYSTEMDUNITS=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'yes', '', d)} \
-        WITH_BASHCOMPLETION=yes \
-        WITH_WGQUICK=yes \
+        ${PACKAGECONFIG_CONFARGS} \
         install
 }
 
-PACKAGES += "${PN}-wg-quick"
+PACKAGECONFIG ??= "bash-completion wg-quick"
+
+PACKAGECONFIG[bash-completion] = 
"WITH_BASHCOMPLETION=yes,WITH_BASHCOMPLETION=no,,bash,,"
+PACKAGECONFIG[wg-quick]        = "WITH_WGQUICK=yes,WITH_WGQUICK=no,,bash,,"
 
 FILES:${PN} = " \
     ${bindir}/wg \
     ${sysconfdir} \
-"
-FILES:${PN}-wg-quick = " \
     ${bindir}/wg-quick \
     ${systemd_system_unitdir} \
 "
 
-RDEPENDS:${PN}-wg-quick = "${PN} bash"
 RRECOMMENDS:${PN} = " \
     kernel-module-wireguard \
-    ${PN}-wg-quick \
     "
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#106516): 
https://lists.openembedded.org/g/openembedded-devel/message/106516
Mute This Topic: https://lists.openembedded.org/mt/102483832/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to