Skip to contentSkip to conversation

net-tools: split into binary packages

PATCH Superseded Sinan Kaya 1 participant 1 message Nov 21, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH v2 1/1 net-tools: split into binary packages

Support per binary package to not bloat the system with unneeded tools.

---
 .../net-tools/net-tools_1.60-26.bb            | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
meta/recipes-extended/net-tools/net-tools_1.60-26.bb +25 -0
index 8bd30fc6d9b..ace18b830f2 100644
@@ -129,4 +129,29 @@ python __anonymous() {
 }
 ALTERNATIVE_PRIORITY = "100"
 
+python __anonymous () {
+    packages = []
+    for prog in d.getVar('base_sbindir_progs').split():
+        pkg = "net-tools-%s" % prog.replace("_", "-")
+        packages.append(pkg)
+        if not d.getVar("FILES_%s" % pkg):
+                d.setVar("FILES_%s" % pkg, "${base_sbindir}/%s*" % prog)
+    for prog in d.getVar('base_bindir_progs').split():
+        pkg = "net-tools-%s" % prog.replace("_", "-")
+        packages.append(pkg)
+        if not d.getVar("FILES_%s" % pkg):
+                d.setVar("FILES_%s" % pkg, "${base_bindir}/%s*" % prog)
+    pkg = "net-tools-man"
+    packages.append(pkg)
+    if not d.getVar("FILES_%s" % pkg):
+            d.setVar("FILES_%s" % pkg, "${mandir}/*")
+    d.setVar("NETTOOLS_PACKAGES", " ".join(packages))
+}
+# "net-tools" is a metapackage which pulls in all net-tools binaries
+PACKAGES += "${NETTOOLS_PACKAGES}"
+PROVIDES += "${NETTOOLS_PACKAGES}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} += "${NETTOOLS_PACKAGES}"
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1