Add a systemd PACKAGECONFIG option to install nftables systemd unit files.
When "systemd" is present in DISTRO_FEATURES, the option is enabled and
the service is installed but disabled by default.

Signed-off-by: Piotr Wejman <[email protected]>
---
 meta-networking/recipes-filter/nftables/nftables_1.1.6.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb 
b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
index cc57db3c81..04066c5fa9 100644
--- a/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
+++ b/meta-networking/recipes-filter/nftables/nftables_1.1.6.bb
@@ -17,9 +17,9 @@ SRC_URI = 
"http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz \
           "
 SRC_URI[sha256sum] = 
"372931bda8556b310636a2f9020adc710f9bab66f47efe0ce90bff800ac2530c"
 
-inherit autotools manpages pkgconfig ptest python3native
+inherit autotools manpages pkgconfig ptest python3native systemd
 
-PACKAGECONFIG ?= "python readline json"
+PACKAGECONFIG ?= "python readline json ${@bb.utils.filter('DISTRO_FEATURES', 
'systemd', d)}"
 PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise 
readline"
 PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
 PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline 
readline"
@@ -28,10 +28,14 @@ PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, 
--without-mini-gmp"
 PACKAGECONFIG[python] = ""
 PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline 
linenoise"
 PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
+PACKAGECONFIG[systemd] = "--with-unitdir=${systemd_system_unitdir}, 
--without-unitdir"
 
 EXTRA_OECONF = " \
     ${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', 
'', '--without-cli', d)}"
 
+SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 
'nftables.service', '', d)}"
+SYSTEMD_AUTO_ENABLE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 
'disable', '', d)}"
+
 PEP517_SOURCE_PATH = "${S}/py"
 
 # xtables will need it on musl see iptables
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#126972): 
https://lists.openembedded.org/g/openembedded-devel/message/126972
Mute This Topic: https://lists.openembedded.org/mt/119296747/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to